diff --git a/komodo/cli.py b/komodo/cli.py index 42598531..86611181 100755 --- a/komodo/cli.py +++ b/komodo/cli.py @@ -347,7 +347,7 @@ def _main(args: KomodoNamespace) -> None: args: KomodoNamespace instance with configuration """ data = Data(extra_data_dirs=args.extra_data_dirs) - + git_hashes = None if args.download or (not args.build and not args.install): git_hashes = download_packages( args.pkgs.content, diff --git a/komodo/release_transpiler.py b/komodo/release_transpiler.py index 0e4bc7f9..738dbdcc 100755 --- a/komodo/release_transpiler.py +++ b/komodo/release_transpiler.py @@ -37,6 +37,7 @@ def _pick_package_versions_for_release( """ release_dict = {} for pkg_name, versions in packages.items(): + version = None try: _check_version_exists_for_coordinates(versions, rhel_ver, py_ver) except KeyError as err: diff --git a/komodo/symlink/suggester/cli.py b/komodo/symlink/suggester/cli.py index bad95eca..c33a797a 100755 --- a/komodo/symlink/suggester/cli.py +++ b/komodo/symlink/suggester/cli.py @@ -36,7 +36,7 @@ def _parse_args(): formatter_class=argparse.ArgumentDefaultsHelpFormatter, ) parser.add_argument("release", help="e.g. 2019.12.rc0-py38") - parser.add_argument("mode", help="stable,testing,unstable") + parser.add_argument("mode", help="stable,testing") parser.add_argument("joburl", help="link to the job that triggered this") parser.add_argument("jobname", help="name of the job") parser.add_argument( diff --git a/komodo/symlink/suggester/configuration.py b/komodo/symlink/suggester/configuration.py index 66adee00..eb3b4c5f 100644 --- a/komodo/symlink/suggester/configuration.py +++ b/komodo/symlink/suggester/configuration.py @@ -23,11 +23,7 @@ def update(self, release, mode): link_exists = link in self.links linked_release = self._get_concrete_release(link) if link_exists else None - if mode == "unstable": - if not linked_release or release.monthly_diff(linked_release) >= 0: - self.links[link] = repr(release) - - elif mode == "testing": + if mode == "testing": stable_link = f"stable-{release.py_ver()}" stable = ( self._get_concrete_release(stable_link) diff --git a/tests/data/links.json b/tests/data/links.json index 67d08cec..b27ef963 100644 --- a/tests/data/links.json +++ b/tests/data/links.json @@ -2,14 +2,11 @@ "root_folder" : "test_dir", "root_links" : [ "bleeding", - "unstable", "stable" ], "links": { - "2012.01": "2012.01.12", - "unstable": "2012.01.rc1", - "testing": "2012.01", - "stable" : "testing", + "testing": "2012.01.rc1", + "stable" : "2012.01.12", "bleeding": "testing" } } diff --git a/tests/data/links_full.json b/tests/data/links_full.json index 1b648a1f..c22ab5bf 100644 --- a/tests/data/links_full.json +++ b/tests/data/links_full.json @@ -3,8 +3,6 @@ "root_links" : [ "bleeding-py2", "bleeding", - "unstable-py2", - "unstable", "testing-py2", "testing", "stable-py2", @@ -16,13 +14,7 @@ "bleeding-py3" : "bleeding-py36", "bleeding-py2" : "bleeding-py27", "bleeding" : "bleeding-py3", - - "unstable-py36" : "2020.01.a0-py36", - "unstable-py3" : "unstable-py36", - "unstable-py27" : "2020.01.a0-py27", - "unstable-py2" : "unstable-py27", - "unstable" : "unstable-py3", - + "testing-py36" : "2020.01.a0-py36", "testing-py3" : "testing-py36", "testing-py27" : "2020.01.a0-py27", diff --git a/tests/test_link_io_structure.py b/tests/test_link_io_structure.py index 78cc477d..4db5893a 100644 --- a/tests/test_link_io_structure.py +++ b/tests/test_link_io_structure.py @@ -27,17 +27,15 @@ def test_read_folder_structure(tmpdir): os.symlink("2012.01.12", "2012.01") os.symlink("2012.01", "stable") - os.symlink("2012.01", "testing") - os.symlink("2012.01.rc2", "unstable") + os.symlink("2012.01.rc2", "testing") expected_result = { "root_folder": tmpdir, - "root_links": ["stable", "unstable", "testing"], + "root_links": ["stable", "testing"], "links": { "2012.01": "2012.01.12", "stable": "2012.01", - "testing": "2012.01", - "unstable": "2012.01.rc2", + "testing": "2012.01.rc2", }, } @@ -53,8 +51,7 @@ def test_create_symlinks(tmpdir): "links": { "2012.01": "2012.01.12", "stable": "2012.01", - "testing": "2012.01", - "unstable": "2012.01.rc2", + "testing": "2012.01.rc2", }, } @@ -67,7 +64,7 @@ def test_create_symlinks(tmpdir): assert os.path.islink("stable") assert os.readlink("stable") == "2012.01" assert os.path.realpath("stable") == os.path.realpath("2012.01.12") - assert os.path.realpath("unstable") == os.path.realpath("2012.01.rc2") + assert os.path.realpath("testing") == os.path.realpath("2012.01.rc2") def test_create_symlink_stdout(tmpdir, capsys): @@ -170,12 +167,11 @@ def test_link_integrity(tmpdir): test_dict = { "root_folder": tmpdir, - "root_links": ["stable", "unstable", "testing"], + "root_links": ["stable", "testing"], "links": { "2012.01": "2012.01.12", "stable": "2012.01", - "testing": "2012.01", - "unstable": "2012.01.rc2", + "testing": "2012.01.rc2", }, } @@ -186,10 +182,10 @@ def test_link_integrity(tmpdir): errors = verify_integrity(test_dict) assert errors == ["bleeding_py3 does not exist"] - test_dict["links"]["2012.01.rc2"] = "unstable" + test_dict["links"]["2012.01.rc2"] = "testing" errors = verify_integrity(test_dict) assert "2012.01.rc2 is part of a cyclic symlink" in errors - assert "unstable is part of a cyclic symlink" in errors + assert "testing is part of a cyclic symlink" in errors def test_root_folder_error(tmpdir): @@ -198,12 +194,11 @@ def test_root_folder_error(tmpdir): test_dict = { "root_folder": os.path.join(str(tmpdir), "non_existing"), - "root_links": ["stable", "unstable", "testing"], + "root_links": ["stable", "testing"], "links": { "2012.01": "2012.01.12", "stable": "2012.01", - "testing": "2012.01", - "unstable": "2012.01.rc2", + "testing": "2012.01.rc2", }, } @@ -223,12 +218,11 @@ def test_link_error(tmpdir): test_dict = { "root_folder": tmpdir, - "root_links": ["stable", "unstable", "testing"], + "root_links": ["stable", "testing"], "links": { "2012.01": "2012.01.12", "stable": "2012.01", - "testing": "2012.01", - "unstable": "2012.01.rc2", + "testing": "2012.01.rc2", }, } with pytest.raises(ValueError) as value_error: @@ -242,11 +236,11 @@ def test_root_link_error(tmpdir): test_dict = { "root_folder": tmpdir, - "root_links": ["stable", "unstable", "testing"], + "root_links": ["stable", "testing"], "links": { "2012.01": "2012.01.12", "stable": "2012.01", - "unstable": "2012.01.rc2", + "testing": "2012.01.rc2", }, } with pytest.raises(ValueError) as value_error: diff --git a/tests/test_sanity_check.py b/tests/test_sanity_check.py index 712a015a..2baf1904 100644 --- a/tests/test_sanity_check.py +++ b/tests/test_sanity_check.py @@ -27,9 +27,9 @@ def test_assert_root_nodes_error_message_incorrectly_added_roots(): "links": { "stable": "2012.01", "testing": "2012.03", - "unstable": "testing", + "deprecated": "testing", }, - "root_links": ["unstable", "stable", "testing"], + "root_links": ["deprecated", "stable", "testing"], } with pytest.raises( diff --git a/tests/test_suggester.py b/tests/test_suggester.py index 36798288..d3c51ed6 100644 --- a/tests/test_suggester.py +++ b/tests/test_suggester.py @@ -60,16 +60,16 @@ def test_py_ver(release_id, expected): @pytest.mark.parametrize( ("conf", "link", "concrete"), [ - # unstable happy path + # testing happy path ( { "links": { - "unstable-py27": "1349.01-py27", + "testing-py27": "1349.01-py27", "1349.01-py27": "1349.02-py27", "1349.02-py27": "1349.01.a0-py27", }, }, - "unstable-py27", + "testing-py27", "1349.01.a0-py27", ), ], @@ -82,33 +82,18 @@ def test_get_concrete_release(conf, link, concrete): @pytest.mark.parametrize( ("json_in", "release_id", "mode", "changed", "json_out"), [ - # unstable happy path + # testing happy path ( """{"links": { -"unstable-py27": "1994.12.00.rc0-py27", -"testing-py27" : "1994.11.a0-py27", +"testing-py27": "1994.12.00.rc0-py27", "1994.12-py27" : "1994.12.00.rc0-py27"}}""", "1994.12.00.rc1-py27", - "unstable", + "testing", "changed", """{ "links": { "1994.12-py27": "1994.12.00.rc0-py27", - "testing-py27": "1994.11.a0-py27", - "unstable-py27": "1994.12.00.rc1-py27" - } -} -""", - ), - # unstable should not be demoted - ( - """{"links": {"unstable-py27": "1998.12.00-py27"}}""", - "1997.01.00.rc1-py27", - "unstable", - "unchanged", - """{ - "links": { - "unstable-py27": "1998.12.00-py27" + "testing-py27": "1994.12.00.rc1-py27" } } """,