Skip to content

Commit

Permalink
Merge pull request #7 from FAST-HEP/BK_allow_object_default_backends
Browse files Browse the repository at this point in the history
Allow the default backend to be an object rather than a string
  • Loading branch information
benkrikler authored Nov 28, 2019
2 parents c14f007 + ecd8728 commit 0d6277a
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 16 deletions.
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,14 @@ jobs:
- stage: test
script: flake8 --max-line-length=120 fast_flow tests
name: flake8

deploy:
provider: pypi
user: fast-hep
distributions: "sdist bdist_wheel"
password:
secure: "MUmCA3OC1vXBY6s5udms5isN/pYJxm0ze2KpaA1eb0LB/BICaMec5z7zeWSkhlyOUGBVmYRDfErtaVsypkoEejkQQpiCD806l+1PxDVpB7XczR3UGZa/eHK7INPNA3hO0F8lpqLFiSXfHCSzqKVjTqYI7TJB1iJsO+EC4iTrwXJI7desA7vJ+o/VK7lDM7l0vv3m1YU21vDKKmXdfL/NdaQOdVo7NmUQ49dUcGrnKLbvuFQcAT09XLWS+2Ml5KRUsZqOOEz4PuVLvo5lOpolmqOc/wskt2qO7zQTmi54nN6L5wNr92mfOtoBDLVajNfJYyGryRccZotZu3oYHSvmt6AMQXgUdXduY188ZBrO2Qdy9i71E5wra7rNqqWHiiOxPfsvozXXTThPrWrOQ6DI/G/PkDDZfBGLNQIrPMb/UYEkoRYBFtBmuwBYwBGVAsaefyvgoo7+YGCFPWX4G5dd2kKuugLY9femGZPWx/jfMJ3fvCnnlsLeBt4zBNyoeopUxJudjAoG6HLRCcGZU8QVrC6nR4gnP4/7f/BFUWZw17mAH3BAzUM8cvf7CRcaBawwL97Mv/tgibxPsTv2dgc4EB4BFVyIqYQ+8rxObcR4AojNgevklQFeodZzKIB+T7MQmWtRhlzvlyW6NOjNTJzeLtMnPPpUdIEPUxRyW4HqCG8="
on:
tags: true
repo: FAST-HEP/fast-flow
condition: "$TRAVIS_PYTHON_VERSION == 3.6 && $TRAVIS_TAG =~ ^v[0-9]+[.][0-9]+[.][0-9]+(-rc[0-9]+|[.]dev[0-9]+)?$"
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [Unreleased]

## [0.4.0] - 2019-11-28
### Added
- travis CI autodeployment to pypi

### Changed
- Default backend can be provided as a module / object instead of a string, issue #6 [@benkrikler](https://github.com/benkrikler)


## [0.3.0] - 2019-07-27
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![pypi package](https://img.shields.io/pypi/v/fast-flow.svg)](https://pypi.org/project/fast-flow/)
[![pipeline status](https://gitlab.cern.ch/fast-hep/public/fast-flow/badges/master/pipeline.svg)](https://gitlab.cern.ch/fast-hep/public/fast-flow/commits/master)
[![coverage report](https://gitlab.cern.ch/fast-hep/public/fast-flow/badges/master/coverage.svg)](https://gitlab.cern.ch/fast-hep/public/fast-flow/commits/master)
[![Build Status](https://travis-ci.com/FAST-HEP/fast-flow.svg?branch=master)](https://travis-ci.com/FAST-HEP/fast-flow)
[![codecov](https://codecov.io/gh/FAST-HEP/fast-flow/branch/master/graph/badge.svg)](https://codecov.io/gh/FAST-HEP/fast-flow)


fast-flow: A YAML-based processing configuration
Expand All @@ -16,4 +16,4 @@ pip install --user fast-flow

## Documentation
While better documentation is on its way, you might want to look at the examples directory to see how this can be used.
In addition, the [`fast-carpenter`](https://gitlab.cern.ch/fast-hep/public/fast-carpenter) package makes use of this, so it might be helpful to see how this is used there.
In addition, the [`fast-carpenter`](https://github.com/fast-hep/fast-carpenter) package makes use of this, so it might be helpful to see how this is used there.
5 changes: 4 additions & 1 deletion fast_flow/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import logging
from .version import __version__, version_info
logging.basicConfig()
__version__ = "0.3.0"


__all__ = ["__version__", "version_info"]
2 changes: 1 addition & 1 deletion fast_flow/v1/dict_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def read_sequence_dict_internal(stages, general={},
return_future=False):
output_dir = general.get("output_dir", os.getcwd())
default_module = general.get("backend", None)
if default_module:
if default_module and isinstance(default_module, six.string_types):
default_module = importlib.import_module(default_module)
stages = _create_stages(stages, output_dir, stage_descriptions,
this_dir=general.get("this_dir", None),
Expand Down
16 changes: 16 additions & 0 deletions fast_flow/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""Defines version of codebase
"""


def split_version(version):
"""Split a semantic version string into a version_info tuple
"""
result = (version,)
for div in ".-":
result = [tok.split(div) for tok in result]
result = sum(result, [])
return tuple(result)


__version__ = '0.3.0'
version_info = split_version(__version__) # noqa
14 changes: 5 additions & 9 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@ current_version = 0.3.0
commit = True
tag = False

[aliases]
test = pytest

[bumpversion:file:setup.py]
search = version="{current_version}"
replace = version="{new_version}"
[bumpversion:file:fast_flow/version.py]
search = __version__ = '{current_version}'
replace = __version__ = '{new_version}'

[bumpversion:file:fast_flow/__init__.py]
search = __version__ = "{current_version}"
replace = __version__ = "{new_version}"

[aliases]
test = pytest
18 changes: 16 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""The setup script."""
import os
import setuptools


with open("README.md", "r") as fh:
long_description = fh.read()


def get_version():
_globals = {}
with open(os.path.join("fast_flow", "version.py")) as version_file:
exec(version_file.read(), _globals)
return _globals["__version__"]


setuptools.setup(
name="fast-flow",
version="0.3.0",
version=get_version(),
author="Ben Krikler",
author_email="[email protected]",
description="YAML-based analysis flow description language",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://gitlab.cern.ch/fast-hep/public/fast-flow",
url="https://github.com/fast-hep/fast-flow",
packages=setuptools.find_packages(exclude=["tests"]),
install_requires=['six', 'pyyaml'],
#setup_requires=["pytest-runner"],
Expand Down

0 comments on commit 0d6277a

Please sign in to comment.