From 0773d7ddf3939cfb8b1fd708c7623d529b15f021 Mon Sep 17 00:00:00 2001 From: Vince Date: Sat, 16 Mar 2019 10:54:52 -0400 Subject: [PATCH 1/5] inline RST/Sphinx style; https://github.com/databio/lucidoc/issues/17#issuecomment-473536431 --- divvy/utils.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/divvy/utils.py b/divvy/utils.py index 4502bf6..9dc99f5 100644 --- a/divvy/utils.py +++ b/divvy/utils.py @@ -430,18 +430,14 @@ class CommandChecker(object): """ Validate PATH availability of executables referenced by a config file. - :param path_conf_file: path to configuration file with + :param str path_conf_file: path to configuration file with sections detailing executable tools to validate - :type path_conf_file: str - :param sections_to_check: names of + :param Iterable[str] sections_to_check: names of sections of the given configuration file that are relevant; optional, will default to all sections if not given, but some may be excluded via another optional parameter - :type sections_to_check: Iterable[str] - :param sections_to_skip: analogous to + :param Iterable[str] sections_to_skip: analogous to the check names parameter, but for specific sections to skip. - :type sections_to_skip: Iterable[str] - """ From 21ccaaa4ae370e1b104a7f6bc83ad4a0f878f2b4 Mon Sep 17 00:00:00 2001 From: Vince Reuter Date: Tue, 19 Mar 2019 16:50:44 -0400 Subject: [PATCH 2/5] new version RC --- divvy/_version.py | 2 +- divvy/compute.py | 12 ++++++------ divvy/utils.py | 2 +- docs/changelog.md | 5 +++++ requirements/requirements-all.txt | 2 +- tests/divvy_tests/test_divvy.py | 8 ++++---- 6 files changed, 18 insertions(+), 13 deletions(-) diff --git a/divvy/_version.py b/divvy/_version.py index f7a6ec6..50c00d0 100644 --- a/divvy/_version.py +++ b/divvy/_version.py @@ -1,2 +1,2 @@ -__version__ = "0.2" +__version__ = "0.2.1rc0" diff --git a/divvy/compute.py b/divvy/compute.py index 99795df..9dd82ac 100644 --- a/divvy/compute.py +++ b/divvy/compute.py @@ -6,7 +6,7 @@ from sys import stdout import yaml -from attmap import AttMap +from attmap import PepAttMap from .const import \ COMPUTE_SETTINGS_VARNAME, \ DEFAULT_COMPUTE_RESOURCES_NAME @@ -16,7 +16,7 @@ _LOGGER = logging.getLogger(__name__) -class ComputingConfiguration(AttMap): +class ComputingConfiguration(PepAttMap): """ Represents computing configuration objects. @@ -147,7 +147,7 @@ def activate_package(self, package_name): # Augment compute, creating it if needed. if self.compute is None: _LOGGER.debug("Creating Project compute") - self.compute = AttMap() + self.compute = PepAttMap() _LOGGER.debug("Adding entries for package_name '%s'", package_name) self.compute.add_entries(self.compute_packages[package_name]) @@ -186,7 +186,7 @@ def get_active_package(self): """ Returns settings for the currently active compute package - :return AttMap: data defining the active compute package + :return PepAttMap: data defining the active compute package """ return self.compute @@ -204,7 +204,7 @@ def reset_active_settings(self): :return bool: success flag """ - self.compute = AttMap() + self.compute = PepAttMap() return True def update_packages(self, config_file): @@ -241,7 +241,7 @@ def update_packages(self, config_file): loaded_packages[key][key2]) if self.compute_packages is None: - self.compute_packages = AttMap(loaded_packages) + self.compute_packages = PepAttMap(loaded_packages) else: self.compute_packages.add_entries(loaded_packages) _LOGGER.info("Available packages: {}".format(', '.join(self.list_compute_packages()))) diff --git a/divvy/utils.py b/divvy/utils.py index 9dc99f5..50e184c 100644 --- a/divvy/utils.py +++ b/divvy/utils.py @@ -351,7 +351,7 @@ def sample_folder(prj, sample): """ Get the path to this Project's root folder for the given Sample. - :param AttMap | Project prj: project with which sample is associated + :param PepAttMap | Project prj: project with which sample is associated :param Mapping sample: Sample or sample data for which to get root output folder path. :return str: this Project's root folder for the given Sample diff --git a/docs/changelog.md b/docs/changelog.md index 3ddff14..582b337 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,5 +1,10 @@ # Changelog +## divvy [0.2.1] - 2019-03-19 + +### Changed +- For environment variable population, use updated version of `attmap` + ## divvy [0.2] - 2019-03-13 ### Added diff --git a/requirements/requirements-all.txt b/requirements/requirements-all.txt index 7c5620c..137df9e 100644 --- a/requirements/requirements-all.txt +++ b/requirements/requirements-all.txt @@ -1,4 +1,4 @@ pandas>=0.20.2 pyyaml>=3.12 nbsphinx -attmap>=0.2 +attmap>=0.3 diff --git a/tests/divvy_tests/test_divvy.py b/tests/divvy_tests/test_divvy.py index 2ab06b0..d71fa0f 100644 --- a/tests/divvy_tests/test_divvy.py +++ b/tests/divvy_tests/test_divvy.py @@ -1,5 +1,5 @@ import pytest -from attmap import AttMap +from attmap import PepAttMap from tests.conftest import DCC_ATTRIBUTES, FILES class DefaultDCCTests: @@ -51,9 +51,9 @@ class GettingActivePackageTests: """ Test for the get_active_package method""" def test_settings_nonempty(self, dcc): - """ Test if get_active_package produces a nonempty AttMap object """ + """ Test if get_active_package produces a nonempty PepAttMap object """ settings = dcc.get_active_package() - assert settings != AttMap() + assert settings != PepAttMap() class ListingPackagesTests: @@ -88,7 +88,7 @@ class UpdatingPackagesTests: def test_update_packages(self, dcc, config_file): """ Test updating does not produce empty compute packages """ dcc.update_packages(config_file) - assert dcc.compute_packages != AttMap() + assert dcc.compute_packages != PepAttMap() From 764993128726e0b33a136bd02ebf0fa7f2ab8a96 Mon Sep 17 00:00:00 2001 From: Vince Reuter Date: Tue, 19 Mar 2019 18:14:39 -0400 Subject: [PATCH 3/5] use new attmap --- divvy/compute.py | 12 ++++++------ divvy/utils.py | 2 +- tests/divvy_tests/test_divvy.py | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/divvy/compute.py b/divvy/compute.py index 9dd82ac..8009451 100644 --- a/divvy/compute.py +++ b/divvy/compute.py @@ -6,7 +6,7 @@ from sys import stdout import yaml -from attmap import PepAttMap +from attmap import PathExAttMap from .const import \ COMPUTE_SETTINGS_VARNAME, \ DEFAULT_COMPUTE_RESOURCES_NAME @@ -16,7 +16,7 @@ _LOGGER = logging.getLogger(__name__) -class ComputingConfiguration(PepAttMap): +class ComputingConfiguration(PathExAttMap): """ Represents computing configuration objects. @@ -147,7 +147,7 @@ def activate_package(self, package_name): # Augment compute, creating it if needed. if self.compute is None: _LOGGER.debug("Creating Project compute") - self.compute = PepAttMap() + self.compute = PathExAttMap() _LOGGER.debug("Adding entries for package_name '%s'", package_name) self.compute.add_entries(self.compute_packages[package_name]) @@ -186,7 +186,7 @@ def get_active_package(self): """ Returns settings for the currently active compute package - :return PepAttMap: data defining the active compute package + :return PathExAttMap: data defining the active compute package """ return self.compute @@ -204,7 +204,7 @@ def reset_active_settings(self): :return bool: success flag """ - self.compute = PepAttMap() + self.compute = PathExAttMap() return True def update_packages(self, config_file): @@ -241,7 +241,7 @@ def update_packages(self, config_file): loaded_packages[key][key2]) if self.compute_packages is None: - self.compute_packages = PepAttMap(loaded_packages) + self.compute_packages = PathExAttMap(loaded_packages) else: self.compute_packages.add_entries(loaded_packages) _LOGGER.info("Available packages: {}".format(', '.join(self.list_compute_packages()))) diff --git a/divvy/utils.py b/divvy/utils.py index 50e184c..5bb8c0a 100644 --- a/divvy/utils.py +++ b/divvy/utils.py @@ -351,7 +351,7 @@ def sample_folder(prj, sample): """ Get the path to this Project's root folder for the given Sample. - :param PepAttMap | Project prj: project with which sample is associated + :param PathExAttMap | Project prj: project with which sample is associated :param Mapping sample: Sample or sample data for which to get root output folder path. :return str: this Project's root folder for the given Sample diff --git a/tests/divvy_tests/test_divvy.py b/tests/divvy_tests/test_divvy.py index d71fa0f..cfe63e3 100644 --- a/tests/divvy_tests/test_divvy.py +++ b/tests/divvy_tests/test_divvy.py @@ -1,5 +1,5 @@ import pytest -from attmap import PepAttMap +from attmap import PathExAttMap from tests.conftest import DCC_ATTRIBUTES, FILES class DefaultDCCTests: @@ -51,9 +51,9 @@ class GettingActivePackageTests: """ Test for the get_active_package method""" def test_settings_nonempty(self, dcc): - """ Test if get_active_package produces a nonempty PepAttMap object """ + """ Test if get_active_package produces a nonempty PathExAttMap object """ settings = dcc.get_active_package() - assert settings != PepAttMap() + assert settings != PathExAttMap() class ListingPackagesTests: @@ -88,7 +88,7 @@ class UpdatingPackagesTests: def test_update_packages(self, dcc, config_file): """ Test updating does not produce empty compute packages """ dcc.update_packages(config_file) - assert dcc.compute_packages != PepAttMap() + assert dcc.compute_packages != PathExAttMap() From 0cd1182891d6abd692340b4b3770cb82595b3be2 Mon Sep 17 00:00:00 2001 From: Vince Reuter Date: Tue, 19 Mar 2019 18:18:45 -0400 Subject: [PATCH 4/5] bump up attmap req version --- requirements/requirements-all.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements/requirements-all.txt b/requirements/requirements-all.txt index 137df9e..071a003 100644 --- a/requirements/requirements-all.txt +++ b/requirements/requirements-all.txt @@ -1,4 +1,5 @@ pandas>=0.20.2 pyyaml>=3.12 nbsphinx -attmap>=0.3 +attmap>=0.4 + From cd433046b3094c7864e13cec6aef3be176420db1 Mon Sep 17 00:00:00 2001 From: Nathan Sheffield Date: Wed, 20 Mar 2019 08:21:21 -0400 Subject: [PATCH 5/5] version bump --- divvy/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/divvy/_version.py b/divvy/_version.py index 50c00d0..2995a62 100644 --- a/divvy/_version.py +++ b/divvy/_version.py @@ -1,2 +1,2 @@ -__version__ = "0.2.1rc0" +__version__ = "0.2.1"