diff --git a/.gitignore b/.gitignore index f263d88..a94f214 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ /poetry-1.1.14.tar.gz /poetry-1.2.1.tar.gz /poetry-1.2.2.tar.gz +/poetry-1.3.2.tar.gz diff --git a/fix-remove-side-effects-from-tests.patch b/fix-remove-side-effects-from-tests.patch deleted file mode 100644 index da535e2..0000000 --- a/fix-remove-side-effects-from-tests.patch +++ /dev/null @@ -1,218 +0,0 @@ -From 560ecaf5442aef825cb3cdecf46a677f3bfe12f4 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= -Date: Tue, 8 Nov 2022 14:21:29 +0100 -Subject: [PATCH] fix: remove side effects from tests - ---- - tests/installation/test_installer.py | 7 ++-- - tests/installation/test_installer_old.py | 7 ++-- - tests/installation/test_pip_installer.py | 42 +++++++++---------- - .../masonry/builders/test_editable_builder.py | 14 ++++++- - 4 files changed, 41 insertions(+), 29 deletions(-) - -diff --git a/tests/installation/test_installer.py b/tests/installation/test_installer.py -index 1b8938d..3db0d33 100644 ---- a/tests/installation/test_installer.py -+++ b/tests/installation/test_installer.py -@@ -174,8 +174,8 @@ def locker(project_root: Path) -> Locker: - - - @pytest.fixture() --def env() -> NullEnv: -- return NullEnv() -+def env(tmp_path: Path) -> NullEnv: -+ return NullEnv(path=tmp_path) - - - @pytest.fixture() -@@ -1151,12 +1151,13 @@ def test_installer_with_pypi_repository( - locker: Locker, - installed: CustomInstalledRepository, - config: Config, -+ env: NullEnv, - ): - pool = Pool() - pool.add_repository(MockRepository()) - - installer = Installer( -- NullIO(), NullEnv(), package, locker, pool, config, installed=installed -+ NullIO(), env, package, locker, pool, config, installed=installed - ) - - package.add_dependency(Factory.create_dependency("pytest", "^3.5", groups=["dev"])) -diff --git a/tests/installation/test_installer_old.py b/tests/installation/test_installer_old.py -index baa5964..5bb28fd 100644 ---- a/tests/installation/test_installer_old.py -+++ b/tests/installation/test_installer_old.py -@@ -126,8 +126,8 @@ def locker(project_root: Path) -> Locker: - - - @pytest.fixture() --def env() -> NullEnv: -- return NullEnv() -+def env(tmp_path: Path) -> NullEnv: -+ return NullEnv(path=tmp_path) - - - @pytest.fixture() -@@ -819,12 +819,13 @@ def test_installer_with_pypi_repository( - locker: Locker, - installed: CustomInstalledRepository, - config: Config, -+ env: NullEnv, - ): - pool = Pool() - pool.add_repository(MockRepository()) - - installer = Installer( -- NullIO(), NullEnv(), package, locker, pool, config, installed=installed -+ NullIO(), env, package, locker, pool, config, installed=installed - ) - - package.add_dependency(Factory.create_dependency("pytest", "^3.5", groups=["dev"])) -diff --git a/tests/installation/test_pip_installer.py b/tests/installation/test_pip_installer.py -index 62624b6..a556fd6 100644 ---- a/tests/installation/test_pip_installer.py -+++ b/tests/installation/test_pip_installer.py -@@ -57,9 +57,14 @@ def pool() -> Pool: - return Pool() - - -+@pytest.fixture() -+def env(tmp_path: Path) -> NullEnv: -+ return NullEnv(path=tmp_path) -+ -+ - @pytest.fixture --def installer(pool: Pool) -> PipInstaller: -- return PipInstaller(NullEnv(), NullIO(), pool) -+def installer(pool: RepositoryPool, env: NullEnv) -> PipInstaller: -+ return PipInstaller(env, NullIO(), pool) - - - def test_requirement(installer: PipInstaller): -@@ -83,8 +88,8 @@ def test_requirement(installer: PipInstaller): - assert result == expected - - --def test_requirement_source_type_url(): -- installer = PipInstaller(NullEnv(), NullIO(), Pool()) -+def test_requirement_source_type_url(env: NullEnv): -+ installer = PipInstaller(env, NullIO(), Pool()) - - foo = Package( - "foo", -@@ -100,10 +105,9 @@ def test_requirement_source_type_url(): - - - def test_requirement_git_subdirectory( -- pool: Pool, package_git_with_subdirectory: Package -+ pool: RepositoryPool, package_git_with_subdirectory: Package, env: NullEnv - ) -> None: -- null_env = NullEnv() -- installer = PipInstaller(null_env, NullIO(), pool) -+ installer = PipInstaller(env, NullIO(), pool) - result = installer.requirement(package_git_with_subdirectory) - expected = ( - "git+https://github.com/demo/subdirectories.git" -@@ -112,8 +116,8 @@ def test_requirement_git_subdirectory( - - assert result == expected - installer.install(package_git_with_subdirectory) -- assert len(null_env.executed) == 1 -- cmd = null_env.executed[0] -+ assert len(env.executed) == 1 -+ cmd = env.executed[0] - assert Path(cmd[-1]).parts[-3:] == ("demo", "subdirectories", "two") - - -@@ -158,7 +162,7 @@ def test_install_with_non_pypi_default_repository(pool: Pool, installer: PipInst - ("cert", "cert"), - ], - ) --def test_install_with_certs(mocker: MockerFixture, key: str, option: str): -+def test_install_with_certs(mocker: MockerFixture, key: str, option: str, env: NullEnv): - client_path = "path/to/client.pem" - mocker.patch( - "poetry.utils.authenticator.Authenticator.get_certs_for_url", -@@ -169,9 +173,7 @@ def test_install_with_certs(mocker: MockerFixture, key: str, option: str): - pool = Pool() - pool.add_repository(default, default=True) - -- null_env = NullEnv() -- -- installer = PipInstaller(null_env, NullIO(), pool) -+ installer = PipInstaller(env, NullIO(), pool) - - foo = Package( - "foo", -@@ -183,8 +185,8 @@ def test_install_with_certs(mocker: MockerFixture, key: str, option: str): - - installer.install(foo) - -- assert len(null_env.executed) == 1 -- cmd = null_env.executed[0] -+ assert len(env.executed) == 1 -+ cmd = env.executed[0] - assert f"--{option}" in cmd - cert_index = cmd.index(f"--{option}") - # Need to do the str(Path()) bit because Windows paths get modified by Path -@@ -240,16 +242,14 @@ def test_uninstall_git_package_nspkg_pth_cleanup( - assert not re.match(rf"Error processing line 1 of .*{pth_file}", output) - - --def test_install_with_trusted_host(config: Config): -+def test_install_with_trusted_host(config: Config, env: NullEnv): - config.merge({"certificates": {"default": {"cert": False}}}) - - default = LegacyRepository("default", "https://foo.bar") - pool = Pool() - pool.add_repository(default, default=True) - -- null_env = NullEnv() -- -- installer = PipInstaller(null_env, NullIO(), pool) -+ installer = PipInstaller(env, NullIO(), pool) - - foo = Package( - "foo", -@@ -261,8 +261,8 @@ def test_install_with_trusted_host(config: Config): - - installer.install(foo) - -- assert len(null_env.executed) == 1 -- cmd = null_env.executed[0] -+ assert len(env.executed) == 1 -+ cmd = env.executed[0] - assert "--trusted-host" in cmd - cert_index = cmd.index("--trusted-host") - assert cmd[cert_index + 1] == "foo.bar" -diff --git a/tests/masonry/builders/test_editable_builder.py b/tests/masonry/builders/test_editable_builder.py -index effefb4..13abe59 100644 ---- a/tests/masonry/builders/test_editable_builder.py -+++ b/tests/masonry/builders/test_editable_builder.py -@@ -288,9 +288,19 @@ def test_builder_installs_proper_files_when_packages_configured( - - - def test_builder_should_execute_build_scripts( -- mocker: MockerFixture, extended_without_setup_poetry: Poetry, tmp_dir: str -+ mocker: MockerFixture, extended_without_setup_poetry: Poetry, tmp_path: Path - ): -- env = MockEnv(path=Path(tmp_dir) / "foo") -+ env = MockEnv(path=tmp_path / "foo") -+ site_packages_dir = tmp_path / "site-packages" -+ site_packages_dir.mkdir(parents=True, exist_ok=True) -+ mocker.patch.object( -+ env, -+ "get_paths", -+ return_value={ -+ "purelib": str(site_packages_dir), -+ "platlib": str(site_packages_dir), -+ }, -+ ) - mocker.patch( - "poetry.masonry.builders.editable.build_environment" - ).return_value.__enter__.return_value = env --- -2.37.3 - diff --git a/poetry.spec b/poetry.spec index c7db5cf..3fb006a 100644 --- a/poetry.spec +++ b/poetry.spec @@ -1,6 +1,6 @@ # To break circular dependency on poetry-plugin-export, when bootstrapping # we don't BuildRequire runtime deps and we don't run tests. -%bcond bootstrap 0 +%bcond bootstrap 1 %global common_description %{expand: Poetry helps you declare, manage and install dependencies of Python @@ -8,8 +8,8 @@ projects, ensuring you have the right stack everywhere.} Name: poetry Summary: Python dependency management and packaging made easy -Version: 1.2.2 -Release: 4%{?dist} +Version: 1.3.2 +Release: 1%{?dist} License: MIT @@ -24,10 +24,6 @@ Source0: https://github.com/python-poetry/poetry/archive/%{version}/poetr # get_system_wheels_paths() from virtualenv. # TODO get rid of this patch by talking to virtualenv and poetry upstream about a better solution. Patch: Patch-get_embedded_wheel-to-return-system-wheels-fro.patch -# Some tests are failing with permission error because they were writing to the Poetry test -# runtime environment rather than a mocked local directory. -# Merged upstream: https://github.com/python-poetry/poetry/pull/6929.patch -Patch: fix-remove-side-effects-from-tests.patch BuildArch: noarch @@ -130,6 +126,9 @@ not editable_builder" \ %changelog +* Mon Feb 20 2023 Tomáš Hrnčiar - 1.3.2-1 +- Update to 1.3.2 + * Thu Jan 26 2023 Miro Hrončok - 1.2.2-4 - Allow newer version of dulwich diff --git a/sources b/sources index 3dbc08d..4628957 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (poetry-1.2.2.tar.gz) = ed1f7574d4440cfd7aeb5ae0b7af1575f8a284ed0cc9d871dbe75ad2225e8c67aea3629cfaf70e696e5d56b8c913b0b60fab0c52785a687c96be6cd9caaca16a +SHA512 (poetry-1.3.2.tar.gz) = a591d69961e7992d8be28c81bdba35ba6ce63b1cc7c9af2e244f6aa92a6890f9e6976d322168bfc317a4e40537f33e39bb0dc9153b6ab142ecf464f1415975c1