diff --git a/CHANGELOG.md b/CHANGELOG.md index 43e68ec..f190573 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ Documenting All Changes to the Skelebot Project --- +## v1.0.1 +#### Changed +- **Artifactory Component** | Fixes bug where the `--user` and `--token` params were not being read in properly + +--- + ## v1.0.0 #### Released: 2019-08-01 #### Added diff --git a/Dockerfile b/Dockerfile index 05aaf6c..b373890 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,8 +3,9 @@ FROM skelebot/python-base MAINTAINER Sean Shookman WORKDIR /app -RUN ["pip", "install", "pyyaml"] -RUN ["pip", "install", "artifactory"] +RUN ["pip", "install", "pyyaml==5.1.2"] +RUN ["pip", "install", "artifactory==0.1.17"] +RUN ["pip", "install", "requests==2.22.0"] RUN ["pip", "install", "coverage"] RUN ["pip", "install", "pytest"] COPY . /app diff --git a/VERSION b/VERSION index afaf360..7dea76e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.0 \ No newline at end of file +1.0.1 diff --git a/setup.py b/setup.py index 28cf08a..ebfd3ab 100644 --- a/setup.py +++ b/setup.py @@ -20,8 +20,9 @@ "pytest" ], install_requires=[ - "pyyaml", - "artifactory", + "pyyaml==5.1.2", + "artifactory==0.1.17", + "requests==2.22.0", "coverage", "pytest" ], diff --git a/skelebot.yaml b/skelebot.yaml index 3eddc9f..0ee9383 100644 --- a/skelebot.yaml +++ b/skelebot.yaml @@ -6,8 +6,9 @@ language: Python ephemeral: False primaryJob: test dependencies: -- pyyaml -- artifactory +- pyyaml==5.1.2 +- artifactory==0.1.17 +- requests==2.22.0 - coverage - pytest ignores: diff --git a/skelebot/components/artifactory.py b/skelebot/components/artifactory.py index c9663ac..e808576 100644 --- a/skelebot/components/artifactory.py +++ b/skelebot/components/artifactory.py @@ -65,12 +65,12 @@ def addParsers(self, subparsers): # Generate the Dockerfile and dockerignore and build the docker image def execute(self, config, args): # Get User and Token if not provided in args - user = None - token = None - if (args.user == None): + user = args.user + token = args.token + if (user == None): user = input("Please provide a valid Artifactory user: ") - if (args.token == None): + if (token == None): token = input("Please provide a valid Artifactory token: ") # Obtain the artifact that matches the provided name @@ -116,8 +116,6 @@ def pullArtifact(self, user, token, file, url): path = artifactory.ArtifactoryPath(url, auth=(user, token)) with path.open() as fd: with open(file, "wb") as out: - content = fd.read() - print(content) out.write(fd.read()) else: print("Artifact Not Found: {url}".format(url=url)) diff --git a/skelebot/systems/generators/yaml.py b/skelebot/systems/generators/yaml.py index 3f4a39b..c870545 100644 --- a/skelebot/systems/generators/yaml.py +++ b/skelebot/systems/generators/yaml.py @@ -67,12 +67,12 @@ def readYaml(env=None): cfgFile = FILE_PATH.format(path=cwd) if os.path.isfile(cfgFile): with open(cfgFile, 'r') as stream: - yamlData = yaml.load(stream) + yamlData = yaml.load(stream, Loader=yaml.FullLoader) if (env is not None): envFile = ENV_FILE_PATH.format(path=cwd, env=env) if os.path.isfile(envFile): with open(envFile, 'r') as stream: - overrideYaml = yaml.load(stream) + overrideYaml = yaml.load(stream, Loader=yaml.FullLoader) yamlData = override(yamlData, overrideYaml) return yamlData diff --git a/test/test_components_artifactory.py b/test/test_components_artifactory.py index a56d07f..be9262a 100644 --- a/test/test_components_artifactory.py +++ b/test/test_components_artifactory.py @@ -46,7 +46,7 @@ def test_execute_push(self, mock_artifactory, mock_remove, mock_copy): self.artifactory.execute(config, args) - mock_artifactory.assert_called_with("artifactory.test.com/ml/test/test_v1.0.0.pkl", auth=(None, None)) + mock_artifactory.assert_called_with("artifactory.test.com/ml/test/test_v1.0.0.pkl", auth=('sean', 'abc123')) mock_copy.assert_called_with("test.pkl", "test_v1.0.0.pkl") mock_remove.assert_called_with("test_v1.0.0.pkl") @@ -58,7 +58,7 @@ def test_execute_pull(self, mock_artifactory, mock_open): self.artifactory.execute(config, args) - mock_artifactory.assert_called_with("artifactory.test.com/ml/test/test_v0.1.0.pkl", auth=(None, None)) + mock_artifactory.assert_called_with("artifactory.test.com/ml/test/test_v0.1.0.pkl", auth=('sean', 'abc123')) mock_open.assert_called_with("test_v0.1.0.pkl", "wb") if __name__ == '__main__': diff --git a/test/test_systems_parsing_skeleParser.py b/test/test_systems_parsing_skeleParser.py index 705465f..b4c83a8 100644 --- a/test/test_systems_parsing_skeleParser.py +++ b/test/test_systems_parsing_skeleParser.py @@ -49,7 +49,7 @@ def test_description(self): ----------------------------------- Version: 0.1.0 Environment: test -Skelebot Version: 1.0.0 +Skelebot Version: 1.0.1 -----------------------------------""" self.assertEqual(description, expectedDescription)