From 2e49721d156e3f5b110663bd855bf425aae264e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C5=A0oltis?= Date: Fri, 4 Oct 2024 12:45:08 +0200 Subject: [PATCH] Add bundler to supported package managers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix unit test to preserve the order of supported package managers sorted alphabetically Signed-off-by: Michal Ĺ oltis --- cachi2/core/resolver.py | 2 +- tests/integration/test_bundler.py | 5 ----- tests/unit/test_cli.py | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/cachi2/core/resolver.py b/cachi2/core/resolver.py index 8a26b9064..3c85b356a 100644 --- a/cachi2/core/resolver.py +++ b/cachi2/core/resolver.py @@ -13,6 +13,7 @@ Handler = Callable[[Request], RequestOutput] _package_managers: dict[PackageManagerType, Handler] = { + "bundler": bundler.fetch_bundler_source, "gomod": gomod.fetch_gomod_source, "npm": npm.fetch_npm_source, "pip": pip.fetch_pip_source, @@ -22,7 +23,6 @@ # This is where we put package managers currently under development in order to # invoke them via CLI _dev_package_managers: dict[PackageManagerType, Handler] = { - "bundler": bundler.fetch_bundler_source, "rpm": rpm.fetch_rpm_source, "yarn-classic": yarn_classic.fetch_yarn_source, "generic": generic.fetch_generic_source, diff --git a/tests/integration/test_bundler.py b/tests/integration/test_bundler.py index 806c86bd2..2e1e07190 100644 --- a/tests/integration/test_bundler.py +++ b/tests/integration/test_bundler.py @@ -16,7 +16,6 @@ repo="https://github.com/cachito-testing/cachi2-bundler.git", ref="malformed_ruby_missing_gemfile", packages=({"path": ".", "type": "bundler"},), - flags=["--dev-package-managers"], check_output=False, check_deps_checksums=False, check_vendor_checksums=False, @@ -30,7 +29,6 @@ repo="https://github.com/cachito-testing/cachi2-bundler.git", ref="malformed_ruby_missing_gemfile_lock", packages=({"path": ".", "type": "bundler"},), - flags=["--dev-package-managers"], check_output=False, check_deps_checksums=False, check_vendor_checksums=False, @@ -44,7 +42,6 @@ repo="https://github.com/cachito-testing/cachi2-bundler.git", ref="malformed_ruby_missing_git_revision", packages=({"path": ".", "type": "bundler"},), - flags=["--dev-package-managers"], check_output=False, check_deps_checksums=False, check_vendor_checksums=False, @@ -58,7 +55,6 @@ repo="https://github.com/cachito-testing/cachi2-bundler.git", ref="well_formed_ruby_all_features", packages=({"path": ".", "type": "bundler"},), - flags=["--dev-package-managers"], check_output=False, check_deps_checksums=False, check_vendor_checksums=False, @@ -72,7 +68,6 @@ repo="https://github.com/cachito-testing/cachi2-bundler.git", ref="well_formed_ruby_without_gemspec", packages=({"path": ".", "type": "bundler"},), - flags=["--dev-package-managers"], check_output=False, check_deps_checksums=False, check_vendor_checksums=False, diff --git a/tests/unit/test_cli.py b/tests/unit/test_cli.py index 05acd5691..320c75b3e 100644 --- a/tests/unit/test_cli.py +++ b/tests/unit/test_cli.py @@ -83,7 +83,7 @@ def test_version_option(self) -> None: result = invoke_expecting_sucess(app, ["--version"]) lines = result.output.splitlines() assert lines[0] == f"cachi2 {expect_version}" - assert lines[1].startswith("Supported package managers: gomod") + assert lines[1].startswith("Supported package managers: bundler") @pytest.mark.parametrize( "file, file_text",