diff --git a/.travis.yml b/.travis.yml index 7a4dbab..f070080 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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]+)?$" diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..cca272d --- /dev/null +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index 2d54570..3fc41c7 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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. diff --git a/fast_flow/__init__.py b/fast_flow/__init__.py index fde0424..a2a089b 100644 --- a/fast_flow/__init__.py +++ b/fast_flow/__init__.py @@ -1,3 +1,6 @@ import logging +from .version import __version__, version_info logging.basicConfig() -__version__ = "0.3.0" + + +__all__ = ["__version__", "version_info"] diff --git a/fast_flow/v1/dict_config.py b/fast_flow/v1/dict_config.py index 8bd4e16..cf85839 100644 --- a/fast_flow/v1/dict_config.py +++ b/fast_flow/v1/dict_config.py @@ -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), diff --git a/fast_flow/version.py b/fast_flow/version.py new file mode 100644 index 0000000..ca74866 --- /dev/null +++ b/fast_flow/version.py @@ -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 diff --git a/setup.cfg b/setup.cfg index 7f02a8a..999d60f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 diff --git a/setup.py b/setup.py index 3a5325b..2698042 100644 --- a/setup.py +++ b/setup.py @@ -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="fast-hep@cern.ch", 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"],