>>> py3-poetry-plugin-export: Building community/py3-poetry-plugin-export 1.9.0-r0 (using abuild 3.16.0_rc4-r0) started Sat, 25 Oct 2025 22:40:05 +0000 >>> py3-poetry-plugin-export: Validating /home/buildozer/aports/community/py3-poetry-plugin-export/APKBUILD... >>> py3-poetry-plugin-export: Analyzing dependencies... >>> py3-poetry-plugin-export: Installing for build: build-base poetry py3-gpep517 py3-installer py3-poetry-core py3-pytest py3-pytest-mock ( 1/109) Installing libbz2 (1.0.8-r6) ( 2/109) Installing libffi (3.5.2-r0) ( 3/109) Installing gdbm (1.26-r0) ( 4/109) Installing xz-libs (5.8.1-r0) ( 5/109) Installing mpdecimal (4.0.1-r0) ( 6/109) Installing libpanelw (6.5_p20251010-r0) ( 7/109) Installing sqlite-libs (3.50.4-r1) ( 8/109) Installing python3 (3.12.12-r0) ( 9/109) Installing python3-pycache-pyc0 (3.12.12-r0) ( 10/109) Installing pyc (3.12.12-r0) ( 11/109) Installing poetry-pyc (2.1.4-r0) ( 12/109) Installing py3-fastjsonschema-pyc (2.21.2-r0) ( 13/109) Installing py3-poetry-core-pyc (2.1.3-r0) ( 14/109) Installing python3-pyc (3.12.12-r0) ( 15/109) Installing py3-fastjsonschema (2.21.2-r0) ( 16/109) Installing py3-lark-parser (1.2.2-r0) ( 17/109) Installing py3-lark-parser-pyc (1.2.2-r0) ( 18/109) Installing py3-parsing (3.2.3-r0) ( 19/109) Installing py3-parsing-pyc (3.2.3-r0) ( 20/109) Installing py3-packaging (25.0-r0) ( 21/109) Installing py3-packaging-pyc (25.0-r0) ( 22/109) Installing py3-poetry-core (2.1.3-r0) ( 23/109) Installing py3-pyproject-hooks (1.2.0-r0) ( 24/109) Installing py3-pyproject-hooks-pyc (1.2.0-r0) ( 25/109) Installing py3-build (1.3.0-r1) ( 26/109) Installing py3-build-pyc (1.3.0-r1) ( 27/109) Installing py3-msgpack (1.0.8-r1) ( 28/109) Installing py3-msgpack-pyc (1.0.8-r1) ( 29/109) Installing py3-certifi (2025.10.5-r0) ( 30/109) Installing py3-certifi-pyc (2025.10.5-r0) ( 31/109) Installing py3-charset-normalizer (3.4.4-r0) ( 32/109) Installing py3-charset-normalizer-pyc (3.4.4-r0) ( 33/109) Installing py3-idna (3.10-r0) ( 34/109) Installing py3-idna-pyc (3.10-r0) ( 35/109) Installing py3-urllib3 (1.26.20-r0) ( 36/109) Installing py3-urllib3-pyc (1.26.20-r0) ( 37/109) Installing py3-requests (2.32.5-r0) ( 38/109) Installing py3-requests-pyc (2.32.5-r0) ( 39/109) Installing py3-cachecontrol (0.14.3-r0) ( 40/109) Installing py3-cachecontrol-pyc (0.14.3-r0) ( 41/109) Installing py3-crashtest (0.4.1-r5) ( 42/109) Installing py3-crashtest-pyc (0.4.1-r5) ( 43/109) Installing py3-rapidfuzz (3.14.1-r0) ( 44/109) Installing py3-rapidfuzz-pyc (3.14.1-r0) ( 45/109) Installing py3-cleo (2.2.1-r0) ( 46/109) Installing py3-cleo-pyc (2.2.1-r0) ( 47/109) Installing py3-dulwich (0.22.8-r0) ( 48/109) Installing py3-dulwich-pyc (0.22.8-r0) ( 49/109) Installing py3-installer (0.7.0-r2) ( 50/109) Installing py3-installer-pyc (0.7.0-r2) ( 51/109) Installing py3-zipp (3.23.0-r0) ( 52/109) Installing py3-zipp-pyc (3.23.0-r0) ( 53/109) Installing py3-importlib-metadata (8.7.0-r0) ( 54/109) Installing py3-importlib-metadata-pyc (8.7.0-r0) ( 55/109) Installing py3-more-itertools (10.8.0-r0) ( 56/109) Installing py3-more-itertools-pyc (10.8.0-r0) ( 57/109) Installing py3-jaraco.classes (3.4.0-r1) ( 58/109) Installing py3-jaraco.classes-pyc (3.4.0-r1) ( 59/109) Installing py3-jeepney (0.9.0-r0) ( 60/109) Installing py3-jeepney-pyc (0.9.0-r0) ( 61/109) Installing py3-cparser (2.22-r1) ( 62/109) Installing py3-cparser-pyc (2.22-r1) ( 63/109) Installing py3-cffi (1.17.1-r1) ( 64/109) Installing py3-cffi-pyc (1.17.1-r1) ( 65/109) Installing py3-cryptography (46.0.2-r0) ( 66/109) Installing py3-cryptography-pyc (46.0.2-r0) ( 67/109) Installing py3-secretstorage (3.4.0-r0) ( 68/109) Installing py3-secretstorage-pyc (3.4.0-r0) ( 69/109) Installing py3-keyring (24.3.1-r2) ( 70/109) Installing py3-keyring-pyc (24.3.1-r2) ( 71/109) Installing py3-pkginfo (1.12.1.2-r0) ( 72/109) Installing py3-pkginfo-pyc (1.12.1.2-r0) ( 73/109) Installing py3-platformdirs (4.5.0-r0) ( 74/109) Installing py3-platformdirs-pyc (4.5.0-r0) ( 75/109) Installing py3-requests-toolbelt (1.0.0-r1) ( 76/109) Installing py3-requests-toolbelt-pyc (1.0.0-r1) ( 77/109) Installing py3-shellingham (1.5.4-r1) ( 78/109) Installing py3-shellingham-pyc (1.5.4-r1) ( 79/109) Installing py3-tomlkit (0.13.3-r0) ( 80/109) Installing py3-tomlkit-pyc (0.13.3-r0) ( 81/109) Installing py3-trove-classifiers (2025.9.11.17-r0) ( 82/109) Installing py3-trove-classifiers-pyc (2025.9.11.17-r0) ( 83/109) Installing py3-distlib (0.4.0-r0) ( 84/109) Installing py3-distlib-pyc (0.4.0-r0) ( 85/109) Installing py3-filelock (3.18.0-r0) ( 86/109) Installing py3-filelock-pyc (3.18.0-r0) ( 87/109) Installing py3-virtualenv (20.32.0-r0) ( 88/109) Installing py3-virtualenv-pyc (20.32.0-r0) ( 89/109) Installing py3-findpython (0.7.0-r1) ( 90/109) Installing py3-pbs-installer (2025.10.14-r0) ( 91/109) Installing py3-pbs-installer-pyc (2025.10.14-r0) ( 92/109) Installing poetry (2.1.4-r0) ( 93/109) Installing py3-gpep517 (19-r0) ( 94/109) Installing py3-gpep517-pyc (19-r0) ( 95/109) Installing py3-iniconfig (2.3.0-r0) ( 96/109) Installing py3-iniconfig-pyc (2.3.0-r0) ( 97/109) Installing py3-pluggy (1.6.0-r0) ( 98/109) Installing py3-pluggy-pyc (1.6.0-r0) ( 99/109) Installing py3-py (1.11.0-r4) (100/109) Installing py3-py-pyc (1.11.0-r4) (101/109) Installing py3-pygments (2.19.2-r0) (102/109) Installing py3-pygments-pyc (2.19.2-r0) (103/109) Installing py3-pytest (8.4.2-r1) (104/109) Installing py3-pytest-pyc (8.4.2-r1) (105/109) Installing py3-mock (5.2.0-r0) (106/109) Installing py3-mock-pyc (5.2.0-r0) (107/109) Installing py3-pytest-mock (3.10.0-r4) (108/109) Installing py3-pytest-mock-pyc (3.10.0-r4) (109/109) Installing .makedepends-py3-poetry-plugin-export (20251025.224026) busybox-1.37.0-r24.trigger: Executing script... OK: 522 MiB in 214 packages >>> py3-poetry-plugin-export: Cleaning up srcdir >>> py3-poetry-plugin-export: Cleaning up pkgdir >>> py3-poetry-plugin-export: Cleaning up tmpdir >>> py3-poetry-plugin-export: Fetching https://distfiles.alpinelinux.org/distfiles/v3.23/py3-poetry-plugin-export-1.9.0.tar.gz Connecting to distfiles.alpinelinux.org (172.105.82.32:443) saving to '/var/cache/distfiles/v3.23/py3-poetry-plugin-export-1.9.0.tar.gz.part' py3-poetry-plugin-ex 100% |********************************| 77437 0:00:00 ETA '/var/cache/distfiles/v3.23/py3-poetry-plugin-export-1.9.0.tar.gz.part' saved /var/cache/distfiles/v3.23/py3-poetry-plugin-export-1.9.0.tar.gz: OK /home/buildozer/aports/community/py3-poetry-plugin-export/pytest.patch: OK >>> py3-poetry-plugin-export: Fetching https://distfiles.alpinelinux.org/distfiles/v3.23/py3-poetry-plugin-export-1.9.0.tar.gz /var/cache/distfiles/v3.23/py3-poetry-plugin-export-1.9.0.tar.gz: OK /home/buildozer/aports/community/py3-poetry-plugin-export/pytest.patch: OK >>> py3-poetry-plugin-export: Unpacking /var/cache/distfiles/v3.23/py3-poetry-plugin-export-1.9.0.tar.gz... >>> py3-poetry-plugin-export: pytest.patch patching file pyproject.toml Hunk #1 succeeded at 106 (offset 22 lines). 2025-10-25 22:40:28,051 gpep517 INFO Building wheel via backend poetry.core.masonry.api 2025-10-25 22:40:28,177 poetry.core.masonry.builders.wheel INFO Building wheel 2025-10-25 22:40:28,194 poetry.core.masonry.builders.wheel INFO Built poetry_plugin_export-1.9.0-py3-none-any.whl 2025-10-25 22:40:28,194 gpep517 INFO The backend produced .dist/poetry_plugin_export-1.9.0-py3-none-any.whl poetry_plugin_export-1.9.0-py3-none-any.whl ============================= test session starts ============================== platform linux -- Python 3.12.12, pytest-8.4.2, pluggy-1.6.0 rootdir: /home/buildozer/aports/community/py3-poetry-plugin-export/src/poetry-plugin-export-1.9.0 configfile: pyproject.toml testpaths: tests plugins: mock-3.10.0 collected 141 items tests/command/test_command_export.py FF..FFFFFF.FF.FFFFF.F.F..... [ 19%] tests/test_exporter.py FFFFFFFF..FFFFFFFFFFFFFF..FFFFFFFFFFFFFF..FFFFFF. [ 54%] .FF..FFFFFFFFFFFFFFFFFFF.........FFFFFF....FF..FFFFFFFFFFFFFF.F [ 99%] tests/test_walker.py . [100%] =================================== FAILURES =================================== _______ test_export_exports_requirements_txt_file_locks_if_no_lock_file ________ tester = poetry = tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_export_exports_requiremen0') def test_export_exports_requirements_txt_file_locks_if_no_lock_file( tester: CommandTester, poetry: Poetry, tmp_path: Path ) -> None: assert not poetry.locker.lock.exists() > _export_requirements(tester, poetry, tmp_path) tests/command/test_command_export.py:122: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tester = poetry = tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_export_exports_requiremen0') def _export_requirements(tester: CommandTester, poetry: Poetry, tmp_path: Path) -> None: from tests.helpers import as_cwd with as_cwd(tmp_path): tester.execute("--format requirements.txt --output requirements.txt") requirements = tmp_path / "requirements.txt" assert requirements.exists() with requirements.open(encoding="utf-8") as f: content = f.read() assert poetry.locker.lock.exists() expected = f"""\ foo==1.0.0 ; {MARKER_PY} """ > assert content == expected E assert 'foo==1.0.0 ;...ion < "4.0"\n' == 'foo==1.0.0 ;...on == "2.7"\n' E E - foo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + foo==1.0.0 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ tests/command/test_command_export.py:115: AssertionError ------------------------------ Captured log call ------------------------------- WARNING virtualenv.seed.embed.base_embed:base_embed.py:38 The --no-wheel and --wheel options are deprecated. They have no effect for Python > 3.8 as wheel is no longer bundled in virtualenv. _____________ test_export_exports_requirements_txt_uses_lock_file ______________ tester = poetry = tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_export_exports_requiremen1') do_lock = None def test_export_exports_requirements_txt_uses_lock_file( tester: CommandTester, poetry: Poetry, tmp_path: Path, do_lock: None ) -> None: > _export_requirements(tester, poetry, tmp_path) tests/command/test_command_export.py:129: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tester = poetry = tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_export_exports_requiremen1') def _export_requirements(tester: CommandTester, poetry: Poetry, tmp_path: Path) -> None: from tests.helpers import as_cwd with as_cwd(tmp_path): tester.execute("--format requirements.txt --output requirements.txt") requirements = tmp_path / "requirements.txt" assert requirements.exists() with requirements.open(encoding="utf-8") as f: content = f.read() assert poetry.locker.lock.exists() expected = f"""\ foo==1.0.0 ; {MARKER_PY} """ > assert content == expected E assert 'foo==1.0.0 ;...ion < "4.0"\n' == 'foo==1.0.0 ;...on == "2.7"\n' E E - foo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + foo==1.0.0 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ tests/command/test_command_export.py:115: AssertionError ___________________ test_export_prints_to_stdout_by_default ____________________ tester = do_lock = None def test_export_prints_to_stdout_by_default( tester: CommandTester, do_lock: None ) -> None: tester.execute("--format requirements.txt") expected = f"""\ foo==1.0.0 ; {MARKER_PY} """ > assert tester.io.fetch_output() == expected E assert 'foo==1.0.0 ;...ion < "4.0"\n' == 'foo==1.0.0 ;...on == "2.7"\n' E E - foo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + foo==1.0.0 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ tests/command/test_command_export.py:157: AssertionError _____________ test_export_uses_requirements_txt_format_by_default ______________ tester = do_lock = None def test_export_uses_requirements_txt_format_by_default( tester: CommandTester, do_lock: None ) -> None: tester.execute() expected = f"""\ foo==1.0.0 ; {MARKER_PY} """ > assert tester.io.fetch_output() == expected E assert 'foo==1.0.0 ;...ion < "4.0"\n' == 'foo==1.0.0 ;...on == "2.7"\n' E E - foo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + foo==1.0.0 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ tests/command/test_command_export.py:167: AssertionError _ test_export_groups[-foo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n] _ tester = do_lock = None, options = '' expected = 'foo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n' @pytest.mark.parametrize( "options, expected", [ ("", f"foo==1.0.0 ; {MARKER_PY}\n"), ("--with dev", f"baz==2.0.0 ; {MARKER_PY}\nfoo==1.0.0 ; {MARKER_PY}\n"), ("--with opt", f"foo==1.0.0 ; {MARKER_PY}\nopt==2.2.0 ; {MARKER_PY}\n"), ( "--with dev,opt", ( f"baz==2.0.0 ; {MARKER_PY}\nfoo==1.0.0 ; {MARKER_PY}\nopt==2.2.0 ;" f" {MARKER_PY}\n" ), ), (f"--without {MAIN_GROUP}", "\n"), ("--without dev", f"foo==1.0.0 ; {MARKER_PY}\n"), ("--without opt", f"foo==1.0.0 ; {MARKER_PY}\n"), (f"--without {MAIN_GROUP},dev,opt", "\n"), (f"--only {MAIN_GROUP}", f"foo==1.0.0 ; {MARKER_PY}\n"), ("--only dev", f"baz==2.0.0 ; {MARKER_PY}\n"), ( f"--only {MAIN_GROUP},dev", f"baz==2.0.0 ; {MARKER_PY}\nfoo==1.0.0 ; {MARKER_PY}\n", ), ], ) def test_export_groups( tester: CommandTester, do_lock: None, options: str, expected: str ) -> None: tester.execute(options) > assert tester.io.fetch_output() == expected E assert 'foo==1.0.0 ;...ion < "4.0"\n' == 'foo==1.0.0 ;...on == "2.7"\n' E E - foo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + foo==1.0.0 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ tests/command/test_command_export.py:199: AssertionError _ test_export_groups[--with dev-baz==2.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\nfoo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n] _ tester = do_lock = None, options = '--with dev' expected = 'baz==2.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\nfoo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n' @pytest.mark.parametrize( "options, expected", [ ("", f"foo==1.0.0 ; {MARKER_PY}\n"), ("--with dev", f"baz==2.0.0 ; {MARKER_PY}\nfoo==1.0.0 ; {MARKER_PY}\n"), ("--with opt", f"foo==1.0.0 ; {MARKER_PY}\nopt==2.2.0 ; {MARKER_PY}\n"), ( "--with dev,opt", ( f"baz==2.0.0 ; {MARKER_PY}\nfoo==1.0.0 ; {MARKER_PY}\nopt==2.2.0 ;" f" {MARKER_PY}\n" ), ), (f"--without {MAIN_GROUP}", "\n"), ("--without dev", f"foo==1.0.0 ; {MARKER_PY}\n"), ("--without opt", f"foo==1.0.0 ; {MARKER_PY}\n"), (f"--without {MAIN_GROUP},dev,opt", "\n"), (f"--only {MAIN_GROUP}", f"foo==1.0.0 ; {MARKER_PY}\n"), ("--only dev", f"baz==2.0.0 ; {MARKER_PY}\n"), ( f"--only {MAIN_GROUP},dev", f"baz==2.0.0 ; {MARKER_PY}\nfoo==1.0.0 ; {MARKER_PY}\n", ), ], ) def test_export_groups( tester: CommandTester, do_lock: None, options: str, expected: str ) -> None: tester.execute(options) > assert tester.io.fetch_output() == expected E assert 'baz==2.0.0 ;...ion < "4.0"\n' == 'baz==2.0.0 ;...on == "2.7"\n' E E - baz==2.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + baz==2.0.0 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - foo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^... E E ...Full output truncated (2 lines hidden), use '-vv' to show tests/command/test_command_export.py:199: AssertionError _ test_export_groups[--with opt-foo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\nopt==2.2.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n] _ tester = do_lock = None, options = '--with opt' expected = 'foo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\nopt==2.2.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n' @pytest.mark.parametrize( "options, expected", [ ("", f"foo==1.0.0 ; {MARKER_PY}\n"), ("--with dev", f"baz==2.0.0 ; {MARKER_PY}\nfoo==1.0.0 ; {MARKER_PY}\n"), ("--with opt", f"foo==1.0.0 ; {MARKER_PY}\nopt==2.2.0 ; {MARKER_PY}\n"), ( "--with dev,opt", ( f"baz==2.0.0 ; {MARKER_PY}\nfoo==1.0.0 ; {MARKER_PY}\nopt==2.2.0 ;" f" {MARKER_PY}\n" ), ), (f"--without {MAIN_GROUP}", "\n"), ("--without dev", f"foo==1.0.0 ; {MARKER_PY}\n"), ("--without opt", f"foo==1.0.0 ; {MARKER_PY}\n"), (f"--without {MAIN_GROUP},dev,opt", "\n"), (f"--only {MAIN_GROUP}", f"foo==1.0.0 ; {MARKER_PY}\n"), ("--only dev", f"baz==2.0.0 ; {MARKER_PY}\n"), ( f"--only {MAIN_GROUP},dev", f"baz==2.0.0 ; {MARKER_PY}\nfoo==1.0.0 ; {MARKER_PY}\n", ), ], ) def test_export_groups( tester: CommandTester, do_lock: None, options: str, expected: str ) -> None: tester.execute(options) > assert tester.io.fetch_output() == expected E assert 'foo==1.0.0 ;...ion < "4.0"\n' == 'foo==1.0.0 ;...on == "2.7"\n' E E - foo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + foo==1.0.0 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - opt==2.2.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^... E E ...Full output truncated (2 lines hidden), use '-vv' to show tests/command/test_command_export.py:199: AssertionError _ test_export_groups[--with dev,opt-baz==2.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\nfoo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\nopt==2.2.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n] _ tester = do_lock = None, options = '--with dev,opt' expected = 'baz==2.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\nfoo==1.0.0 ; python_versi... python_version == "2.7"\nopt==2.2.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n' @pytest.mark.parametrize( "options, expected", [ ("", f"foo==1.0.0 ; {MARKER_PY}\n"), ("--with dev", f"baz==2.0.0 ; {MARKER_PY}\nfoo==1.0.0 ; {MARKER_PY}\n"), ("--with opt", f"foo==1.0.0 ; {MARKER_PY}\nopt==2.2.0 ; {MARKER_PY}\n"), ( "--with dev,opt", ( f"baz==2.0.0 ; {MARKER_PY}\nfoo==1.0.0 ; {MARKER_PY}\nopt==2.2.0 ;" f" {MARKER_PY}\n" ), ), (f"--without {MAIN_GROUP}", "\n"), ("--without dev", f"foo==1.0.0 ; {MARKER_PY}\n"), ("--without opt", f"foo==1.0.0 ; {MARKER_PY}\n"), (f"--without {MAIN_GROUP},dev,opt", "\n"), (f"--only {MAIN_GROUP}", f"foo==1.0.0 ; {MARKER_PY}\n"), ("--only dev", f"baz==2.0.0 ; {MARKER_PY}\n"), ( f"--only {MAIN_GROUP},dev", f"baz==2.0.0 ; {MARKER_PY}\nfoo==1.0.0 ; {MARKER_PY}\n", ), ], ) def test_export_groups( tester: CommandTester, do_lock: None, options: str, expected: str ) -> None: tester.execute(options) > assert tester.io.fetch_output() == expected E assert 'baz==2.0.0 ;...ion < "4.0"\n' == 'baz==2.0.0 ;...on == "2.7"\n' E E - baz==2.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + baz==2.0.0 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - foo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^... E E ...Full output truncated (6 lines hidden), use '-vv' to show tests/command/test_command_export.py:199: AssertionError _ test_export_groups[--without dev-foo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n] _ tester = do_lock = None, options = '--without dev' expected = 'foo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n' @pytest.mark.parametrize( "options, expected", [ ("", f"foo==1.0.0 ; {MARKER_PY}\n"), ("--with dev", f"baz==2.0.0 ; {MARKER_PY}\nfoo==1.0.0 ; {MARKER_PY}\n"), ("--with opt", f"foo==1.0.0 ; {MARKER_PY}\nopt==2.2.0 ; {MARKER_PY}\n"), ( "--with dev,opt", ( f"baz==2.0.0 ; {MARKER_PY}\nfoo==1.0.0 ; {MARKER_PY}\nopt==2.2.0 ;" f" {MARKER_PY}\n" ), ), (f"--without {MAIN_GROUP}", "\n"), ("--without dev", f"foo==1.0.0 ; {MARKER_PY}\n"), ("--without opt", f"foo==1.0.0 ; {MARKER_PY}\n"), (f"--without {MAIN_GROUP},dev,opt", "\n"), (f"--only {MAIN_GROUP}", f"foo==1.0.0 ; {MARKER_PY}\n"), ("--only dev", f"baz==2.0.0 ; {MARKER_PY}\n"), ( f"--only {MAIN_GROUP},dev", f"baz==2.0.0 ; {MARKER_PY}\nfoo==1.0.0 ; {MARKER_PY}\n", ), ], ) def test_export_groups( tester: CommandTester, do_lock: None, options: str, expected: str ) -> None: tester.execute(options) > assert tester.io.fetch_output() == expected E assert 'foo==1.0.0 ;...ion < "4.0"\n' == 'foo==1.0.0 ;...on == "2.7"\n' E E - foo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + foo==1.0.0 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ tests/command/test_command_export.py:199: AssertionError _ test_export_groups[--without opt-foo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n] _ tester = do_lock = None, options = '--without opt' expected = 'foo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n' @pytest.mark.parametrize( "options, expected", [ ("", f"foo==1.0.0 ; {MARKER_PY}\n"), ("--with dev", f"baz==2.0.0 ; {MARKER_PY}\nfoo==1.0.0 ; {MARKER_PY}\n"), ("--with opt", f"foo==1.0.0 ; {MARKER_PY}\nopt==2.2.0 ; {MARKER_PY}\n"), ( "--with dev,opt", ( f"baz==2.0.0 ; {MARKER_PY}\nfoo==1.0.0 ; {MARKER_PY}\nopt==2.2.0 ;" f" {MARKER_PY}\n" ), ), (f"--without {MAIN_GROUP}", "\n"), ("--without dev", f"foo==1.0.0 ; {MARKER_PY}\n"), ("--without opt", f"foo==1.0.0 ; {MARKER_PY}\n"), (f"--without {MAIN_GROUP},dev,opt", "\n"), (f"--only {MAIN_GROUP}", f"foo==1.0.0 ; {MARKER_PY}\n"), ("--only dev", f"baz==2.0.0 ; {MARKER_PY}\n"), ( f"--only {MAIN_GROUP},dev", f"baz==2.0.0 ; {MARKER_PY}\nfoo==1.0.0 ; {MARKER_PY}\n", ), ], ) def test_export_groups( tester: CommandTester, do_lock: None, options: str, expected: str ) -> None: tester.execute(options) > assert tester.io.fetch_output() == expected E assert 'foo==1.0.0 ;...ion < "4.0"\n' == 'foo==1.0.0 ;...on == "2.7"\n' E E - foo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + foo==1.0.0 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ tests/command/test_command_export.py:199: AssertionError _ test_export_groups[--only main-foo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n] _ tester = do_lock = None, options = '--only main' expected = 'foo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n' @pytest.mark.parametrize( "options, expected", [ ("", f"foo==1.0.0 ; {MARKER_PY}\n"), ("--with dev", f"baz==2.0.0 ; {MARKER_PY}\nfoo==1.0.0 ; {MARKER_PY}\n"), ("--with opt", f"foo==1.0.0 ; {MARKER_PY}\nopt==2.2.0 ; {MARKER_PY}\n"), ( "--with dev,opt", ( f"baz==2.0.0 ; {MARKER_PY}\nfoo==1.0.0 ; {MARKER_PY}\nopt==2.2.0 ;" f" {MARKER_PY}\n" ), ), (f"--without {MAIN_GROUP}", "\n"), ("--without dev", f"foo==1.0.0 ; {MARKER_PY}\n"), ("--without opt", f"foo==1.0.0 ; {MARKER_PY}\n"), (f"--without {MAIN_GROUP},dev,opt", "\n"), (f"--only {MAIN_GROUP}", f"foo==1.0.0 ; {MARKER_PY}\n"), ("--only dev", f"baz==2.0.0 ; {MARKER_PY}\n"), ( f"--only {MAIN_GROUP},dev", f"baz==2.0.0 ; {MARKER_PY}\nfoo==1.0.0 ; {MARKER_PY}\n", ), ], ) def test_export_groups( tester: CommandTester, do_lock: None, options: str, expected: str ) -> None: tester.execute(options) > assert tester.io.fetch_output() == expected E assert 'foo==1.0.0 ;...ion < "4.0"\n' == 'foo==1.0.0 ;...on == "2.7"\n' E E - foo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + foo==1.0.0 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ tests/command/test_command_export.py:199: AssertionError _ test_export_groups[--only dev-baz==2.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n] _ tester = do_lock = None, options = '--only dev' expected = 'baz==2.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n' @pytest.mark.parametrize( "options, expected", [ ("", f"foo==1.0.0 ; {MARKER_PY}\n"), ("--with dev", f"baz==2.0.0 ; {MARKER_PY}\nfoo==1.0.0 ; {MARKER_PY}\n"), ("--with opt", f"foo==1.0.0 ; {MARKER_PY}\nopt==2.2.0 ; {MARKER_PY}\n"), ( "--with dev,opt", ( f"baz==2.0.0 ; {MARKER_PY}\nfoo==1.0.0 ; {MARKER_PY}\nopt==2.2.0 ;" f" {MARKER_PY}\n" ), ), (f"--without {MAIN_GROUP}", "\n"), ("--without dev", f"foo==1.0.0 ; {MARKER_PY}\n"), ("--without opt", f"foo==1.0.0 ; {MARKER_PY}\n"), (f"--without {MAIN_GROUP},dev,opt", "\n"), (f"--only {MAIN_GROUP}", f"foo==1.0.0 ; {MARKER_PY}\n"), ("--only dev", f"baz==2.0.0 ; {MARKER_PY}\n"), ( f"--only {MAIN_GROUP},dev", f"baz==2.0.0 ; {MARKER_PY}\nfoo==1.0.0 ; {MARKER_PY}\n", ), ], ) def test_export_groups( tester: CommandTester, do_lock: None, options: str, expected: str ) -> None: tester.execute(options) > assert tester.io.fetch_output() == expected E assert 'baz==2.0.0 ;...ion < "4.0"\n' == 'baz==2.0.0 ;...on == "2.7"\n' E E - baz==2.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + baz==2.0.0 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ tests/command/test_command_export.py:199: AssertionError _ test_export_groups[--only main,dev-baz==2.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\nfoo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n] _ tester = do_lock = None, options = '--only main,dev' expected = 'baz==2.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\nfoo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n' @pytest.mark.parametrize( "options, expected", [ ("", f"foo==1.0.0 ; {MARKER_PY}\n"), ("--with dev", f"baz==2.0.0 ; {MARKER_PY}\nfoo==1.0.0 ; {MARKER_PY}\n"), ("--with opt", f"foo==1.0.0 ; {MARKER_PY}\nopt==2.2.0 ; {MARKER_PY}\n"), ( "--with dev,opt", ( f"baz==2.0.0 ; {MARKER_PY}\nfoo==1.0.0 ; {MARKER_PY}\nopt==2.2.0 ;" f" {MARKER_PY}\n" ), ), (f"--without {MAIN_GROUP}", "\n"), ("--without dev", f"foo==1.0.0 ; {MARKER_PY}\n"), ("--without opt", f"foo==1.0.0 ; {MARKER_PY}\n"), (f"--without {MAIN_GROUP},dev,opt", "\n"), (f"--only {MAIN_GROUP}", f"foo==1.0.0 ; {MARKER_PY}\n"), ("--only dev", f"baz==2.0.0 ; {MARKER_PY}\n"), ( f"--only {MAIN_GROUP},dev", f"baz==2.0.0 ; {MARKER_PY}\nfoo==1.0.0 ; {MARKER_PY}\n", ), ], ) def test_export_groups( tester: CommandTester, do_lock: None, options: str, expected: str ) -> None: tester.execute(options) > assert tester.io.fetch_output() == expected E assert 'baz==2.0.0 ;...ion < "4.0"\n' == 'baz==2.0.0 ;...on == "2.7"\n' E E - baz==2.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + baz==2.0.0 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - foo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^... E E ...Full output truncated (2 lines hidden), use '-vv' to show tests/command/test_command_export.py:199: AssertionError _ test_export_includes_extras_by_flag[feature_bar-bar==1.1.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\nfoo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n] _ tester = do_lock = None, extras = 'feature_bar' expected = 'bar==1.1.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\nfoo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n' @pytest.mark.parametrize( "extras, expected", [ ( "feature_bar", f"""\ bar==1.1.0 ; {MARKER_PY} foo==1.0.0 ; {MARKER_PY} """, ), ( "feature_bar feature_qux", f"""\ bar==1.1.0 ; {MARKER_PY} foo==1.0.0 ; {MARKER_PY} qux==1.2.0 ; {MARKER_PY} """, ), ], ) def test_export_includes_extras_by_flag( tester: CommandTester, do_lock: None, extras: str, expected: str ) -> None: tester.execute(f"--format requirements.txt --extras '{extras}'") > assert tester.io.fetch_output() == expected E assert 'bar==1.1.0 ;...ion < "4.0"\n' == 'bar==1.1.0 ;...on == "2.7"\n' E E - bar==1.1.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==1.1.0 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - foo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^... E E ...Full output truncated (2 lines hidden), use '-vv' to show tests/command/test_command_export.py:226: AssertionError _ test_export_includes_extras_by_flag[feature_bar feature_qux-bar==1.1.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\nfoo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\nqux==1.2.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n] _ tester = do_lock = None, extras = 'feature_bar feature_qux' expected = 'bar==1.1.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\nfoo==1.0.0 ; python_versi... python_version == "2.7"\nqux==1.2.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n' @pytest.mark.parametrize( "extras, expected", [ ( "feature_bar", f"""\ bar==1.1.0 ; {MARKER_PY} foo==1.0.0 ; {MARKER_PY} """, ), ( "feature_bar feature_qux", f"""\ bar==1.1.0 ; {MARKER_PY} foo==1.0.0 ; {MARKER_PY} qux==1.2.0 ; {MARKER_PY} """, ), ], ) def test_export_includes_extras_by_flag( tester: CommandTester, do_lock: None, extras: str, expected: str ) -> None: tester.execute(f"--format requirements.txt --extras '{extras}'") > assert tester.io.fetch_output() == expected E assert 'bar==1.1.0 ;...ion < "4.0"\n' == 'bar==1.1.0 ;...on == "2.7"\n' E E - bar==1.1.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==1.1.0 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - foo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^... E E ...Full output truncated (6 lines hidden), use '-vv' to show tests/command/test_command_export.py:226: AssertionError _________________________ test_export_with_all_extras __________________________ tester = do_lock = None def test_export_with_all_extras(tester: CommandTester, do_lock: None) -> None: tester.execute("--format requirements.txt --all-extras") output = tester.io.fetch_output() > assert f"bar==1.1.0 ; {MARKER_PY}" in output E assert 'bar==1.1.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"' in 'bar==1.1.0 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0"\nfoo==1.0.0 ; python_versi...d python_version < "4.0"\nqux==1.2.0 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0"\n' tests/command/test_command_export.py:239: AssertionError _________________________ test_export_with_all_groups __________________________ tester = do_lock = None def test_export_with_all_groups(tester: CommandTester, do_lock: None) -> None: tester.execute("--format requirements.txt --all-groups") output = tester.io.fetch_output() > assert f"baz==2.0.0 ; {MARKER_PY}" in output E assert 'baz==2.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"' in 'baz==2.0.0 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0"\nfoo==1.0.0 ; python_versi...d python_version < "4.0"\nopt==2.2.0 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0"\n' tests/command/test_command_export.py:256: AssertionError ____ test_exporter_can_export_requirements_txt_with_standard_packages[1.1] _____ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi0') poetry = , lock_version = '1.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_standard_packages( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": [], "bar": []}, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ bar==4.5.6 ; {MARKER_PY} foo==1.2.3 ; {MARKER_PY} """ > assert content == expected E assert 'bar==4.5.6 ;...ion < "4.0"\n' == 'bar==4.5.6 ;...on == "2.7"\n' E E - bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==4.5.6 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - foo==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^... E E ...Full output truncated (2 lines hidden), use '-vv' to show tests/test_exporter.py:159: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. ____ test_exporter_can_export_requirements_txt_with_standard_packages[2.1] _____ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi1') poetry = , lock_version = '2.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_standard_packages( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": [], "bar": []}, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ bar==4.5.6 ; {MARKER_PY} foo==1.2.3 ; {MARKER_PY} """ > assert content == expected E assert 'bar==4.5.6 ;...ion < "4.0"\n' == 'bar==4.5.6 ;...on == "2.7"\n' E E - bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==4.5.6 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - foo==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^... E E ...Full output truncated (2 lines hidden), use '-vv' to show tests/test_exporter.py:159: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_can_export_requirements_txt_with_standard_packages_and_markers[1.1] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi2') poetry = , lock_version = '1.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_standard_packages_and_markers( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", }, { "name": "baz", "version": "7.8.9", "optional": False, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": [], "bar": [], "baz": []}, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][0]["markers"] = "python_version < '3.7'" lock_data["package"][2]["markers"] = "sys_platform == 'win32'" poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] markers = { "foo": "python_version < '3.7'", "bar": "extra =='foo'", "baz": "sys_platform == 'win32'", } set_package_requires(poetry, markers=markers) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ bar==4.5.6 ; {MARKER_PY} baz==7.8.9 ; {MARKER_PY_WIN32} foo==1.2.3 ; {MARKER_PY27.union(MARKER_PY36_ONLY)} """ > assert content == expected E assert 'bar==4.5.6 ;...on == "3.6"\n' == 'bar==4.5.6 ;...on == "3.6"\n' E E Skipping 57 identical trailing characters in diff, use -v to show E - bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==4.5.6 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - baz==7.8.9 ; (python_version >= "3.6" or python_version == "2.7") and sys_platform == "win32" and python_version < "4.0"... E E ...Full output truncated (2 lines hidden), use '-vv' to show tests/test_exporter.py:218: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_can_export_requirements_txt_with_standard_packages_and_markers[2.1] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi3') poetry = , lock_version = '2.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_standard_packages_and_markers( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", }, { "name": "baz", "version": "7.8.9", "optional": False, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": [], "bar": [], "baz": []}, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][0]["markers"] = "python_version < '3.7'" lock_data["package"][2]["markers"] = "sys_platform == 'win32'" poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] markers = { "foo": "python_version < '3.7'", "bar": "extra =='foo'", "baz": "sys_platform == 'win32'", } set_package_requires(poetry, markers=markers) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ bar==4.5.6 ; {MARKER_PY} baz==7.8.9 ; {MARKER_PY_WIN32} foo==1.2.3 ; {MARKER_PY27.union(MARKER_PY36_ONLY)} """ > assert content == expected E assert 'bar==4.5.6 ;...on == "3.6"\n' == 'bar==4.5.6 ;...on == "3.6"\n' E E Skipping 57 identical trailing characters in diff, use -v to show E - bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==4.5.6 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - baz==7.8.9 ; (python_version >= "3.6" or python_version == "2.7") and sys_platform == "win32" and python_version < "4.0"... E E ...Full output truncated (2 lines hidden), use '-vv' to show tests/test_exporter.py:218: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. ____________ test_exporter_can_export_requirements_txt_poetry[1.1] _____________ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi4') poetry = , lock_version = '1.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_poetry( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: """Regression test for #3254""" lock_data: dict[str, Any] = { "package": [ { "name": "poetry", "version": "1.1.4", "optional": False, "python-versions": "*", "dependencies": {"keyring": "*"}, }, { "name": "junit-xml", "version": "1.9", "optional": False, "python-versions": "*", "dependencies": {"six": "*"}, }, { "name": "keyring", "version": "21.8.0", "optional": False, "python-versions": "*", "dependencies": { "SecretStorage": { "version": "*", "markers": "sys_platform == 'linux'", } }, }, { "name": "secretstorage", "version": "3.3.0", "optional": False, "python-versions": "*", "dependencies": {"cryptography": "*"}, }, { "name": "cryptography", "version": "3.2", "optional": False, "python-versions": "*", "dependencies": {"six": "*"}, }, { "name": "six", "version": "1.15.0", "optional": False, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "poetry": [], "keyring": [], "secretstorage": [], "cryptography": [], "six": [], "junit-xml": [], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][3]["markers"] = "sys_platform == 'linux'" lock_data["package"][4]["markers"] = "sys_platform == 'linux'" poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires( poetry, skip={"keyring", "secretstorage", "cryptography", "six"} ) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() # The dependency graph: # junit-xml 1.9 Creates JUnit XML test result documents that can be read by tools # └── six * such as Jenkins # poetry 1.1.4 Python dependency management and packaging made easy. # ├── keyring >=21.2.0,<22.0.0 # │ ├── importlib-metadata >=1 # │ │ └── zipp >=0.5 # │ ├── jeepney >=0.4.2 # │ ├── pywin32-ctypes <0.1.0 || >0.1.0,<0.1.1 || >0.1.1 # │ └── secretstorage >=3.2 -- On linux only # │ ├── cryptography >=2.0 # │ │ └── six >=1.4.1 # │ └── jeepney >=0.6 (circular dependency aborted here) expected = { "poetry": Dependency.create_from_pep_508(f"poetry==1.1.4; {MARKER_PY}"), "junit-xml": Dependency.create_from_pep_508(f"junit-xml==1.9 ; {MARKER_PY}"), "keyring": Dependency.create_from_pep_508(f"keyring==21.8.0 ; {MARKER_PY}"), "secretstorage": Dependency.create_from_pep_508( f"secretstorage==3.3.0 ; {MARKER_PY_LINUX}" ), "cryptography": Dependency.create_from_pep_508( f"cryptography==3.2 ; {MARKER_PY_LINUX}" ), "six": Dependency.create_from_pep_508( f"six==1.15.0 ; {MARKER_PY.union(MARKER_PY_LINUX)}" ), } for line in content.strip().split("\n"): dependency = Dependency.create_from_pep_508(line) assert dependency.name in expected expected_dependency = expected.pop(dependency.name) assert dependency == expected_dependency > assert dependency.marker == expected_dependency.marker E assert = "3.6") and python_version < "4.0" and sys_platform == "linux"> == = "3.6" or python_version == "2.7") and sys_platform == "linux" and python_version < "4.0"> E + where = "3.6") and python_version < "4.0" and sys_platform == "linux"> = .marker E + and = "3.6" or python_version == "2.7") and sys_platform == "linux" and python_version < "4.0"> = .marker tests/test_exporter.py:338: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. ____________ test_exporter_can_export_requirements_txt_poetry[2.1] _____________ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi5') poetry = , lock_version = '2.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_poetry( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: """Regression test for #3254""" lock_data: dict[str, Any] = { "package": [ { "name": "poetry", "version": "1.1.4", "optional": False, "python-versions": "*", "dependencies": {"keyring": "*"}, }, { "name": "junit-xml", "version": "1.9", "optional": False, "python-versions": "*", "dependencies": {"six": "*"}, }, { "name": "keyring", "version": "21.8.0", "optional": False, "python-versions": "*", "dependencies": { "SecretStorage": { "version": "*", "markers": "sys_platform == 'linux'", } }, }, { "name": "secretstorage", "version": "3.3.0", "optional": False, "python-versions": "*", "dependencies": {"cryptography": "*"}, }, { "name": "cryptography", "version": "3.2", "optional": False, "python-versions": "*", "dependencies": {"six": "*"}, }, { "name": "six", "version": "1.15.0", "optional": False, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "poetry": [], "keyring": [], "secretstorage": [], "cryptography": [], "six": [], "junit-xml": [], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][3]["markers"] = "sys_platform == 'linux'" lock_data["package"][4]["markers"] = "sys_platform == 'linux'" poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires( poetry, skip={"keyring", "secretstorage", "cryptography", "six"} ) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() # The dependency graph: # junit-xml 1.9 Creates JUnit XML test result documents that can be read by tools # └── six * such as Jenkins # poetry 1.1.4 Python dependency management and packaging made easy. # ├── keyring >=21.2.0,<22.0.0 # │ ├── importlib-metadata >=1 # │ │ └── zipp >=0.5 # │ ├── jeepney >=0.4.2 # │ ├── pywin32-ctypes <0.1.0 || >0.1.0,<0.1.1 || >0.1.1 # │ └── secretstorage >=3.2 -- On linux only # │ ├── cryptography >=2.0 # │ │ └── six >=1.4.1 # │ └── jeepney >=0.6 (circular dependency aborted here) expected = { "poetry": Dependency.create_from_pep_508(f"poetry==1.1.4; {MARKER_PY}"), "junit-xml": Dependency.create_from_pep_508(f"junit-xml==1.9 ; {MARKER_PY}"), "keyring": Dependency.create_from_pep_508(f"keyring==21.8.0 ; {MARKER_PY}"), "secretstorage": Dependency.create_from_pep_508( f"secretstorage==3.3.0 ; {MARKER_PY_LINUX}" ), "cryptography": Dependency.create_from_pep_508( f"cryptography==3.2 ; {MARKER_PY_LINUX}" ), "six": Dependency.create_from_pep_508( f"six==1.15.0 ; {MARKER_PY.union(MARKER_PY_LINUX)}" ), } for line in content.strip().split("\n"): dependency = Dependency.create_from_pep_508(line) assert dependency.name in expected expected_dependency = expected.pop(dependency.name) assert dependency == expected_dependency > assert dependency.marker == expected_dependency.marker E assert = "3.6") and python_version < "4.0" and sys_platform == "linux"> == = "3.6" or python_version == "2.7") and sys_platform == "linux" and python_version < "4.0"> E + where = "3.6") and python_version < "4.0" and sys_platform == "linux"> = .marker E + and = "3.6" or python_version == "2.7") and sys_platform == "linux" and python_version < "4.0"> = .marker tests/test_exporter.py:338: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. __________ test_exporter_can_export_requirements_txt_pyinstaller[1.1] __________ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi6') poetry = , lock_version = '1.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_pyinstaller( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: """Regression test for #3254""" lock_data: dict[str, Any] = { "package": [ { "name": "pyinstaller", "version": "4.0", "optional": False, "python-versions": "*", "dependencies": { "altgraph": "*", "macholib": { "version": "*", "markers": "sys_platform == 'darwin'", }, }, }, { "name": "altgraph", "version": "0.17", "optional": False, "python-versions": "*", }, { "name": "macholib", "version": "1.8", "optional": False, "python-versions": "*", "dependencies": {"altgraph": ">=0.15"}, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"pyinstaller": [], "altgraph": [], "macholib": []}, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][2]["markers"] = "sys_platform == 'darwin'" poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, skip={"altgraph", "macholib"}) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() # Rationale for the results: # * PyInstaller has an explicit dependency on altgraph, so it must always be # installed. # * PyInstaller requires macholib on Darwin, which in turn requires altgraph. # The dependency graph: # pyinstaller 4.0 PyInstaller bundles a Python application and all its # ├── altgraph * dependencies into a single package. # ├── macholib >=1.8 -- only on Darwin # │ └── altgraph >=0.15 expected = { "pyinstaller": Dependency.create_from_pep_508( f"pyinstaller==4.0 ; {MARKER_PY}" ), "altgraph": Dependency.create_from_pep_508( f"altgraph==0.17 ; {MARKER_PY.union(MARKER_PY_DARWIN)}" ), "macholib": Dependency.create_from_pep_508( f"macholib==1.8 ; {MARKER_PY_DARWIN}" ), } for line in content.strip().split("\n"): dependency = Dependency.create_from_pep_508(line) assert dependency.name in expected expected_dependency = expected.pop(dependency.name) assert dependency == expected_dependency > assert dependency.marker == expected_dependency.marker E assert = "3.6" and python_version < "4.0"> == = "3.6" and python_version < "4.0" or python_version == "2.7"> E + where = "3.6" and python_version < "4.0"> = .marker E + and = "3.6" and python_version < "4.0" or python_version == "2.7"> = .marker tests/test_exporter.py:421: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. __________ test_exporter_can_export_requirements_txt_pyinstaller[2.1] __________ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi7') poetry = , lock_version = '2.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_pyinstaller( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: """Regression test for #3254""" lock_data: dict[str, Any] = { "package": [ { "name": "pyinstaller", "version": "4.0", "optional": False, "python-versions": "*", "dependencies": { "altgraph": "*", "macholib": { "version": "*", "markers": "sys_platform == 'darwin'", }, }, }, { "name": "altgraph", "version": "0.17", "optional": False, "python-versions": "*", }, { "name": "macholib", "version": "1.8", "optional": False, "python-versions": "*", "dependencies": {"altgraph": ">=0.15"}, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"pyinstaller": [], "altgraph": [], "macholib": []}, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][2]["markers"] = "sys_platform == 'darwin'" poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, skip={"altgraph", "macholib"}) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() # Rationale for the results: # * PyInstaller has an explicit dependency on altgraph, so it must always be # installed. # * PyInstaller requires macholib on Darwin, which in turn requires altgraph. # The dependency graph: # pyinstaller 4.0 PyInstaller bundles a Python application and all its # ├── altgraph * dependencies into a single package. # ├── macholib >=1.8 -- only on Darwin # │ └── altgraph >=0.15 expected = { "pyinstaller": Dependency.create_from_pep_508( f"pyinstaller==4.0 ; {MARKER_PY}" ), "altgraph": Dependency.create_from_pep_508( f"altgraph==0.17 ; {MARKER_PY.union(MARKER_PY_DARWIN)}" ), "macholib": Dependency.create_from_pep_508( f"macholib==1.8 ; {MARKER_PY_DARWIN}" ), } for line in content.strip().split("\n"): dependency = Dependency.create_from_pep_508(line) assert dependency.name in expected expected_dependency = expected.pop(dependency.name) assert dependency == expected_dependency > assert dependency.marker == expected_dependency.marker E assert = "3.6" and python_version < "4.0"> == = "3.6" and python_version < "4.0" or python_version == "2.7"> E + where = "3.6" and python_version < "4.0"> = .marker E + and = "3.6" and python_version < "4.0" or python_version == "2.7"> = .marker tests/test_exporter.py:421: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_can_export_requirements_txt_with_nested_packages_and_markers_any[1.1-False-lines0] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi10') poetry = , dev = False lines = ['a==1.2.3 ; python_version >= "3.6" and python_version < "3.8" or python_version == "2.7"'] lock_version = '1.1' @pytest.mark.parametrize( ["dev", "lines"], [ ( False, [f"a==1.2.3 ; {MARKER_PY27.union(MARKER_PY36_38)}"], ), ( True, [ f"a==1.2.3 ; {MARKER_PY27.union(MARKER_PY36_38).union(MARKER_PY36)}", f"b==4.5.6 ; {MARKER_PY}", ], ), ], ) @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_nested_packages_and_markers_any( tmp_path: Path, poetry: Poetry, dev: bool, lines: list[str], lock_version: str ) -> None: lock_data: dict[str, Any] = { "package": [ { "name": "a", "version": "1.2.3", "optional": False, "python-versions": "*", }, { "name": "b", "version": "4.5.6", "optional": False, "python-versions": "*", "dependencies": {"a": ">=1.2.3"}, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"a": [], "b": []}, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][0]["groups"] = ["main", "dev"] lock_data["package"][0]["markers"] = {"main": "python_version < '3.8'"} lock_data["package"][1]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] root = poetry.package.with_dependency_groups([], only=True) root.add_dependency( Factory.create_dependency( name="a", constraint={"version": "^1.2.3", "python": "<3.8"} ) ) root.add_dependency( Factory.create_dependency( name="b", constraint={"version": "^4.5.6"}, groups=["dev"] ) ) poetry._package = root exporter = Exporter(poetry, NullIO()) if dev: exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() > assert content.strip() == "\n".join(lines) E assert 'a==1.2.3 ; p...rsion < "3.8"' == 'a==1.2.3 ; p...sion == "2.7"' E E - a==1.2.3 ; python_version >= "3.6" and python_version < "3.8" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^^ ^^ ^ ^ E + a==1.2.3 ; python_version == "2.7" or python_version >= "3.6" and python_version < "3.8" E ? + ^ ^ ^^ ^^ ^ ^^^ ^ ^ ^ tests/test_exporter.py:592: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_can_export_requirements_txt_with_nested_packages_and_markers_any[1.1-True-lines1] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi11') poetry = , dev = True lines = ['a==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"', 'b==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"'] lock_version = '1.1' @pytest.mark.parametrize( ["dev", "lines"], [ ( False, [f"a==1.2.3 ; {MARKER_PY27.union(MARKER_PY36_38)}"], ), ( True, [ f"a==1.2.3 ; {MARKER_PY27.union(MARKER_PY36_38).union(MARKER_PY36)}", f"b==4.5.6 ; {MARKER_PY}", ], ), ], ) @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_nested_packages_and_markers_any( tmp_path: Path, poetry: Poetry, dev: bool, lines: list[str], lock_version: str ) -> None: lock_data: dict[str, Any] = { "package": [ { "name": "a", "version": "1.2.3", "optional": False, "python-versions": "*", }, { "name": "b", "version": "4.5.6", "optional": False, "python-versions": "*", "dependencies": {"a": ">=1.2.3"}, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"a": [], "b": []}, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][0]["groups"] = ["main", "dev"] lock_data["package"][0]["markers"] = {"main": "python_version < '3.8'"} lock_data["package"][1]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] root = poetry.package.with_dependency_groups([], only=True) root.add_dependency( Factory.create_dependency( name="a", constraint={"version": "^1.2.3", "python": "<3.8"} ) ) root.add_dependency( Factory.create_dependency( name="b", constraint={"version": "^4.5.6"}, groups=["dev"] ) ) poetry._package = root exporter = Exporter(poetry, NullIO()) if dev: exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() > assert content.strip() == "\n".join(lines) E assert 'a==1.2.3 ; p...rsion < "4.0"' == 'a==1.2.3 ; p...sion == "2.7"' E E - a==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + a==1.2.3 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - b==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^... E E ...Full output truncated (2 lines hidden), use '-vv' to show tests/test_exporter.py:592: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_can_export_requirements_txt_with_nested_packages_and_markers_any[2.1-False-lines0] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi12') poetry = , dev = False lines = ['a==1.2.3 ; python_version >= "3.6" and python_version < "3.8" or python_version == "2.7"'] lock_version = '2.1' @pytest.mark.parametrize( ["dev", "lines"], [ ( False, [f"a==1.2.3 ; {MARKER_PY27.union(MARKER_PY36_38)}"], ), ( True, [ f"a==1.2.3 ; {MARKER_PY27.union(MARKER_PY36_38).union(MARKER_PY36)}", f"b==4.5.6 ; {MARKER_PY}", ], ), ], ) @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_nested_packages_and_markers_any( tmp_path: Path, poetry: Poetry, dev: bool, lines: list[str], lock_version: str ) -> None: lock_data: dict[str, Any] = { "package": [ { "name": "a", "version": "1.2.3", "optional": False, "python-versions": "*", }, { "name": "b", "version": "4.5.6", "optional": False, "python-versions": "*", "dependencies": {"a": ">=1.2.3"}, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"a": [], "b": []}, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][0]["groups"] = ["main", "dev"] lock_data["package"][0]["markers"] = {"main": "python_version < '3.8'"} lock_data["package"][1]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] root = poetry.package.with_dependency_groups([], only=True) root.add_dependency( Factory.create_dependency( name="a", constraint={"version": "^1.2.3", "python": "<3.8"} ) ) root.add_dependency( Factory.create_dependency( name="b", constraint={"version": "^4.5.6"}, groups=["dev"] ) ) poetry._package = root exporter = Exporter(poetry, NullIO()) if dev: exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() > assert content.strip() == "\n".join(lines) E assert 'a==1.2.3 ; p...rsion < "3.8"' == 'a==1.2.3 ; p...sion == "2.7"' E E - a==1.2.3 ; python_version >= "3.6" and python_version < "3.8" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^^ ^^ ^ ^ E + a==1.2.3 ; python_version == "2.7" or python_version >= "3.6" and python_version < "3.8" E ? + ^ ^ ^^ ^^ ^ ^^^ ^ ^ ^ tests/test_exporter.py:592: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_can_export_requirements_txt_with_nested_packages_and_markers_any[2.1-True-lines1] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi13') poetry = , dev = True lines = ['a==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"', 'b==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"'] lock_version = '2.1' @pytest.mark.parametrize( ["dev", "lines"], [ ( False, [f"a==1.2.3 ; {MARKER_PY27.union(MARKER_PY36_38)}"], ), ( True, [ f"a==1.2.3 ; {MARKER_PY27.union(MARKER_PY36_38).union(MARKER_PY36)}", f"b==4.5.6 ; {MARKER_PY}", ], ), ], ) @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_nested_packages_and_markers_any( tmp_path: Path, poetry: Poetry, dev: bool, lines: list[str], lock_version: str ) -> None: lock_data: dict[str, Any] = { "package": [ { "name": "a", "version": "1.2.3", "optional": False, "python-versions": "*", }, { "name": "b", "version": "4.5.6", "optional": False, "python-versions": "*", "dependencies": {"a": ">=1.2.3"}, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"a": [], "b": []}, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][0]["groups"] = ["main", "dev"] lock_data["package"][0]["markers"] = {"main": "python_version < '3.8'"} lock_data["package"][1]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] root = poetry.package.with_dependency_groups([], only=True) root.add_dependency( Factory.create_dependency( name="a", constraint={"version": "^1.2.3", "python": "<3.8"} ) ) root.add_dependency( Factory.create_dependency( name="b", constraint={"version": "^4.5.6"}, groups=["dev"] ) ) poetry._package = root exporter = Exporter(poetry, NullIO()) if dev: exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() > assert content.strip() == "\n".join(lines) E assert 'a==1.2.3 ; p...rsion < "4.0"' == 'a==1.2.3 ; p...sion == "2.7"' E E - a==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + a==1.2.3 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - b==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^... E E ...Full output truncated (2 lines hidden), use '-vv' to show tests/test_exporter.py:592: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_can_export_requirements_txt_with_standard_packages_and_hashes[1.1] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi14') poetry = , lock_version = '1.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_standard_packages_and_hashes( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:67890 foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected E assert 'bar==4.5.6 ;...ha256:12345\n' == 'bar==4.5.6 ;...ha256:12345\n' E E - bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==4.5.6 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:67890 E - foo==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \... E E ...Full output truncated (4 lines hidden), use '-vv' to show tests/test_exporter.py:641: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_can_export_requirements_txt_with_standard_packages_and_hashes[2.1] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi15') poetry = , lock_version = '2.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_standard_packages_and_hashes( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:67890 foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected E assert 'bar==4.5.6 ;...ha256:12345\n' == 'bar==4.5.6 ;...ha256:12345\n' E E - bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==4.5.6 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:67890 E - foo==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \... E E ...Full output truncated (4 lines hidden), use '-vv' to show tests/test_exporter.py:641: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_can_export_requirements_txt_with_standard_packages_and_sorted_hashes[1.1] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi16') poetry = , lock_version = '1.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_standard_packages_and_sorted_hashes( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [ {"name": "foo1.whl", "hash": "67890"}, {"name": "foo2.whl", "hash": "12345"}, ], "bar": [ {"name": "bar1.whl", "hash": "67890"}, {"name": "bar2.whl", "hash": "12345"}, ], }, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:12345 \\ --hash=sha256:67890 foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 \\ --hash=sha256:67890 """ > assert content == expected E assert 'bar==4.5.6 ;...ha256:67890\n' == 'bar==4.5.6 ;...ha256:67890\n' E E Skipping 45 identical trailing characters in diff, use -v to show E - bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==4.5.6 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:12345 \... E E ...Full output truncated (6 lines hidden), use '-vv' to show tests/test_exporter.py:698: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_can_export_requirements_txt_with_standard_packages_and_sorted_hashes[2.1] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi17') poetry = , lock_version = '2.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_standard_packages_and_sorted_hashes( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [ {"name": "foo1.whl", "hash": "67890"}, {"name": "foo2.whl", "hash": "12345"}, ], "bar": [ {"name": "bar1.whl", "hash": "67890"}, {"name": "bar2.whl", "hash": "12345"}, ], }, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:12345 \\ --hash=sha256:67890 foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 \\ --hash=sha256:67890 """ > assert content == expected E assert 'bar==4.5.6 ;...ha256:67890\n' == 'bar==4.5.6 ;...ha256:67890\n' E E Skipping 45 identical trailing characters in diff, use -v to show E - bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==4.5.6 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:12345 \... E E ...Full output truncated (6 lines hidden), use '-vv' to show tests/test_exporter.py:698: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_can_export_requirements_txt_with_standard_packages_and_hashes_disabled[1.1] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi18') poetry = , lock_version = '1.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_standard_packages_and_hashes_disabled( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) exporter.with_hashes(False) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ bar==4.5.6 ; {MARKER_PY} foo==1.2.3 ; {MARKER_PY} """ > assert content == expected E assert 'bar==4.5.6 ;...ion < "4.0"\n' == 'bar==4.5.6 ;...on == "2.7"\n' E E - bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==4.5.6 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - foo==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^... E E ...Full output truncated (2 lines hidden), use '-vv' to show tests/test_exporter.py:746: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_can_export_requirements_txt_with_standard_packages_and_hashes_disabled[2.1] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi19') poetry = , lock_version = '2.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_standard_packages_and_hashes_disabled( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) exporter.with_hashes(False) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ bar==4.5.6 ; {MARKER_PY} foo==1.2.3 ; {MARKER_PY} """ > assert content == expected E assert 'bar==4.5.6 ;...ion < "4.0"\n' == 'bar==4.5.6 ;...on == "2.7"\n' E E - bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==4.5.6 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - foo==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^... E E ...Full output truncated (2 lines hidden), use '-vv' to show tests/test_exporter.py:746: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_exports_requirements_txt_without_dev_packages_by_default[1.1] __ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_exports_requirem0') poetry = , lock_version = '1.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_exports_requirements_txt_without_dev_packages_by_default( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][1]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar"}) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected E assert 'foo==1.2.3 ;...ha256:12345\n' == 'foo==1.2.3 ;...ha256:12345\n' E E - foo==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + foo==1.2.3 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:12345 tests/test_exporter.py:795: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_exports_requirements_txt_without_dev_packages_by_default[2.1] __ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_exports_requirem1') poetry = , lock_version = '2.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_exports_requirements_txt_without_dev_packages_by_default( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][1]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar"}) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected E assert 'foo==1.2.3 ;...ha256:12345\n' == 'foo==1.2.3 ;...ha256:12345\n' E E - foo==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + foo==1.2.3 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:12345 tests/test_exporter.py:795: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. __ test_exporter_exports_requirements_txt_with_dev_packages_if_opted_in[1.1] ___ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_exports_requirem2') poetry = , lock_version = '1.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_exports_requirements_txt_with_dev_packages_if_opted_in( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][1]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar"}) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:67890 foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected E assert 'bar==4.5.6 ;...ha256:12345\n' == 'bar==4.5.6 ;...ha256:12345\n' E E - bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==4.5.6 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:67890 E - foo==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \... E E ...Full output truncated (4 lines hidden), use '-vv' to show tests/test_exporter.py:847: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. __ test_exporter_exports_requirements_txt_with_dev_packages_if_opted_in[2.1] ___ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_exports_requirem3') poetry = , lock_version = '2.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_exports_requirements_txt_with_dev_packages_if_opted_in( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][1]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar"}) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:67890 foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected E assert 'bar==4.5.6 ;...ha256:12345\n' == 'bar==4.5.6 ;...ha256:12345\n' E E - bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==4.5.6 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:67890 E - foo==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \... E E ...Full output truncated (4 lines hidden), use '-vv' to show tests/test_exporter.py:847: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. ____ test_exporter_exports_requirements_txt_without_optional_packages[1.1] _____ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_exports_requirem6') poetry = , lock_version = '1.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_exports_requirements_txt_without_optional_packages( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", }, { "name": "bar", "version": "4.5.6", "optional": True, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][1]["groups"] = ["dev"] lock_data["package"][1]["markers"] = 'extra == "feature-bar"' poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar"}) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected E assert 'foo==1.2.3 ;...ha256:12345\n' == 'foo==1.2.3 ;...ha256:12345\n' E E - foo==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + foo==1.2.3 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:12345 tests/test_exporter.py:943: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. ____ test_exporter_exports_requirements_txt_without_optional_packages[2.1] _____ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_exports_requirem7') poetry = , lock_version = '2.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_exports_requirements_txt_without_optional_packages( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", }, { "name": "bar", "version": "4.5.6", "optional": True, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][1]["groups"] = ["dev"] lock_data["package"][1]["markers"] = 'extra == "feature-bar"' poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar"}) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected E assert 'foo==1.2.3 ;...ha256:12345\n' == 'foo==1.2.3 ;...ha256:12345\n' E E - foo==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + foo==1.2.3 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:12345 tests/test_exporter.py:943: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_exports_requirements_txt_with_optional_packages[1.1-extras0-lines0] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_exports_requirem8') poetry = , extras = ['feature-bar'] lines = ['bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"', 'foo==1.2.3 ; python_ve...ython_version == "2.7"', 'spam==0.1.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"'] lock_version = '1.1' @pytest.mark.parametrize( ["extras", "lines"], [ ( ["feature-bar"], [ f"bar==4.5.6 ; {MARKER_PY}", f"foo==1.2.3 ; {MARKER_PY}", f"spam==0.1.0 ; {MARKER_PY}", ], ), ], ) @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_exports_requirements_txt_with_optional_packages( tmp_path: Path, poetry: Poetry, extras: Collection[NormalizedName], lines: list[str], lock_version: str, ) -> None: lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", }, { "name": "bar", "version": "4.5.6", "optional": True, "python-versions": "*", "dependencies": {"spam": ">=0.1"}, }, { "name": "spam", "version": "0.1.0", "optional": True, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], "spam": [{"name": "spam.whl", "hash": "abcde"}], }, }, "extras": {"feature_bar": ["bar"]}, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][1]["markers"] = 'extra == "feature-bar"' lock_data["package"][2]["markers"] = 'extra == "feature-bar"' poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.with_hashes(False) exporter.with_extras(extras) exporter.export( "requirements.txt", tmp_path, "requirements.txt", ) with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = "\n".join(lines) > assert content.strip() == expected E assert 'bar==4.5.6 ;...rsion < "4.0"' == 'bar==4.5.6 ;...sion == "2.7"' E E - bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==4.5.6 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - foo==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^... E E ...Full output truncated (6 lines hidden), use '-vv' to show tests/test_exporter.py:1023: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_exports_requirements_txt_with_optional_packages[2.1-extras0-lines0] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_exports_requirem9') poetry = , extras = ['feature-bar'] lines = ['bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"', 'foo==1.2.3 ; python_ve...ython_version == "2.7"', 'spam==0.1.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"'] lock_version = '2.1' @pytest.mark.parametrize( ["extras", "lines"], [ ( ["feature-bar"], [ f"bar==4.5.6 ; {MARKER_PY}", f"foo==1.2.3 ; {MARKER_PY}", f"spam==0.1.0 ; {MARKER_PY}", ], ), ], ) @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_exports_requirements_txt_with_optional_packages( tmp_path: Path, poetry: Poetry, extras: Collection[NormalizedName], lines: list[str], lock_version: str, ) -> None: lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", }, { "name": "bar", "version": "4.5.6", "optional": True, "python-versions": "*", "dependencies": {"spam": ">=0.1"}, }, { "name": "spam", "version": "0.1.0", "optional": True, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], "spam": [{"name": "spam.whl", "hash": "abcde"}], }, }, "extras": {"feature_bar": ["bar"]}, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][1]["markers"] = 'extra == "feature-bar"' lock_data["package"][2]["markers"] = 'extra == "feature-bar"' poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.with_hashes(False) exporter.with_extras(extras) exporter.export( "requirements.txt", tmp_path, "requirements.txt", ) with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = "\n".join(lines) > assert content.strip() == expected E assert 'bar==4.5.6 ;...rsion < "4.0"' == 'bar==4.5.6 ;...sion == "2.7"' E E - bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==4.5.6 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - foo==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^... E E ...Full output truncated (6 lines hidden), use '-vv' to show tests/test_exporter.py:1023: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _______ test_exporter_can_export_requirements_txt_with_git_packages[1.1] _______ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi20') poetry = , lock_version = '1.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_git_packages( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "source": { "type": "git", "url": "https://github.com/foo/foo.git", "reference": "123456", "resolved_reference": "abcdef", }, } ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": []}, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ foo @ git+https://github.com/foo/foo.git@abcdef ; {MARKER_PY} """ > assert content == expected E assert 'foo @ git+ht...ion < "4.0"\n' == 'foo @ git+ht...on == "2.7"\n' E E Skipping 55 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ tests/test_exporter.py:1066: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _______ test_exporter_can_export_requirements_txt_with_git_packages[2.1] _______ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi21') poetry = , lock_version = '2.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_git_packages( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "source": { "type": "git", "url": "https://github.com/foo/foo.git", "reference": "123456", "resolved_reference": "abcdef", }, } ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": []}, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ foo @ git+https://github.com/foo/foo.git@abcdef ; {MARKER_PY} """ > assert content == expected E assert 'foo @ git+ht...ion < "4.0"\n' == 'foo @ git+ht...on == "2.7"\n' E E Skipping 55 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ tests/test_exporter.py:1066: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _____ test_exporter_can_export_requirements_txt_with_nested_packages[1.1] ______ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi22') poetry = , lock_version = '1.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_nested_packages( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "source": { "type": "git", "url": "https://github.com/foo/foo.git", "reference": "123456", "resolved_reference": "abcdef", }, }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "dependencies": { "foo": { "git": "https://github.com/foo/foo.git", "rev": "123456", } }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": [], "bar": []}, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, skip={"foo"}) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ bar==4.5.6 ; {MARKER_PY} foo @ git+https://github.com/foo/foo.git@abcdef ; {MARKER_PY} """ > assert content == expected E assert 'bar==4.5.6 ;...ion < "4.0"\n' == 'bar==4.5.6 ;...on == "2.7"\n' E E - bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==4.5.6 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - foo @ git+https://github.com/foo/foo.git@abcdef ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^... E E ...Full output truncated (2 lines hidden), use '-vv' to show tests/test_exporter.py:1122: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _____ test_exporter_can_export_requirements_txt_with_nested_packages[2.1] ______ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi23') poetry = , lock_version = '2.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_nested_packages( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "source": { "type": "git", "url": "https://github.com/foo/foo.git", "reference": "123456", "resolved_reference": "abcdef", }, }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "dependencies": { "foo": { "git": "https://github.com/foo/foo.git", "rev": "123456", } }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": [], "bar": []}, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, skip={"foo"}) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ bar==4.5.6 ; {MARKER_PY} foo @ git+https://github.com/foo/foo.git@abcdef ; {MARKER_PY} """ > assert content == expected E assert 'bar==4.5.6 ;...ion < "4.0"\n' == 'bar==4.5.6 ;...on == "2.7"\n' E E - bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==4.5.6 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - foo @ git+https://github.com/foo/foo.git@abcdef ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^... E E ...Full output truncated (2 lines hidden), use '-vv' to show tests/test_exporter.py:1122: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. __ test_exporter_can_export_requirements_txt_with_nested_packages_cyclic[1.1] __ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi24') poetry = , lock_version = '1.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_nested_packages_cyclic( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "dependencies": {"bar": {"version": "4.5.6"}}, }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "dependencies": {"baz": {"version": "7.8.9"}}, }, { "name": "baz", "version": "7.8.9", "optional": False, "python-versions": "*", "dependencies": {"foo": {"version": "1.2.3"}}, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": [], "bar": [], "baz": []}, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, skip={"bar", "baz"}) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ bar==4.5.6 ; {MARKER_PY} baz==7.8.9 ; {MARKER_PY} foo==1.2.3 ; {MARKER_PY} """ > assert content == expected E assert 'bar==4.5.6 ;...ion < "4.0"\n' == 'bar==4.5.6 ;...on == "2.7"\n' E E - bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==4.5.6 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - baz==7.8.9 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^... E E ...Full output truncated (6 lines hidden), use '-vv' to show tests/test_exporter.py:1176: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. __ test_exporter_can_export_requirements_txt_with_nested_packages_cyclic[2.1] __ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi25') poetry = , lock_version = '2.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_nested_packages_cyclic( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "dependencies": {"bar": {"version": "4.5.6"}}, }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "dependencies": {"baz": {"version": "7.8.9"}}, }, { "name": "baz", "version": "7.8.9", "optional": False, "python-versions": "*", "dependencies": {"foo": {"version": "1.2.3"}}, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": [], "bar": [], "baz": []}, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, skip={"bar", "baz"}) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ bar==4.5.6 ; {MARKER_PY} baz==7.8.9 ; {MARKER_PY} foo==1.2.3 ; {MARKER_PY} """ > assert content == expected E assert 'bar==4.5.6 ;...ion < "4.0"\n' == 'bar==4.5.6 ;...on == "2.7"\n' E E - bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==4.5.6 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - baz==7.8.9 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^... E E ...Full output truncated (6 lines hidden), use '-vv' to show tests/test_exporter.py:1176: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_can_export_requirements_txt_with_circular_root_dependency[1.1] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi26') poetry = , lock_version = '1.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_circular_root_dependency( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "dependencies": {poetry.package.pretty_name: {"version": "1.2.3"}}, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": []}, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ foo==1.2.3 ; {MARKER_PY} """ > assert content == expected E assert 'foo==1.2.3 ;...ion < "4.0"\n' == 'foo==1.2.3 ;...on == "2.7"\n' E E - foo==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + foo==1.2.3 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ tests/test_exporter.py:1214: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_can_export_requirements_txt_with_circular_root_dependency[2.1] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi27') poetry = , lock_version = '2.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_circular_root_dependency( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "dependencies": {poetry.package.pretty_name: {"version": "1.2.3"}}, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": []}, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ foo==1.2.3 ; {MARKER_PY} """ > assert content == expected E assert 'foo==1.2.3 ;...ion < "4.0"\n' == 'foo==1.2.3 ;...on == "2.7"\n' E E - foo==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + foo==1.2.3 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ tests/test_exporter.py:1214: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_can_export_requirements_txt_with_nested_packages_and_multiple_markers[1.1] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi28') poetry = , lock_version = '1.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_nested_packages_and_multiple_markers( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "dependencies": { "bar": [ { "version": ">=1.2.3,<7.8.10", "markers": 'platform_system != "Windows"', }, { "version": ">=4.5.6,<7.8.10", "markers": 'platform_system == "Windows"', }, ] }, }, { "name": "bar", "version": "7.8.9", "optional": True, "python-versions": "*", "dependencies": { "baz": { "version": "!=10.11.12", "markers": 'platform_system == "Windows"', } }, }, { "name": "baz", "version": "10.11.13", "optional": True, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": [], "bar": [], "baz": []}, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][2]["markers"] = 'platform_system == "Windows"' poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) exporter.with_hashes(False) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() marker_py_not_windows = MARKER_PY.intersect( parse_marker('platform_system != "Windows"') ) expected = f"""\ bar==7.8.9 ; {marker_py_not_windows.union(MARKER_PY_WINDOWS)} baz==10.11.13 ; {MARKER_PY_WINDOWS} foo==1.2.3 ; {MARKER_PY} """ > assert content == expected E assert 'bar==7.8.9 ;...ion < "4.0"\n' == 'bar==7.8.9 ;...on == "2.7"\n' E E - bar==7.8.9 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==7.8.9 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - baz==10.11.13 ; (python_version >= "3.6" or python_version == "2.7") and platform_system == "Windows" and python_version < "4.0" E + baz==10.11.13 ; (python_version == "2.7" or python_version >= "3.6") and python_version < "4.0" and platform_system == "Windows"... E E ...Full output truncated (4 lines hidden), use '-vv' to show tests/test_exporter.py:1289: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_can_export_requirements_txt_with_nested_packages_and_multiple_markers[2.1] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi29') poetry = , lock_version = '2.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_nested_packages_and_multiple_markers( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "dependencies": { "bar": [ { "version": ">=1.2.3,<7.8.10", "markers": 'platform_system != "Windows"', }, { "version": ">=4.5.6,<7.8.10", "markers": 'platform_system == "Windows"', }, ] }, }, { "name": "bar", "version": "7.8.9", "optional": True, "python-versions": "*", "dependencies": { "baz": { "version": "!=10.11.12", "markers": 'platform_system == "Windows"', } }, }, { "name": "baz", "version": "10.11.13", "optional": True, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": [], "bar": [], "baz": []}, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][2]["markers"] = 'platform_system == "Windows"' poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) exporter.with_hashes(False) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() marker_py_not_windows = MARKER_PY.intersect( parse_marker('platform_system != "Windows"') ) expected = f"""\ bar==7.8.9 ; {marker_py_not_windows.union(MARKER_PY_WINDOWS)} baz==10.11.13 ; {MARKER_PY_WINDOWS} foo==1.2.3 ; {MARKER_PY} """ > assert content == expected E assert 'bar==7.8.9 ;...ion < "4.0"\n' == 'bar==7.8.9 ;...on == "2.7"\n' E E - bar==7.8.9 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==7.8.9 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - baz==10.11.13 ; (python_version >= "3.6" or python_version == "2.7") and platform_system == "Windows" and python_version < "4.0" E + baz==10.11.13 ; (python_version == "2.7" or python_version >= "3.6") and python_version < "4.0" and platform_system == "Windows"... E E ...Full output truncated (4 lines hidden), use '-vv' to show tests/test_exporter.py:1289: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. ____ test_exporter_can_export_requirements_txt_with_directory_packages[1.1] ____ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi32') poetry = fixture_root_uri = 'file:///home/buildozer/aports/community/py3-poetry-plugin-export/src/poetry-plugin-export-1.9.0/tests/fixtures' lock_version = '1.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_directory_packages( tmp_path: Path, poetry: Poetry, fixture_root_uri: str, lock_version: str ) -> None: lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "source": { "type": "directory", "url": "sample_project", "reference": "", }, } ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": []}, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ foo @ {fixture_root_uri}/sample_project ; {MARKER_PY} """ > assert content == expected E assert 'foo @ file:/...ion < "4.0"\n' == 'foo @ file:/...on == "2.7"\n' E E Skipping 139 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ tests/test_exporter.py:1376: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. ____ test_exporter_can_export_requirements_txt_with_directory_packages[2.1] ____ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi33') poetry = fixture_root_uri = 'file:///home/buildozer/aports/community/py3-poetry-plugin-export/src/poetry-plugin-export-1.9.0/tests/fixtures' lock_version = '2.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_directory_packages( tmp_path: Path, poetry: Poetry, fixture_root_uri: str, lock_version: str ) -> None: lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "source": { "type": "directory", "url": "sample_project", "reference": "", }, } ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": []}, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ foo @ {fixture_root_uri}/sample_project ; {MARKER_PY} """ > assert content == expected E assert 'foo @ file:/...ion < "4.0"\n' == 'foo @ file:/...on == "2.7"\n' E E Skipping 139 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ tests/test_exporter.py:1376: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_can_export_requirements_txt_with_directory_packages_editable[1.1] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi34') poetry = fixture_root_uri = 'file:///home/buildozer/aports/community/py3-poetry-plugin-export/src/poetry-plugin-export-1.9.0/tests/fixtures' lock_version = '1.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_directory_packages_editable( tmp_path: Path, poetry: Poetry, fixture_root_uri: str, lock_version: str ) -> None: lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "develop": True, "source": { "type": "directory", "url": "sample_project", "reference": "", }, } ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": []}, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ -e {fixture_root_uri}/sample_project ; {MARKER_PY} """ > assert content == expected E assert '-e file:///h...ion < "4.0"\n' == '-e file:///h...on == "2.7"\n' E E Skipping 136 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ tests/test_exporter.py:1419: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_can_export_requirements_txt_with_directory_packages_editable[2.1] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi35') poetry = fixture_root_uri = 'file:///home/buildozer/aports/community/py3-poetry-plugin-export/src/poetry-plugin-export-1.9.0/tests/fixtures' lock_version = '2.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_directory_packages_editable( tmp_path: Path, poetry: Poetry, fixture_root_uri: str, lock_version: str ) -> None: lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "develop": True, "source": { "type": "directory", "url": "sample_project", "reference": "", }, } ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": []}, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ -e {fixture_root_uri}/sample_project ; {MARKER_PY} """ > assert content == expected E assert '-e file:///h...ion < "4.0"\n' == '-e file:///h...on == "2.7"\n' E E Skipping 136 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ tests/test_exporter.py:1419: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_can_export_requirements_txt_with_nested_directory_packages[1.1] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi36') poetry = fixture_root_uri = 'file:///home/buildozer/aports/community/py3-poetry-plugin-export/src/poetry-plugin-export-1.9.0/tests/fixtures' lock_version = '1.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_nested_directory_packages( tmp_path: Path, poetry: Poetry, fixture_root_uri: str, lock_version: str ) -> None: lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "source": { "type": "directory", "url": "sample_project", "reference": "", }, }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "directory", "url": "sample_project/../project_with_nested_local/bar", "reference": "", }, }, { "name": "baz", "version": "7.8.9", "optional": False, "python-versions": "*", "source": { "type": "directory", "url": "sample_project/../project_with_nested_local/bar/..", "reference": "", }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": [], "bar": [], "baz": []}, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ bar @ {fixture_root_uri}/project_with_nested_local/bar ; {MARKER_PY} baz @ {fixture_root_uri}/project_with_nested_local ; {MARKER_PY} foo @ {fixture_root_uri}/sample_project ; {MARKER_PY} """ > assert content == expected E assert 'bar @ file:/...ion < "4.0"\n' == 'bar @ file:/...on == "2.7"\n' E E Skipping 154 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - baz @ file:///home/buildozer/aports/community/py3-poetry-plugin-export/src/poetry-plugin-export-1.9.0/tests/fixtures/project_with_nested_local ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"... E E ...Full output truncated (7 lines hidden), use '-vv' to show tests/test_exporter.py:1485: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_can_export_requirements_txt_with_nested_directory_packages[2.1] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi37') poetry = fixture_root_uri = 'file:///home/buildozer/aports/community/py3-poetry-plugin-export/src/poetry-plugin-export-1.9.0/tests/fixtures' lock_version = '2.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_nested_directory_packages( tmp_path: Path, poetry: Poetry, fixture_root_uri: str, lock_version: str ) -> None: lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "source": { "type": "directory", "url": "sample_project", "reference": "", }, }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "directory", "url": "sample_project/../project_with_nested_local/bar", "reference": "", }, }, { "name": "baz", "version": "7.8.9", "optional": False, "python-versions": "*", "source": { "type": "directory", "url": "sample_project/../project_with_nested_local/bar/..", "reference": "", }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": [], "bar": [], "baz": []}, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ bar @ {fixture_root_uri}/project_with_nested_local/bar ; {MARKER_PY} baz @ {fixture_root_uri}/project_with_nested_local ; {MARKER_PY} foo @ {fixture_root_uri}/sample_project ; {MARKER_PY} """ > assert content == expected E assert 'bar @ file:/...ion < "4.0"\n' == 'bar @ file:/...on == "2.7"\n' E E Skipping 154 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - baz @ file:///home/buildozer/aports/community/py3-poetry-plugin-export/src/poetry-plugin-export-1.9.0/tests/fixtures/project_with_nested_local ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"... E E ...Full output truncated (7 lines hidden), use '-vv' to show tests/test_exporter.py:1485: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. ______ test_exporter_can_export_requirements_txt_with_file_packages[1.1] _______ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi40') poetry = fixture_root_uri = 'file:///home/buildozer/aports/community/py3-poetry-plugin-export/src/poetry-plugin-export-1.9.0/tests/fixtures' lock_version = '1.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_file_packages( tmp_path: Path, poetry: Poetry, fixture_root_uri: str, lock_version: str ) -> None: lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "source": { "type": "file", "url": "distributions/demo-0.1.0.tar.gz", "reference": "", }, } ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": []}, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ foo @ {fixture_root_uri}/distributions/demo-0.1.0.tar.gz ;\ {MARKER_PY} """ > assert content == expected E assert 'foo @ file:/...ion < "4.0"\n' == 'foo @ file:/...on == "2.7"\n' E E Skipping 156 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ tests/test_exporter.py:1573: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. ______ test_exporter_can_export_requirements_txt_with_file_packages[2.1] _______ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_can_export_requi41') poetry = fixture_root_uri = 'file:///home/buildozer/aports/community/py3-poetry-plugin-export/src/poetry-plugin-export-1.9.0/tests/fixtures' lock_version = '2.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_can_export_requirements_txt_with_file_packages( tmp_path: Path, poetry: Poetry, fixture_root_uri: str, lock_version: str ) -> None: lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "source": { "type": "file", "url": "distributions/demo-0.1.0.tar.gz", "reference": "", }, } ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": []}, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ foo @ {fixture_root_uri}/distributions/demo-0.1.0.tar.gz ;\ {MARKER_PY} """ > assert content == expected E assert 'foo @ file:/...ion < "4.0"\n' == 'foo @ file:/...on == "2.7"\n' E E Skipping 156 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ tests/test_exporter.py:1573: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _______ test_exporter_exports_requirements_txt_with_legacy_packages[1.1] _______ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_exports_requirem10') poetry = , lock_version = '1.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_exports_requirements_txt_with_legacy_packages( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: poetry.pool.add_repository( LegacyRepository( "custom", "https://example.com/simple", ) ) lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://example.com/simple", "reference": "", }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][1]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar"}) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ --extra-index-url https://example.com/simple bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:67890 foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected E assert '--extra-inde...ha256:12345\n' == '--extra-inde...ha256:12345\n' E E Skipping 64 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:67890... E E ...Full output truncated (5 lines hidden), use '-vv' to show tests/test_exporter.py:1683: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _______ test_exporter_exports_requirements_txt_with_legacy_packages[2.1] _______ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_exports_requirem11') poetry = , lock_version = '2.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_exports_requirements_txt_with_legacy_packages( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: poetry.pool.add_repository( LegacyRepository( "custom", "https://example.com/simple", ) ) lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://example.com/simple", "reference": "", }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][1]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar"}) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ --extra-index-url https://example.com/simple bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:67890 foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected E assert '--extra-inde...ha256:12345\n' == '--extra-inde...ha256:12345\n' E E Skipping 64 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:67890... E E ...Full output truncated (5 lines hidden), use '-vv' to show tests/test_exporter.py:1683: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. __________ test_exporter_exports_requirements_txt_with_url_false[1.1] __________ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_exports_requirem12') poetry = , lock_version = '1.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_exports_requirements_txt_with_url_false( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: poetry.pool.add_repository( LegacyRepository( "custom", "https://example.com/simple", ) ) lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://example.com/simple", "reference": "", }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][1]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar"}) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.with_urls(False) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:67890 foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected E assert 'bar==4.5.6 ;...ha256:12345\n' == 'bar==4.5.6 ;...ha256:12345\n' E E - bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==4.5.6 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:67890 E - foo==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \... E E ...Full output truncated (4 lines hidden), use '-vv' to show tests/test_exporter.py:1747: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. __________ test_exporter_exports_requirements_txt_with_url_false[2.1] __________ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_exports_requirem13') poetry = , lock_version = '2.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_exports_requirements_txt_with_url_false( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: poetry.pool.add_repository( LegacyRepository( "custom", "https://example.com/simple", ) ) lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://example.com/simple", "reference": "", }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][1]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar"}) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.with_urls(False) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:67890 foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected E assert 'bar==4.5.6 ;...ha256:12345\n' == 'bar==4.5.6 ;...ha256:12345\n' E E - bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==4.5.6 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:67890 E - foo==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \... E E ...Full output truncated (4 lines hidden), use '-vv' to show tests/test_exporter.py:1747: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_exports_requirements_txt_with_legacy_packages_trusted_host[1.1] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_exports_requirem14') poetry = , lock_version = '1.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_exports_requirements_txt_with_legacy_packages_trusted_host( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: poetry.pool.add_repository( LegacyRepository( "custom", "http://example.com/simple", ) ) lock_data: dict[str, Any] = { "package": [ { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "http://example.com/simple", "reference": "", }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][0]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar"}) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ --trusted-host example.com --extra-index-url http://example.com/simple bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:67890 """ > assert content == expected E assert '--trusted-ho...ha256:67890\n' == '--trusted-ho...ha256:67890\n' E E Skipping 90 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:67890 tests/test_exporter.py:1803: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_exports_requirements_txt_with_legacy_packages_trusted_host[2.1] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_exports_requirem15') poetry = , lock_version = '2.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_exports_requirements_txt_with_legacy_packages_trusted_host( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: poetry.pool.add_repository( LegacyRepository( "custom", "http://example.com/simple", ) ) lock_data: dict[str, Any] = { "package": [ { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "http://example.com/simple", "reference": "", }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][0]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar"}) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ --trusted-host example.com --extra-index-url http://example.com/simple bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:67890 """ > assert content == expected E assert '--trusted-ho...ha256:67890\n' == '--trusted-ho...ha256:67890\n' E E Skipping 90 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:67890 tests/test_exporter.py:1803: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. __ test_exporter_exports_requirements_txt_with_dev_extras[1.1-True-expected0] __ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_exports_requirem16') poetry = , dev = True expected = ['bar==1.2.2 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"', 'baz==1.2.3 ; python_ve...python_version == "2.7"', 'foo==1.2.1 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"'] lock_version = '1.1' @pytest.mark.parametrize( ["dev", "expected"], [ ( True, [ f"bar==1.2.2 ; {MARKER_PY}", f"baz==1.2.3 ; {MARKER_PY}", f"foo==1.2.1 ; {MARKER_PY}", ], ), ( False, [ f"bar==1.2.2 ; {MARKER_PY}", f"foo==1.2.1 ; {MARKER_PY}", ], ), ], ) @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_exports_requirements_txt_with_dev_extras( tmp_path: Path, poetry: Poetry, dev: bool, expected: list[str], lock_version: str ) -> None: lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.1", "optional": False, "python-versions": "*", }, { "name": "bar", "version": "1.2.2", "optional": False, "python-versions": "*", "dependencies": { "baz": { "version": ">=0.1.0", "optional": True, "markers": "extra == 'baz'", } }, "extras": {"baz": ["baz (>=0.1.0)"]}, }, { "name": "baz", "version": "1.2.3", "optional": False, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": [], "bar": [], "baz": []}, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][2]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"baz"}) exporter = Exporter(poetry, NullIO()) if dev: exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() > assert content == "\n".join(expected) + "\n" E assert 'bar==1.2.2 ;...ion < "4.0"\n' == 'bar==1.2.2 ;...on == "2.7"\n' E E - bar==1.2.2 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==1.2.2 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - baz==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^... E E ...Full output truncated (6 lines hidden), use '-vv' to show tests/test_exporter.py:1880: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_exports_requirements_txt_with_dev_extras[1.1-False-expected1] __ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_exports_requirem17') poetry = , dev = False expected = ['bar==1.2.2 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"', 'foo==1.2.1 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"'] lock_version = '1.1' @pytest.mark.parametrize( ["dev", "expected"], [ ( True, [ f"bar==1.2.2 ; {MARKER_PY}", f"baz==1.2.3 ; {MARKER_PY}", f"foo==1.2.1 ; {MARKER_PY}", ], ), ( False, [ f"bar==1.2.2 ; {MARKER_PY}", f"foo==1.2.1 ; {MARKER_PY}", ], ), ], ) @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_exports_requirements_txt_with_dev_extras( tmp_path: Path, poetry: Poetry, dev: bool, expected: list[str], lock_version: str ) -> None: lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.1", "optional": False, "python-versions": "*", }, { "name": "bar", "version": "1.2.2", "optional": False, "python-versions": "*", "dependencies": { "baz": { "version": ">=0.1.0", "optional": True, "markers": "extra == 'baz'", } }, "extras": {"baz": ["baz (>=0.1.0)"]}, }, { "name": "baz", "version": "1.2.3", "optional": False, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": [], "bar": [], "baz": []}, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][2]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"baz"}) exporter = Exporter(poetry, NullIO()) if dev: exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() > assert content == "\n".join(expected) + "\n" E assert 'bar==1.2.2 ;...ion < "4.0"\n' == 'bar==1.2.2 ;...on == "2.7"\n' E E - bar==1.2.2 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==1.2.2 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - foo==1.2.1 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^... E E ...Full output truncated (2 lines hidden), use '-vv' to show tests/test_exporter.py:1880: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. __ test_exporter_exports_requirements_txt_with_dev_extras[2.1-True-expected0] __ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_exports_requirem18') poetry = , dev = True expected = ['bar==1.2.2 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"', 'baz==1.2.3 ; python_ve...python_version == "2.7"', 'foo==1.2.1 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"'] lock_version = '2.1' @pytest.mark.parametrize( ["dev", "expected"], [ ( True, [ f"bar==1.2.2 ; {MARKER_PY}", f"baz==1.2.3 ; {MARKER_PY}", f"foo==1.2.1 ; {MARKER_PY}", ], ), ( False, [ f"bar==1.2.2 ; {MARKER_PY}", f"foo==1.2.1 ; {MARKER_PY}", ], ), ], ) @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_exports_requirements_txt_with_dev_extras( tmp_path: Path, poetry: Poetry, dev: bool, expected: list[str], lock_version: str ) -> None: lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.1", "optional": False, "python-versions": "*", }, { "name": "bar", "version": "1.2.2", "optional": False, "python-versions": "*", "dependencies": { "baz": { "version": ">=0.1.0", "optional": True, "markers": "extra == 'baz'", } }, "extras": {"baz": ["baz (>=0.1.0)"]}, }, { "name": "baz", "version": "1.2.3", "optional": False, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": [], "bar": [], "baz": []}, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][2]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"baz"}) exporter = Exporter(poetry, NullIO()) if dev: exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() > assert content == "\n".join(expected) + "\n" E assert 'bar==1.2.2 ;...ion < "4.0"\n' == 'bar==1.2.2 ;...on == "2.7"\n' E E - bar==1.2.2 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==1.2.2 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - baz==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^... E E ...Full output truncated (6 lines hidden), use '-vv' to show tests/test_exporter.py:1880: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_exports_requirements_txt_with_dev_extras[2.1-False-expected1] __ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_exports_requirem19') poetry = , dev = False expected = ['bar==1.2.2 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"', 'foo==1.2.1 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"'] lock_version = '2.1' @pytest.mark.parametrize( ["dev", "expected"], [ ( True, [ f"bar==1.2.2 ; {MARKER_PY}", f"baz==1.2.3 ; {MARKER_PY}", f"foo==1.2.1 ; {MARKER_PY}", ], ), ( False, [ f"bar==1.2.2 ; {MARKER_PY}", f"foo==1.2.1 ; {MARKER_PY}", ], ), ], ) @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_exports_requirements_txt_with_dev_extras( tmp_path: Path, poetry: Poetry, dev: bool, expected: list[str], lock_version: str ) -> None: lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.1", "optional": False, "python-versions": "*", }, { "name": "bar", "version": "1.2.2", "optional": False, "python-versions": "*", "dependencies": { "baz": { "version": ">=0.1.0", "optional": True, "markers": "extra == 'baz'", } }, "extras": {"baz": ["baz (>=0.1.0)"]}, }, { "name": "baz", "version": "1.2.3", "optional": False, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": [], "bar": [], "baz": []}, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][2]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"baz"}) exporter = Exporter(poetry, NullIO()) if dev: exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() > assert content == "\n".join(expected) + "\n" E assert 'bar==1.2.2 ;...ion < "4.0"\n' == 'bar==1.2.2 ;...on == "2.7"\n' E E - bar==1.2.2 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==1.2.2 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - foo==1.2.1 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^... E E ...Full output truncated (2 lines hidden), use '-vv' to show tests/test_exporter.py:1880: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_exports_requirements_txt_with_legacy_packages_and_duplicate_sources[1.1] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_exports_requirem20') poetry = , lock_version = '1.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_exports_requirements_txt_with_legacy_packages_and_duplicate_sources( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: poetry.pool.add_repository( LegacyRepository( "custom-example", "https://example.com/simple", ) ) poetry.pool.add_repository( LegacyRepository( "custom-foobaz", "https://foobaz.com/simple", ) ) lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://example.com/simple", "reference": "", }, }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://example.com/simple", "reference": "", }, }, { "name": "baz", "version": "7.8.9", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://foobaz.com/simple", "reference": "", }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], "baz": [{"name": "baz.whl", "hash": "24680"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][1]["groups"] = ["dev"] lock_data["package"][2]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar", "baz"}) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ --extra-index-url https://example.com/simple --extra-index-url https://foobaz.com/simple bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:67890 baz==7.8.9 ; {MARKER_PY} \\ --hash=sha256:24680 foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected E assert '--extra-inde...ha256:12345\n' == '--extra-inde...ha256:12345\n' E E Skipping 108 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:67890... E E ...Full output truncated (10 lines hidden), use '-vv' to show tests/test_exporter.py:1972: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_exports_requirements_txt_with_legacy_packages_and_duplicate_sources[2.1] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_exports_requirem21') poetry = , lock_version = '2.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_exports_requirements_txt_with_legacy_packages_and_duplicate_sources( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: poetry.pool.add_repository( LegacyRepository( "custom-example", "https://example.com/simple", ) ) poetry.pool.add_repository( LegacyRepository( "custom-foobaz", "https://foobaz.com/simple", ) ) lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://example.com/simple", "reference": "", }, }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://example.com/simple", "reference": "", }, }, { "name": "baz", "version": "7.8.9", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://foobaz.com/simple", "reference": "", }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], "baz": [{"name": "baz.whl", "hash": "24680"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][1]["groups"] = ["dev"] lock_data["package"][2]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar", "baz"}) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ --extra-index-url https://example.com/simple --extra-index-url https://foobaz.com/simple bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:67890 baz==7.8.9 ; {MARKER_PY} \\ --hash=sha256:24680 foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected E assert '--extra-inde...ha256:12345\n' == '--extra-inde...ha256:12345\n' E E Skipping 108 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:67890... E E ...Full output truncated (10 lines hidden), use '-vv' to show tests/test_exporter.py:1972: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _____ test_exporter_exports_requirements_txt_with_two_primary_sources[1.1] _____ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_exports_requirem22') poetry = , lock_version = '1.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_exports_requirements_txt_with_two_primary_sources( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: poetry.pool.remove_repository("PyPI") poetry.config.merge( { "repositories": { "custom-a": {"url": "https://a.example.com/simple"}, "custom-b": {"url": "https://b.example.com/simple"}, }, "http-basic": { "custom-a": {"username": "foo", "password": "bar"}, "custom-b": {"username": "baz", "password": "qux"}, }, } ) poetry.pool.add_repository( LegacyRepository( "custom-b", "https://b.example.com/simple", config=poetry.config, ), ) poetry.pool.add_repository( LegacyRepository( "custom-a", "https://a.example.com/simple", config=poetry.config, ), ) lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://a.example.com/simple", "reference": "", }, }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://b.example.com/simple", "reference": "", }, }, { "name": "baz", "version": "7.8.9", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://b.example.com/simple", "reference": "", }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], "baz": [{"name": "baz.whl", "hash": "24680"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][1]["groups"] = ["dev"] lock_data["package"][2]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar", "baz"}) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.with_credentials() exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ --index-url https://baz:qux@b.example.com/simple --extra-index-url https://foo:bar@a.example.com/simple bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:67890 baz==7.8.9 ; {MARKER_PY} \\ --hash=sha256:24680 foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected E assert '--index-url ...ha256:12345\n' == '--index-url ...ha256:12345\n' E E Skipping 123 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:67890... E E ...Full output truncated (10 lines hidden), use '-vv' to show tests/test_exporter.py:2080: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _____ test_exporter_exports_requirements_txt_with_two_primary_sources[2.1] _____ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_exports_requirem23') poetry = , lock_version = '2.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_exports_requirements_txt_with_two_primary_sources( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: poetry.pool.remove_repository("PyPI") poetry.config.merge( { "repositories": { "custom-a": {"url": "https://a.example.com/simple"}, "custom-b": {"url": "https://b.example.com/simple"}, }, "http-basic": { "custom-a": {"username": "foo", "password": "bar"}, "custom-b": {"username": "baz", "password": "qux"}, }, } ) poetry.pool.add_repository( LegacyRepository( "custom-b", "https://b.example.com/simple", config=poetry.config, ), ) poetry.pool.add_repository( LegacyRepository( "custom-a", "https://a.example.com/simple", config=poetry.config, ), ) lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://a.example.com/simple", "reference": "", }, }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://b.example.com/simple", "reference": "", }, }, { "name": "baz", "version": "7.8.9", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://b.example.com/simple", "reference": "", }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], "baz": [{"name": "baz.whl", "hash": "24680"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][1]["groups"] = ["dev"] lock_data["package"][2]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar", "baz"}) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.with_credentials() exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ --index-url https://baz:qux@b.example.com/simple --extra-index-url https://foo:bar@a.example.com/simple bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:67890 baz==7.8.9 ; {MARKER_PY} \\ --hash=sha256:24680 foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected E assert '--index-url ...ha256:12345\n' == '--index-url ...ha256:12345\n' E E Skipping 123 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:67890... E E ...Full output truncated (10 lines hidden), use '-vv' to show tests/test_exporter.py:2080: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_exports_requirements_txt_with_legacy_packages_and_credentials[1.1] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_exports_requirem24') poetry = config = , lock_version = '1.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_exports_requirements_txt_with_legacy_packages_and_credentials( tmp_path: Path, poetry: Poetry, config: Config, lock_version: str ) -> None: poetry.config.merge( { "repositories": {"custom": {"url": "https://example.com/simple"}}, "http-basic": {"custom": {"username": "foo", "password": "bar"}}, } ) poetry.pool.add_repository( LegacyRepository("custom", "https://example.com/simple", config=poetry.config) ) lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://example.com/simple", "reference": "", }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][1]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar"}) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.with_credentials() exporter.export( "requirements.txt", tmp_path, "requirements.txt", ) with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ --extra-index-url https://foo:bar@example.com/simple bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:67890 foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected E assert '--extra-inde...ha256:12345\n' == '--extra-inde...ha256:12345\n' E E Skipping 72 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:67890... E E ...Full output truncated (5 lines hidden), use '-vv' to show tests/test_exporter.py:2153: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_exports_requirements_txt_with_legacy_packages_and_credentials[2.1] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_exports_requirem25') poetry = config = , lock_version = '2.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_exports_requirements_txt_with_legacy_packages_and_credentials( tmp_path: Path, poetry: Poetry, config: Config, lock_version: str ) -> None: poetry.config.merge( { "repositories": {"custom": {"url": "https://example.com/simple"}}, "http-basic": {"custom": {"username": "foo", "password": "bar"}}, } ) poetry.pool.add_repository( LegacyRepository("custom", "https://example.com/simple", config=poetry.config) ) lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://example.com/simple", "reference": "", }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][1]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar"}) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.with_credentials() exporter.export( "requirements.txt", tmp_path, "requirements.txt", ) with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ --extra-index-url https://foo:bar@example.com/simple bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:67890 foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected E assert '--extra-inde...ha256:12345\n' == '--extra-inde...ha256:12345\n' E E Skipping 72 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:67890... E E ...Full output truncated (5 lines hidden), use '-vv' to show tests/test_exporter.py:2153: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. ________ test_exporter_exports_requirements_txt_to_standard_output[1.1] ________ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_exports_requirem26') poetry = , lock_version = '1.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_exports_requirements_txt_to_standard_output( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": [], "bar": []}, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) io = BufferedIO() exporter.export("requirements.txt", tmp_path, io) expected = f"""\ bar==4.5.6 ; {MARKER_PY} foo==1.2.3 ; {MARKER_PY} """ > assert io.fetch_output() == expected E assert 'bar==4.5.6 ;...ion < "4.0"\n' == 'bar==4.5.6 ;...on == "2.7"\n' E E - bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==4.5.6 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - foo==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^... E E ...Full output truncated (2 lines hidden), use '-vv' to show tests/test_exporter.py:2195: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. ________ test_exporter_exports_requirements_txt_to_standard_output[2.1] ________ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_exports_requirem27') poetry = , lock_version = '2.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_exports_requirements_txt_to_standard_output( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": [], "bar": []}, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) io = BufferedIO() exporter.export("requirements.txt", tmp_path, io) expected = f"""\ bar==4.5.6 ; {MARKER_PY} foo==1.2.3 ; {MARKER_PY} """ > assert io.fetch_output() == expected E assert 'bar==4.5.6 ;...ion < "4.0"\n' == 'bar==4.5.6 ;...on == "2.7"\n' E E - bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==4.5.6 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - foo==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^... E E ...Full output truncated (2 lines hidden), use '-vv' to show tests/test_exporter.py:2195: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _____________ test_exporter_doesnt_confuse_repeated_packages[1.1] ______________ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_doesnt_confuse_r0') poetry = , lock_version = '1.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_doesnt_confuse_repeated_packages( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: # Testcase derived from . lock_data: dict[str, Any] = { "package": [ { "name": "celery", "version": "5.1.2", "optional": False, "python-versions": "<3.7", "dependencies": { "click": ">=7.0,<8.0", "click-didyoumean": ">=0.0.3", "click-plugins": ">=1.1.1", }, }, { "name": "celery", "version": "5.2.3", "optional": False, "python-versions": ">=3.7", "dependencies": { "click": ">=8.0.3,<9.0", "click-didyoumean": ">=0.0.3", "click-plugins": ">=1.1.1", }, }, { "name": "click", "version": "7.1.2", "optional": False, "python-versions": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", }, { "name": "click", "version": "8.0.3", "optional": False, "python-versions": ">=3.6", "dependencies": {}, }, { "name": "click-didyoumean", "version": "0.0.3", "optional": False, "python-versions": "*", "dependencies": {"click": "*"}, }, { "name": "click-didyoumean", "version": "0.3.0", "optional": False, "python-versions": ">=3.6.2,<4.0.0", "dependencies": {"click": ">=7"}, }, { "name": "click-plugins", "version": "1.1.1", "optional": False, "python-versions": "*", "dependencies": {"click": ">=4.0"}, }, ], "metadata": { "lock-version": lock_version, "python-versions": "^3.6", "content-hash": ( "832b13a88e5020c27cbcd95faa577bf0dbf054a65c023b45dc9442b640d414e6" ), "files": { "celery": [], "click-didyoumean": [], "click-plugins": [], "click": [], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][0]["markers"] = "python_version < '3.7'" lock_data["package"][1]["markers"] = "python_version >= '3.7'" lock_data["package"][2]["markers"] = "python_version < '3.7'" lock_data["package"][3]["markers"] = "python_version >= '3.7'" lock_data["package"][4]["markers"] = "python_full_version < '3.6.2'" lock_data["package"][5]["markers"] = "python_full_version >= '3.6.2'" poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] root = poetry.package.with_dependency_groups([], only=True) root.python_versions = "^3.6" root.add_dependency( Factory.create_dependency( name="celery", constraint={"version": "5.1.2", "python": "<3.7"} ) ) root.add_dependency( Factory.create_dependency( name="celery", constraint={"version": "5.2.3", "python": ">=3.7"} ) ) poetry._package = root exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) io = BufferedIO() exporter.export("requirements.txt", tmp_path, io) expected = f"""\ celery==5.1.2 ; {MARKER_PY36_ONLY} celery==5.2.3 ; {MARKER_PY37} click-didyoumean==0.0.3 ; {MARKER_PY36_PY362} click-didyoumean==0.3.0 ; {MARKER_PY362_PY40} click-plugins==1.1.1 ; {MARKER_PY36} click==7.1.2 ; {MARKER_PY36_ONLY} click==8.0.3 ; {MARKER_PY37} """ > assert io.fetch_output() == expected E assert 'celery==5.1....ion < "4.0"\n' == 'celery==5.1....ion < "4.0"\n' E E Skipping 130 identical leading characters in diff, use -v to show E Skipping 256 identical trailing characters in diff, use -v to show E - ; python_version >= "3.6" and python_full_version < "3.6.2" E + ; python_full_version < "3.6.2" and python_version == "3.6" E click-d tests/test_exporter.py:2314: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_omits_and_includes_extras_for_txt_formats[1.1-constraints.txt-expected0] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_omits_and_includ0') poetry = , fmt = 'constraints.txt' expected = ['bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"', 'baz==7.8.9 ; python_ve...python_version == "2.7"', 'foo==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"'] lock_version = '1.1' @pytest.mark.parametrize( ["fmt", "expected"], [ ( "constraints.txt", [ f"bar==4.5.6 ; {MARKER_PY}", f"baz==7.8.9 ; {MARKER_PY}", f"foo==1.2.3 ; {MARKER_PY}", ], ), ( "requirements.txt", [ f"bar==4.5.6 ; {MARKER_PY}", f"bar[baz]==4.5.6 ; {MARKER_PY}", f"baz==7.8.9 ; {MARKER_PY}", f"foo==1.2.3 ; {MARKER_PY}", ], ), ], ) @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_omits_and_includes_extras_for_txt_formats( tmp_path: Path, poetry: Poetry, fmt: str, expected: list[str], lock_version: str ) -> None: lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "dependencies": { "bar": { "extras": ["baz"], "version": ">=0.1.0", } }, }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "dependencies": { "baz": { "version": ">=0.1.0", "optional": True, "markers": "extra == 'baz'", } }, "extras": {"baz": ["baz (>=0.1.0)"]}, }, { "name": "baz", "version": "7.8.9", "optional": False, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": [], "bar": [], "baz": []}, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) exporter.export(fmt, tmp_path, "exported.txt") with (tmp_path / "exported.txt").open(encoding="utf-8") as f: content = f.read() # It does not matter whether packages are exported with extras or not # because all dependencies are listed explicitly. if lock_version == "2.1": expected = [req for req in expected if not req.startswith("bar[baz]")] > assert content == "\n".join(expected) + "\n" E assert 'bar==4.5.6 ;...ion < "4.0"\n' == 'bar==4.5.6 ;...on == "2.7"\n' E E - bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==4.5.6 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - baz==7.8.9 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^... E E ...Full output truncated (6 lines hidden), use '-vv' to show tests/test_exporter.py:2703: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_omits_and_includes_extras_for_txt_formats[1.1-requirements.txt-expected1] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_omits_and_includ1') poetry = , fmt = 'requirements.txt' expected = ['bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"', 'bar[baz]==4.5.6 ; pyth...python_version == "2.7"', 'foo==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"'] lock_version = '1.1' @pytest.mark.parametrize( ["fmt", "expected"], [ ( "constraints.txt", [ f"bar==4.5.6 ; {MARKER_PY}", f"baz==7.8.9 ; {MARKER_PY}", f"foo==1.2.3 ; {MARKER_PY}", ], ), ( "requirements.txt", [ f"bar==4.5.6 ; {MARKER_PY}", f"bar[baz]==4.5.6 ; {MARKER_PY}", f"baz==7.8.9 ; {MARKER_PY}", f"foo==1.2.3 ; {MARKER_PY}", ], ), ], ) @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_omits_and_includes_extras_for_txt_formats( tmp_path: Path, poetry: Poetry, fmt: str, expected: list[str], lock_version: str ) -> None: lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "dependencies": { "bar": { "extras": ["baz"], "version": ">=0.1.0", } }, }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "dependencies": { "baz": { "version": ">=0.1.0", "optional": True, "markers": "extra == 'baz'", } }, "extras": {"baz": ["baz (>=0.1.0)"]}, }, { "name": "baz", "version": "7.8.9", "optional": False, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": [], "bar": [], "baz": []}, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) exporter.export(fmt, tmp_path, "exported.txt") with (tmp_path / "exported.txt").open(encoding="utf-8") as f: content = f.read() # It does not matter whether packages are exported with extras or not # because all dependencies are listed explicitly. if lock_version == "2.1": expected = [req for req in expected if not req.startswith("bar[baz]")] > assert content == "\n".join(expected) + "\n" E assert 'bar==4.5.6 ;...ion < "4.0"\n' == 'bar==4.5.6 ;...on == "2.7"\n' E E - bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==4.5.6 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - bar[baz]==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^... E E ...Full output truncated (10 lines hidden), use '-vv' to show tests/test_exporter.py:2703: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_omits_and_includes_extras_for_txt_formats[2.1-constraints.txt-expected0] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_omits_and_includ2') poetry = , fmt = 'constraints.txt' expected = ['bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"', 'baz==7.8.9 ; python_ve...python_version == "2.7"', 'foo==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"'] lock_version = '2.1' @pytest.mark.parametrize( ["fmt", "expected"], [ ( "constraints.txt", [ f"bar==4.5.6 ; {MARKER_PY}", f"baz==7.8.9 ; {MARKER_PY}", f"foo==1.2.3 ; {MARKER_PY}", ], ), ( "requirements.txt", [ f"bar==4.5.6 ; {MARKER_PY}", f"bar[baz]==4.5.6 ; {MARKER_PY}", f"baz==7.8.9 ; {MARKER_PY}", f"foo==1.2.3 ; {MARKER_PY}", ], ), ], ) @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_omits_and_includes_extras_for_txt_formats( tmp_path: Path, poetry: Poetry, fmt: str, expected: list[str], lock_version: str ) -> None: lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "dependencies": { "bar": { "extras": ["baz"], "version": ">=0.1.0", } }, }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "dependencies": { "baz": { "version": ">=0.1.0", "optional": True, "markers": "extra == 'baz'", } }, "extras": {"baz": ["baz (>=0.1.0)"]}, }, { "name": "baz", "version": "7.8.9", "optional": False, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": [], "bar": [], "baz": []}, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) exporter.export(fmt, tmp_path, "exported.txt") with (tmp_path / "exported.txt").open(encoding="utf-8") as f: content = f.read() # It does not matter whether packages are exported with extras or not # because all dependencies are listed explicitly. if lock_version == "2.1": expected = [req for req in expected if not req.startswith("bar[baz]")] > assert content == "\n".join(expected) + "\n" E assert 'bar==4.5.6 ;...ion < "4.0"\n' == 'bar==4.5.6 ;...on == "2.7"\n' E E - bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==4.5.6 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - baz==7.8.9 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^... E E ...Full output truncated (6 lines hidden), use '-vv' to show tests/test_exporter.py:2703: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_omits_and_includes_extras_for_txt_formats[2.1-requirements.txt-expected1] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_omits_and_includ3') poetry = , fmt = 'requirements.txt' expected = ['bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"', 'baz==7.8.9 ; python_ve...python_version == "2.7"', 'foo==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"'] lock_version = '2.1' @pytest.mark.parametrize( ["fmt", "expected"], [ ( "constraints.txt", [ f"bar==4.5.6 ; {MARKER_PY}", f"baz==7.8.9 ; {MARKER_PY}", f"foo==1.2.3 ; {MARKER_PY}", ], ), ( "requirements.txt", [ f"bar==4.5.6 ; {MARKER_PY}", f"bar[baz]==4.5.6 ; {MARKER_PY}", f"baz==7.8.9 ; {MARKER_PY}", f"foo==1.2.3 ; {MARKER_PY}", ], ), ], ) @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_omits_and_includes_extras_for_txt_formats( tmp_path: Path, poetry: Poetry, fmt: str, expected: list[str], lock_version: str ) -> None: lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "dependencies": { "bar": { "extras": ["baz"], "version": ">=0.1.0", } }, }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "dependencies": { "baz": { "version": ">=0.1.0", "optional": True, "markers": "extra == 'baz'", } }, "extras": {"baz": ["baz (>=0.1.0)"]}, }, { "name": "baz", "version": "7.8.9", "optional": False, "python-versions": "*", }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": [], "bar": [], "baz": []}, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) exporter.export(fmt, tmp_path, "exported.txt") with (tmp_path / "exported.txt").open(encoding="utf-8") as f: content = f.read() # It does not matter whether packages are exported with extras or not # because all dependencies are listed explicitly. if lock_version == "2.1": expected = [req for req in expected if not req.startswith("bar[baz]")] > assert content == "\n".join(expected) + "\n" E assert 'bar==4.5.6 ;...ion < "4.0"\n' == 'bar==4.5.6 ;...on == "2.7"\n' E E - bar==4.5.6 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==4.5.6 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - baz==7.8.9 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^... E E ...Full output truncated (6 lines hidden), use '-vv' to show tests/test_exporter.py:2703: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_prints_warning_for_constraints_txt_with_editable_packages[1.1] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_prints_warning_f0') poetry = , lock_version = '1.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_prints_warning_for_constraints_txt_with_editable_packages( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "source": { "type": "git", "url": "https://github.com/foo/foo.git", "reference": "123456", }, "develop": True, }, { "name": "bar", "version": "7.8.9", "optional": False, "python-versions": "*", }, { "name": "baz", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "directory", "url": "sample_project", "reference": "", }, "develop": True, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": [], "bar": [], "baz": []}, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) io = BufferedIO() exporter = Exporter(poetry, io) exporter.export("constraints.txt", tmp_path, "constraints.txt") expected_error_out = ( "Warning: foo is locked in develop (editable) mode, which is " "incompatible with the constraints.txt format.\n" "Warning: baz is locked in develop (editable) mode, which is " "incompatible with the constraints.txt format.\n" ) assert io.fetch_error() == expected_error_out with (tmp_path / "constraints.txt").open(encoding="utf-8") as f: content = f.read() > assert content == f"bar==7.8.9 ; {MARKER_PY}\n" E assert 'bar==7.8.9 ;...ion < "4.0"\n' == 'bar==7.8.9 ;...on == "2.7"\n' E E - bar==7.8.9 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==7.8.9 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ tests/test_exporter.py:2770: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _ test_exporter_prints_warning_for_constraints_txt_with_editable_packages[2.1] _ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_prints_warning_f1') poetry = , lock_version = '2.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_prints_warning_for_constraints_txt_with_editable_packages( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "source": { "type": "git", "url": "https://github.com/foo/foo.git", "reference": "123456", }, "develop": True, }, { "name": "bar", "version": "7.8.9", "optional": False, "python-versions": "*", }, { "name": "baz", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "directory", "url": "sample_project", "reference": "", }, "develop": True, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": [], "bar": [], "baz": []}, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) io = BufferedIO() exporter = Exporter(poetry, io) exporter.export("constraints.txt", tmp_path, "constraints.txt") expected_error_out = ( "Warning: foo is locked in develop (editable) mode, which is " "incompatible with the constraints.txt format.\n" "Warning: baz is locked in develop (editable) mode, which is " "incompatible with the constraints.txt format.\n" ) assert io.fetch_error() == expected_error_out with (tmp_path / "constraints.txt").open(encoding="utf-8") as f: content = f.read() > assert content == f"bar==7.8.9 ; {MARKER_PY}\n" E assert 'bar==7.8.9 ;...ion < "4.0"\n' == 'bar==7.8.9 ;...on == "2.7"\n' E E - bar==7.8.9 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + bar==7.8.9 ; python_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ tests/test_exporter.py:2770: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _________ test_exporter_exports_extra_index_url_and_trusted_host[1.1] __________ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_exports_extra_in0') poetry = , lock_version = '1.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_exports_extra_index_url_and_trusted_host( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: poetry.pool.add_repository( LegacyRepository( "custom", "http://example.com/simple", ), priority=Priority.EXPLICIT, ) lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "dependencies": {"bar": "*"}, }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "http://example.com/simple", "reference": "", }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": [], "bar": []}, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ --trusted-host example.com --extra-index-url http://example.com/simple bar==4.5.6 ; {MARKER_PY} foo==1.2.3 ; {MARKER_PY} """ > assert content == expected E assert '--trusted-ho...ion < "4.0"\n' == '--trusted-ho...on == "2.7"\n' E E Skipping 90 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - foo==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"... E E ...Full output truncated (3 lines hidden), use '-vv' to show tests/test_exporter.py:2965: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _________ test_exporter_exports_extra_index_url_and_trusted_host[2.1] __________ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_exports_extra_in1') poetry = , lock_version = '2.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_exports_extra_index_url_and_trusted_host( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: poetry.pool.add_repository( LegacyRepository( "custom", "http://example.com/simple", ), priority=Priority.EXPLICIT, ) lock_data = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "dependencies": {"bar": "*"}, }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "http://example.com/simple", "reference": "", }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": [], "bar": []}, }, } fix_lock_data(lock_data) poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry) exporter = Exporter(poetry, NullIO()) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = f"""\ --trusted-host example.com --extra-index-url http://example.com/simple bar==4.5.6 ; {MARKER_PY} foo==1.2.3 ; {MARKER_PY} """ > assert content == expected E assert '--trusted-ho...ion < "4.0"\n' == '--trusted-ho...on == "2.7"\n' E E Skipping 90 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E - foo==1.2.3 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"... E E ...Full output truncated (3 lines hidden), use '-vv' to show tests/test_exporter.py:2965: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _____________ test_exporter_index_urls[1.1-priorities0-expected0] ______________ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_index_urls_1_1_p0') poetry = priorities = [('custom-a', ), ('custom-b', )] expected = ('a', 'b'), lock_version = '1.1' @pytest.mark.parametrize( ("priorities", "expected"), [ ([("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY)], ("a", "b")), ([("custom-b", Priority.PRIMARY), ("custom-a", Priority.PRIMARY)], ("b", "a")), ( [("custom-b", Priority.SUPPLEMENTAL), ("custom-a", Priority.PRIMARY)], ("a", "b"), ), ([("custom-b", Priority.EXPLICIT), ("custom-a", Priority.PRIMARY)], ("a", "b")), ( [ ("PyPI", Priority.PRIMARY), ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ], ("", "a", "b"), ), ( [ ("PyPI", Priority.EXPLICIT), ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ], ("", "a", "b"), ), ( [ ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ("PyPI", Priority.SUPPLEMENTAL), ], ("", "a", "b"), ), ], ) @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_index_urls( tmp_path: Path, poetry: Poetry, priorities: list[tuple[str, Priority]], expected: tuple[str, ...], lock_version: str, ) -> None: pypi = poetry.pool.repository("PyPI") poetry.pool.remove_repository("PyPI") for name, prio in priorities: if name.lower() == "pypi": repo = pypi else: repo = LegacyRepository(name, f"https://{name[-1]}.example.com/simple") poetry.pool.add_repository(repo, priority=prio) lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://a.example.com/simple", "reference": "", }, }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://b.example.com/simple", "reference": "", }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][0]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar"}) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected_urls = [ f"--extra-index-url https://{name[-1]}.example.com/simple" for name in expected[1:] ] if expected[0]: expected_urls = [ f"--index-url https://{expected[0]}.example.com/simple", *expected_urls, ] url_string = "\n".join(expected_urls) expected_content = f"""\ {url_string} bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:67890 foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected_content E assert '--index-url ...ha256:12345\n' == '--index-url ...ha256:12345\n' E E Skipping 107 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:67890... E E ...Full output truncated (5 lines hidden), use '-vv' to show tests/test_exporter.py:3175: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _____________ test_exporter_index_urls[1.1-priorities1-expected1] ______________ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_index_urls_1_1_p1') poetry = priorities = [('custom-b', ), ('custom-a', )] expected = ('b', 'a'), lock_version = '1.1' @pytest.mark.parametrize( ("priorities", "expected"), [ ([("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY)], ("a", "b")), ([("custom-b", Priority.PRIMARY), ("custom-a", Priority.PRIMARY)], ("b", "a")), ( [("custom-b", Priority.SUPPLEMENTAL), ("custom-a", Priority.PRIMARY)], ("a", "b"), ), ([("custom-b", Priority.EXPLICIT), ("custom-a", Priority.PRIMARY)], ("a", "b")), ( [ ("PyPI", Priority.PRIMARY), ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ], ("", "a", "b"), ), ( [ ("PyPI", Priority.EXPLICIT), ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ], ("", "a", "b"), ), ( [ ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ("PyPI", Priority.SUPPLEMENTAL), ], ("", "a", "b"), ), ], ) @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_index_urls( tmp_path: Path, poetry: Poetry, priorities: list[tuple[str, Priority]], expected: tuple[str, ...], lock_version: str, ) -> None: pypi = poetry.pool.repository("PyPI") poetry.pool.remove_repository("PyPI") for name, prio in priorities: if name.lower() == "pypi": repo = pypi else: repo = LegacyRepository(name, f"https://{name[-1]}.example.com/simple") poetry.pool.add_repository(repo, priority=prio) lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://a.example.com/simple", "reference": "", }, }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://b.example.com/simple", "reference": "", }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][0]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar"}) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected_urls = [ f"--extra-index-url https://{name[-1]}.example.com/simple" for name in expected[1:] ] if expected[0]: expected_urls = [ f"--index-url https://{expected[0]}.example.com/simple", *expected_urls, ] url_string = "\n".join(expected_urls) expected_content = f"""\ {url_string} bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:67890 foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected_content E assert '--index-url ...ha256:12345\n' == '--index-url ...ha256:12345\n' E E Skipping 107 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:67890... E E ...Full output truncated (5 lines hidden), use '-vv' to show tests/test_exporter.py:3175: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _____________ test_exporter_index_urls[1.1-priorities2-expected2] ______________ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_index_urls_1_1_p2') poetry = priorities = [('custom-b', ), ('custom-a', )] expected = ('a', 'b'), lock_version = '1.1' @pytest.mark.parametrize( ("priorities", "expected"), [ ([("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY)], ("a", "b")), ([("custom-b", Priority.PRIMARY), ("custom-a", Priority.PRIMARY)], ("b", "a")), ( [("custom-b", Priority.SUPPLEMENTAL), ("custom-a", Priority.PRIMARY)], ("a", "b"), ), ([("custom-b", Priority.EXPLICIT), ("custom-a", Priority.PRIMARY)], ("a", "b")), ( [ ("PyPI", Priority.PRIMARY), ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ], ("", "a", "b"), ), ( [ ("PyPI", Priority.EXPLICIT), ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ], ("", "a", "b"), ), ( [ ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ("PyPI", Priority.SUPPLEMENTAL), ], ("", "a", "b"), ), ], ) @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_index_urls( tmp_path: Path, poetry: Poetry, priorities: list[tuple[str, Priority]], expected: tuple[str, ...], lock_version: str, ) -> None: pypi = poetry.pool.repository("PyPI") poetry.pool.remove_repository("PyPI") for name, prio in priorities: if name.lower() == "pypi": repo = pypi else: repo = LegacyRepository(name, f"https://{name[-1]}.example.com/simple") poetry.pool.add_repository(repo, priority=prio) lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://a.example.com/simple", "reference": "", }, }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://b.example.com/simple", "reference": "", }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][0]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar"}) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected_urls = [ f"--extra-index-url https://{name[-1]}.example.com/simple" for name in expected[1:] ] if expected[0]: expected_urls = [ f"--index-url https://{expected[0]}.example.com/simple", *expected_urls, ] url_string = "\n".join(expected_urls) expected_content = f"""\ {url_string} bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:67890 foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected_content E assert '--index-url ...ha256:12345\n' == '--index-url ...ha256:12345\n' E E Skipping 107 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:67890... E E ...Full output truncated (5 lines hidden), use '-vv' to show tests/test_exporter.py:3175: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _____________ test_exporter_index_urls[1.1-priorities3-expected3] ______________ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_index_urls_1_1_p3') poetry = priorities = [('custom-b', ), ('custom-a', )] expected = ('a', 'b'), lock_version = '1.1' @pytest.mark.parametrize( ("priorities", "expected"), [ ([("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY)], ("a", "b")), ([("custom-b", Priority.PRIMARY), ("custom-a", Priority.PRIMARY)], ("b", "a")), ( [("custom-b", Priority.SUPPLEMENTAL), ("custom-a", Priority.PRIMARY)], ("a", "b"), ), ([("custom-b", Priority.EXPLICIT), ("custom-a", Priority.PRIMARY)], ("a", "b")), ( [ ("PyPI", Priority.PRIMARY), ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ], ("", "a", "b"), ), ( [ ("PyPI", Priority.EXPLICIT), ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ], ("", "a", "b"), ), ( [ ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ("PyPI", Priority.SUPPLEMENTAL), ], ("", "a", "b"), ), ], ) @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_index_urls( tmp_path: Path, poetry: Poetry, priorities: list[tuple[str, Priority]], expected: tuple[str, ...], lock_version: str, ) -> None: pypi = poetry.pool.repository("PyPI") poetry.pool.remove_repository("PyPI") for name, prio in priorities: if name.lower() == "pypi": repo = pypi else: repo = LegacyRepository(name, f"https://{name[-1]}.example.com/simple") poetry.pool.add_repository(repo, priority=prio) lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://a.example.com/simple", "reference": "", }, }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://b.example.com/simple", "reference": "", }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][0]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar"}) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected_urls = [ f"--extra-index-url https://{name[-1]}.example.com/simple" for name in expected[1:] ] if expected[0]: expected_urls = [ f"--index-url https://{expected[0]}.example.com/simple", *expected_urls, ] url_string = "\n".join(expected_urls) expected_content = f"""\ {url_string} bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:67890 foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected_content E assert '--index-url ...ha256:12345\n' == '--index-url ...ha256:12345\n' E E Skipping 107 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:67890... E E ...Full output truncated (5 lines hidden), use '-vv' to show tests/test_exporter.py:3175: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _____________ test_exporter_index_urls[1.1-priorities4-expected4] ______________ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_index_urls_1_1_p4') poetry = priorities = [('PyPI', ), ('custom-a', ), ('custom-b', )] expected = ('', 'a', 'b'), lock_version = '1.1' @pytest.mark.parametrize( ("priorities", "expected"), [ ([("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY)], ("a", "b")), ([("custom-b", Priority.PRIMARY), ("custom-a", Priority.PRIMARY)], ("b", "a")), ( [("custom-b", Priority.SUPPLEMENTAL), ("custom-a", Priority.PRIMARY)], ("a", "b"), ), ([("custom-b", Priority.EXPLICIT), ("custom-a", Priority.PRIMARY)], ("a", "b")), ( [ ("PyPI", Priority.PRIMARY), ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ], ("", "a", "b"), ), ( [ ("PyPI", Priority.EXPLICIT), ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ], ("", "a", "b"), ), ( [ ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ("PyPI", Priority.SUPPLEMENTAL), ], ("", "a", "b"), ), ], ) @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_index_urls( tmp_path: Path, poetry: Poetry, priorities: list[tuple[str, Priority]], expected: tuple[str, ...], lock_version: str, ) -> None: pypi = poetry.pool.repository("PyPI") poetry.pool.remove_repository("PyPI") for name, prio in priorities: if name.lower() == "pypi": repo = pypi else: repo = LegacyRepository(name, f"https://{name[-1]}.example.com/simple") poetry.pool.add_repository(repo, priority=prio) lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://a.example.com/simple", "reference": "", }, }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://b.example.com/simple", "reference": "", }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][0]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar"}) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected_urls = [ f"--extra-index-url https://{name[-1]}.example.com/simple" for name in expected[1:] ] if expected[0]: expected_urls = [ f"--index-url https://{expected[0]}.example.com/simple", *expected_urls, ] url_string = "\n".join(expected_urls) expected_content = f"""\ {url_string} bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:67890 foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected_content E assert '--extra-inde...ha256:12345\n' == '--extra-inde...ha256:12345\n' E E Skipping 113 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:67890... E E ...Full output truncated (5 lines hidden), use '-vv' to show tests/test_exporter.py:3175: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _____________ test_exporter_index_urls[1.1-priorities5-expected5] ______________ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_index_urls_1_1_p5') poetry = priorities = [('PyPI', ), ('custom-a', ), ('custom-b', )] expected = ('', 'a', 'b'), lock_version = '1.1' @pytest.mark.parametrize( ("priorities", "expected"), [ ([("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY)], ("a", "b")), ([("custom-b", Priority.PRIMARY), ("custom-a", Priority.PRIMARY)], ("b", "a")), ( [("custom-b", Priority.SUPPLEMENTAL), ("custom-a", Priority.PRIMARY)], ("a", "b"), ), ([("custom-b", Priority.EXPLICIT), ("custom-a", Priority.PRIMARY)], ("a", "b")), ( [ ("PyPI", Priority.PRIMARY), ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ], ("", "a", "b"), ), ( [ ("PyPI", Priority.EXPLICIT), ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ], ("", "a", "b"), ), ( [ ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ("PyPI", Priority.SUPPLEMENTAL), ], ("", "a", "b"), ), ], ) @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_index_urls( tmp_path: Path, poetry: Poetry, priorities: list[tuple[str, Priority]], expected: tuple[str, ...], lock_version: str, ) -> None: pypi = poetry.pool.repository("PyPI") poetry.pool.remove_repository("PyPI") for name, prio in priorities: if name.lower() == "pypi": repo = pypi else: repo = LegacyRepository(name, f"https://{name[-1]}.example.com/simple") poetry.pool.add_repository(repo, priority=prio) lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://a.example.com/simple", "reference": "", }, }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://b.example.com/simple", "reference": "", }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][0]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar"}) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected_urls = [ f"--extra-index-url https://{name[-1]}.example.com/simple" for name in expected[1:] ] if expected[0]: expected_urls = [ f"--index-url https://{expected[0]}.example.com/simple", *expected_urls, ] url_string = "\n".join(expected_urls) expected_content = f"""\ {url_string} bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:67890 foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected_content E assert '--extra-inde...ha256:12345\n' == '--extra-inde...ha256:12345\n' E E Skipping 113 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:67890... E E ...Full output truncated (5 lines hidden), use '-vv' to show tests/test_exporter.py:3175: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _____________ test_exporter_index_urls[1.1-priorities6-expected6] ______________ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_index_urls_1_1_p6') poetry = priorities = [('custom-a', ), ('custom-b', ), ('PyPI', )] expected = ('', 'a', 'b'), lock_version = '1.1' @pytest.mark.parametrize( ("priorities", "expected"), [ ([("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY)], ("a", "b")), ([("custom-b", Priority.PRIMARY), ("custom-a", Priority.PRIMARY)], ("b", "a")), ( [("custom-b", Priority.SUPPLEMENTAL), ("custom-a", Priority.PRIMARY)], ("a", "b"), ), ([("custom-b", Priority.EXPLICIT), ("custom-a", Priority.PRIMARY)], ("a", "b")), ( [ ("PyPI", Priority.PRIMARY), ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ], ("", "a", "b"), ), ( [ ("PyPI", Priority.EXPLICIT), ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ], ("", "a", "b"), ), ( [ ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ("PyPI", Priority.SUPPLEMENTAL), ], ("", "a", "b"), ), ], ) @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_index_urls( tmp_path: Path, poetry: Poetry, priorities: list[tuple[str, Priority]], expected: tuple[str, ...], lock_version: str, ) -> None: pypi = poetry.pool.repository("PyPI") poetry.pool.remove_repository("PyPI") for name, prio in priorities: if name.lower() == "pypi": repo = pypi else: repo = LegacyRepository(name, f"https://{name[-1]}.example.com/simple") poetry.pool.add_repository(repo, priority=prio) lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://a.example.com/simple", "reference": "", }, }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://b.example.com/simple", "reference": "", }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][0]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar"}) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected_urls = [ f"--extra-index-url https://{name[-1]}.example.com/simple" for name in expected[1:] ] if expected[0]: expected_urls = [ f"--index-url https://{expected[0]}.example.com/simple", *expected_urls, ] url_string = "\n".join(expected_urls) expected_content = f"""\ {url_string} bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:67890 foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected_content E assert '--extra-inde...ha256:12345\n' == '--extra-inde...ha256:12345\n' E E Skipping 113 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:67890... E E ...Full output truncated (5 lines hidden), use '-vv' to show tests/test_exporter.py:3175: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _____________ test_exporter_index_urls[2.1-priorities0-expected0] ______________ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_index_urls_2_1_p0') poetry = priorities = [('custom-a', ), ('custom-b', )] expected = ('a', 'b'), lock_version = '2.1' @pytest.mark.parametrize( ("priorities", "expected"), [ ([("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY)], ("a", "b")), ([("custom-b", Priority.PRIMARY), ("custom-a", Priority.PRIMARY)], ("b", "a")), ( [("custom-b", Priority.SUPPLEMENTAL), ("custom-a", Priority.PRIMARY)], ("a", "b"), ), ([("custom-b", Priority.EXPLICIT), ("custom-a", Priority.PRIMARY)], ("a", "b")), ( [ ("PyPI", Priority.PRIMARY), ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ], ("", "a", "b"), ), ( [ ("PyPI", Priority.EXPLICIT), ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ], ("", "a", "b"), ), ( [ ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ("PyPI", Priority.SUPPLEMENTAL), ], ("", "a", "b"), ), ], ) @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_index_urls( tmp_path: Path, poetry: Poetry, priorities: list[tuple[str, Priority]], expected: tuple[str, ...], lock_version: str, ) -> None: pypi = poetry.pool.repository("PyPI") poetry.pool.remove_repository("PyPI") for name, prio in priorities: if name.lower() == "pypi": repo = pypi else: repo = LegacyRepository(name, f"https://{name[-1]}.example.com/simple") poetry.pool.add_repository(repo, priority=prio) lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://a.example.com/simple", "reference": "", }, }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://b.example.com/simple", "reference": "", }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][0]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar"}) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected_urls = [ f"--extra-index-url https://{name[-1]}.example.com/simple" for name in expected[1:] ] if expected[0]: expected_urls = [ f"--index-url https://{expected[0]}.example.com/simple", *expected_urls, ] url_string = "\n".join(expected_urls) expected_content = f"""\ {url_string} bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:67890 foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected_content E assert '--index-url ...ha256:12345\n' == '--index-url ...ha256:12345\n' E E Skipping 107 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:67890... E E ...Full output truncated (5 lines hidden), use '-vv' to show tests/test_exporter.py:3175: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _____________ test_exporter_index_urls[2.1-priorities1-expected1] ______________ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_index_urls_2_1_p1') poetry = priorities = [('custom-b', ), ('custom-a', )] expected = ('b', 'a'), lock_version = '2.1' @pytest.mark.parametrize( ("priorities", "expected"), [ ([("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY)], ("a", "b")), ([("custom-b", Priority.PRIMARY), ("custom-a", Priority.PRIMARY)], ("b", "a")), ( [("custom-b", Priority.SUPPLEMENTAL), ("custom-a", Priority.PRIMARY)], ("a", "b"), ), ([("custom-b", Priority.EXPLICIT), ("custom-a", Priority.PRIMARY)], ("a", "b")), ( [ ("PyPI", Priority.PRIMARY), ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ], ("", "a", "b"), ), ( [ ("PyPI", Priority.EXPLICIT), ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ], ("", "a", "b"), ), ( [ ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ("PyPI", Priority.SUPPLEMENTAL), ], ("", "a", "b"), ), ], ) @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_index_urls( tmp_path: Path, poetry: Poetry, priorities: list[tuple[str, Priority]], expected: tuple[str, ...], lock_version: str, ) -> None: pypi = poetry.pool.repository("PyPI") poetry.pool.remove_repository("PyPI") for name, prio in priorities: if name.lower() == "pypi": repo = pypi else: repo = LegacyRepository(name, f"https://{name[-1]}.example.com/simple") poetry.pool.add_repository(repo, priority=prio) lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://a.example.com/simple", "reference": "", }, }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://b.example.com/simple", "reference": "", }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][0]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar"}) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected_urls = [ f"--extra-index-url https://{name[-1]}.example.com/simple" for name in expected[1:] ] if expected[0]: expected_urls = [ f"--index-url https://{expected[0]}.example.com/simple", *expected_urls, ] url_string = "\n".join(expected_urls) expected_content = f"""\ {url_string} bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:67890 foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected_content E assert '--index-url ...ha256:12345\n' == '--index-url ...ha256:12345\n' E E Skipping 107 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:67890... E E ...Full output truncated (5 lines hidden), use '-vv' to show tests/test_exporter.py:3175: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _____________ test_exporter_index_urls[2.1-priorities2-expected2] ______________ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_index_urls_2_1_p2') poetry = priorities = [('custom-b', ), ('custom-a', )] expected = ('a', 'b'), lock_version = '2.1' @pytest.mark.parametrize( ("priorities", "expected"), [ ([("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY)], ("a", "b")), ([("custom-b", Priority.PRIMARY), ("custom-a", Priority.PRIMARY)], ("b", "a")), ( [("custom-b", Priority.SUPPLEMENTAL), ("custom-a", Priority.PRIMARY)], ("a", "b"), ), ([("custom-b", Priority.EXPLICIT), ("custom-a", Priority.PRIMARY)], ("a", "b")), ( [ ("PyPI", Priority.PRIMARY), ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ], ("", "a", "b"), ), ( [ ("PyPI", Priority.EXPLICIT), ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ], ("", "a", "b"), ), ( [ ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ("PyPI", Priority.SUPPLEMENTAL), ], ("", "a", "b"), ), ], ) @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_index_urls( tmp_path: Path, poetry: Poetry, priorities: list[tuple[str, Priority]], expected: tuple[str, ...], lock_version: str, ) -> None: pypi = poetry.pool.repository("PyPI") poetry.pool.remove_repository("PyPI") for name, prio in priorities: if name.lower() == "pypi": repo = pypi else: repo = LegacyRepository(name, f"https://{name[-1]}.example.com/simple") poetry.pool.add_repository(repo, priority=prio) lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://a.example.com/simple", "reference": "", }, }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://b.example.com/simple", "reference": "", }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][0]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar"}) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected_urls = [ f"--extra-index-url https://{name[-1]}.example.com/simple" for name in expected[1:] ] if expected[0]: expected_urls = [ f"--index-url https://{expected[0]}.example.com/simple", *expected_urls, ] url_string = "\n".join(expected_urls) expected_content = f"""\ {url_string} bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:67890 foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected_content E assert '--index-url ...ha256:12345\n' == '--index-url ...ha256:12345\n' E E Skipping 107 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:67890... E E ...Full output truncated (5 lines hidden), use '-vv' to show tests/test_exporter.py:3175: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _____________ test_exporter_index_urls[2.1-priorities3-expected3] ______________ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_index_urls_2_1_p3') poetry = priorities = [('custom-b', ), ('custom-a', )] expected = ('a', 'b'), lock_version = '2.1' @pytest.mark.parametrize( ("priorities", "expected"), [ ([("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY)], ("a", "b")), ([("custom-b", Priority.PRIMARY), ("custom-a", Priority.PRIMARY)], ("b", "a")), ( [("custom-b", Priority.SUPPLEMENTAL), ("custom-a", Priority.PRIMARY)], ("a", "b"), ), ([("custom-b", Priority.EXPLICIT), ("custom-a", Priority.PRIMARY)], ("a", "b")), ( [ ("PyPI", Priority.PRIMARY), ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ], ("", "a", "b"), ), ( [ ("PyPI", Priority.EXPLICIT), ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ], ("", "a", "b"), ), ( [ ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ("PyPI", Priority.SUPPLEMENTAL), ], ("", "a", "b"), ), ], ) @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_index_urls( tmp_path: Path, poetry: Poetry, priorities: list[tuple[str, Priority]], expected: tuple[str, ...], lock_version: str, ) -> None: pypi = poetry.pool.repository("PyPI") poetry.pool.remove_repository("PyPI") for name, prio in priorities: if name.lower() == "pypi": repo = pypi else: repo = LegacyRepository(name, f"https://{name[-1]}.example.com/simple") poetry.pool.add_repository(repo, priority=prio) lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://a.example.com/simple", "reference": "", }, }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://b.example.com/simple", "reference": "", }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][0]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar"}) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected_urls = [ f"--extra-index-url https://{name[-1]}.example.com/simple" for name in expected[1:] ] if expected[0]: expected_urls = [ f"--index-url https://{expected[0]}.example.com/simple", *expected_urls, ] url_string = "\n".join(expected_urls) expected_content = f"""\ {url_string} bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:67890 foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected_content E assert '--index-url ...ha256:12345\n' == '--index-url ...ha256:12345\n' E E Skipping 107 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:67890... E E ...Full output truncated (5 lines hidden), use '-vv' to show tests/test_exporter.py:3175: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _____________ test_exporter_index_urls[2.1-priorities4-expected4] ______________ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_index_urls_2_1_p4') poetry = priorities = [('PyPI', ), ('custom-a', ), ('custom-b', )] expected = ('', 'a', 'b'), lock_version = '2.1' @pytest.mark.parametrize( ("priorities", "expected"), [ ([("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY)], ("a", "b")), ([("custom-b", Priority.PRIMARY), ("custom-a", Priority.PRIMARY)], ("b", "a")), ( [("custom-b", Priority.SUPPLEMENTAL), ("custom-a", Priority.PRIMARY)], ("a", "b"), ), ([("custom-b", Priority.EXPLICIT), ("custom-a", Priority.PRIMARY)], ("a", "b")), ( [ ("PyPI", Priority.PRIMARY), ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ], ("", "a", "b"), ), ( [ ("PyPI", Priority.EXPLICIT), ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ], ("", "a", "b"), ), ( [ ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ("PyPI", Priority.SUPPLEMENTAL), ], ("", "a", "b"), ), ], ) @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_index_urls( tmp_path: Path, poetry: Poetry, priorities: list[tuple[str, Priority]], expected: tuple[str, ...], lock_version: str, ) -> None: pypi = poetry.pool.repository("PyPI") poetry.pool.remove_repository("PyPI") for name, prio in priorities: if name.lower() == "pypi": repo = pypi else: repo = LegacyRepository(name, f"https://{name[-1]}.example.com/simple") poetry.pool.add_repository(repo, priority=prio) lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://a.example.com/simple", "reference": "", }, }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://b.example.com/simple", "reference": "", }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][0]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar"}) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected_urls = [ f"--extra-index-url https://{name[-1]}.example.com/simple" for name in expected[1:] ] if expected[0]: expected_urls = [ f"--index-url https://{expected[0]}.example.com/simple", *expected_urls, ] url_string = "\n".join(expected_urls) expected_content = f"""\ {url_string} bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:67890 foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected_content E assert '--extra-inde...ha256:12345\n' == '--extra-inde...ha256:12345\n' E E Skipping 113 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:67890... E E ...Full output truncated (5 lines hidden), use '-vv' to show tests/test_exporter.py:3175: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _____________ test_exporter_index_urls[2.1-priorities5-expected5] ______________ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_index_urls_2_1_p5') poetry = priorities = [('PyPI', ), ('custom-a', ), ('custom-b', )] expected = ('', 'a', 'b'), lock_version = '2.1' @pytest.mark.parametrize( ("priorities", "expected"), [ ([("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY)], ("a", "b")), ([("custom-b", Priority.PRIMARY), ("custom-a", Priority.PRIMARY)], ("b", "a")), ( [("custom-b", Priority.SUPPLEMENTAL), ("custom-a", Priority.PRIMARY)], ("a", "b"), ), ([("custom-b", Priority.EXPLICIT), ("custom-a", Priority.PRIMARY)], ("a", "b")), ( [ ("PyPI", Priority.PRIMARY), ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ], ("", "a", "b"), ), ( [ ("PyPI", Priority.EXPLICIT), ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ], ("", "a", "b"), ), ( [ ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ("PyPI", Priority.SUPPLEMENTAL), ], ("", "a", "b"), ), ], ) @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_index_urls( tmp_path: Path, poetry: Poetry, priorities: list[tuple[str, Priority]], expected: tuple[str, ...], lock_version: str, ) -> None: pypi = poetry.pool.repository("PyPI") poetry.pool.remove_repository("PyPI") for name, prio in priorities: if name.lower() == "pypi": repo = pypi else: repo = LegacyRepository(name, f"https://{name[-1]}.example.com/simple") poetry.pool.add_repository(repo, priority=prio) lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://a.example.com/simple", "reference": "", }, }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://b.example.com/simple", "reference": "", }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][0]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar"}) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected_urls = [ f"--extra-index-url https://{name[-1]}.example.com/simple" for name in expected[1:] ] if expected[0]: expected_urls = [ f"--index-url https://{expected[0]}.example.com/simple", *expected_urls, ] url_string = "\n".join(expected_urls) expected_content = f"""\ {url_string} bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:67890 foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected_content E assert '--extra-inde...ha256:12345\n' == '--extra-inde...ha256:12345\n' E E Skipping 113 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:67890... E E ...Full output truncated (5 lines hidden), use '-vv' to show tests/test_exporter.py:3175: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _____________ test_exporter_index_urls[2.1-priorities6-expected6] ______________ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_exporter_index_urls_2_1_p6') poetry = priorities = [('custom-a', ), ('custom-b', ), ('PyPI', )] expected = ('', 'a', 'b'), lock_version = '2.1' @pytest.mark.parametrize( ("priorities", "expected"), [ ([("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY)], ("a", "b")), ([("custom-b", Priority.PRIMARY), ("custom-a", Priority.PRIMARY)], ("b", "a")), ( [("custom-b", Priority.SUPPLEMENTAL), ("custom-a", Priority.PRIMARY)], ("a", "b"), ), ([("custom-b", Priority.EXPLICIT), ("custom-a", Priority.PRIMARY)], ("a", "b")), ( [ ("PyPI", Priority.PRIMARY), ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ], ("", "a", "b"), ), ( [ ("PyPI", Priority.EXPLICIT), ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ], ("", "a", "b"), ), ( [ ("custom-a", Priority.PRIMARY), ("custom-b", Priority.PRIMARY), ("PyPI", Priority.SUPPLEMENTAL), ], ("", "a", "b"), ), ], ) @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_exporter_index_urls( tmp_path: Path, poetry: Poetry, priorities: list[tuple[str, Priority]], expected: tuple[str, ...], lock_version: str, ) -> None: pypi = poetry.pool.repository("PyPI") poetry.pool.remove_repository("PyPI") for name, prio in priorities: if name.lower() == "pypi": repo = pypi else: repo = LegacyRepository(name, f"https://{name[-1]}.example.com/simple") poetry.pool.add_repository(repo, priority=prio) lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1.2.3", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://a.example.com/simple", "reference": "", }, }, { "name": "bar", "version": "4.5.6", "optional": False, "python-versions": "*", "source": { "type": "legacy", "url": "https://b.example.com/simple", "reference": "", }, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": { "foo": [{"name": "foo.whl", "hash": "12345"}], "bar": [{"name": "bar.whl", "hash": "67890"}], }, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][0]["groups"] = ["dev"] poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] set_package_requires(poetry, dev={"bar"}) exporter = Exporter(poetry, NullIO()) exporter.only_groups([MAIN_GROUP, "dev"]) exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected_urls = [ f"--extra-index-url https://{name[-1]}.example.com/simple" for name in expected[1:] ] if expected[0]: expected_urls = [ f"--index-url https://{expected[0]}.example.com/simple", *expected_urls, ] url_string = "\n".join(expected_urls) expected_content = f"""\ {url_string} bar==4.5.6 ; {MARKER_PY} \\ --hash=sha256:67890 foo==1.2.3 ; {MARKER_PY} \\ --hash=sha256:12345 """ > assert content == expected_content E assert '--extra-inde...ha256:12345\n' == '--extra-inde...ha256:12345\n' E E Skipping 113 identical leading characters in diff, use -v to show E - n_version >= "3.6" and python_version < "4.0" or python_version == "2.7" \ E ? - ^ ^ ^^^ ^ ^ ^ ^^ ^^ ^ ^ E + n_version == "2.7" or python_version >= "3.6" and python_version < "4.0" \ E ? + ^ ^ ^^ ^^ ^ ^ ^^^ ^ ^ ^ E --hash=sha256:67890... E E ...Full output truncated (5 lines hidden), use '-vv' to show tests/test_exporter.py:3175: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. _______________________ test_dependency_walk_error[2.1] ________________________ tmp_path = PosixPath('/tmp/pytest-of-buildozer/pytest-101/test_dependency_walk_error_2_10') poetry = , lock_version = '2.1' @pytest.mark.parametrize("lock_version", ("1.1", "2.1")) def test_dependency_walk_error( tmp_path: Path, poetry: Poetry, lock_version: str ) -> None: """ With lock file version 2.1 we can export lock files that resulted in a DependencyWalkerError with lower lock file versions. root ├── foo >=0 ; python_version < "3.9" ├── foo >=1 ; python_version >= "3.9" ├── bar ==1 ; python_version < "3.9" │ └── foo ==1 ; python_version < "3.9" └── bar ==2 ; python_version >= "3.9" └── foo ==2 ; python_version >= "3.9" Only considering the root dependency, foo 2 is a valid solution for all environments. However, due to bar depending on foo, foo 1 must be chosen for Python 3.8 and lower. """ lock_data: dict[str, Any] = { "package": [ { "name": "foo", "version": "1", "optional": False, "python-versions": "*", }, { "name": "foo", "version": "2", "optional": False, "python-versions": "*", }, { "name": "bar", "version": "1", "optional": False, "python-versions": "*", "dependencies": {"foo": "1"}, }, { "name": "bar", "version": "2", "optional": False, "python-versions": "*", "dependencies": {"foo": "2"}, }, ], "metadata": { "lock-version": lock_version, "python-versions": "*", "content-hash": "123456789", "files": {"foo": [], "bar": []}, }, } fix_lock_data(lock_data) if lock_version == "2.1": lock_data["package"][0]["markers"] = "python_version < '3.9'" lock_data["package"][1]["markers"] = "python_version >= '3.9'" lock_data["package"][2]["markers"] = "python_version < '3.9'" lock_data["package"][3]["markers"] = "python_version >= '3.9'" poetry.locker.mock_lock_data(lock_data) # type: ignore[attr-defined] poetry.package.python_versions = "^3.8" poetry.package.add_dependency( Factory.create_dependency( name="foo", constraint={"version": ">=0", "python": "<3.9"} ) ) poetry.package.add_dependency( Factory.create_dependency( name="foo", constraint={"version": ">=1", "python": ">=3.9"} ) ) poetry.package.add_dependency( Factory.create_dependency( name="bar", constraint={"version": "1", "python": "<3.9"} ) ) poetry.package.add_dependency( Factory.create_dependency( name="bar", constraint={"version": "2", "python": ">=3.9"} ) ) exporter = Exporter(poetry, NullIO()) if lock_version == "1.1": with pytest.raises(DependencyWalkerError): exporter.export("requirements.txt", tmp_path, "requirements.txt") return exporter.export("requirements.txt", tmp_path, "requirements.txt") with (tmp_path / "requirements.txt").open(encoding="utf-8") as f: content = f.read() expected = """\ bar==1 ; python_version >= "3.8" and python_version < "3.9" bar==2 ; python_version >= "3.9" and python_version < "4.0" foo==1 ; python_version >= "3.8" and python_version < "3.9" foo==2 ; python_version >= "3.9" and python_version < "4.0" """ > assert content == expected E assert 'bar==1 ; pyt...ion < "4.0"\n' == 'bar==1 ; pyt...ion < "4.0"\n' E E - bar==1 ; python_version >= "3.8" and python_version < "3.9" E + bar==1 ; python_version == "3.8" E bar==2 ; python_version >= "3.9" and python_version < "4.0" E - foo==1 ; python_version >= "3.8" and python_version < "3.9" E + foo==1 ; python_version == "3.8" E foo==2 ; python_version >= "3.9" and python_version < "4.0" tests/test_exporter.py:3281: AssertionError ------------------------------ Captured log setup ------------------------------ WARNING poetry.core.factory:factory.py:63 The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead. =========================== short test summary info ============================ FAILED tests/command/test_command_export.py::test_export_exports_requirements_txt_file_locks_if_no_lock_file FAILED tests/command/test_command_export.py::test_export_exports_requirements_txt_uses_lock_file FAILED tests/command/test_command_export.py::test_export_prints_to_stdout_by_default FAILED tests/command/test_command_export.py::test_export_uses_requirements_txt_format_by_default FAILED tests/command/test_command_export.py::test_export_groups[-foo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n] FAILED tests/command/test_command_export.py::test_export_groups[--with dev-baz==2.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\nfoo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n] FAILED tests/command/test_command_export.py::test_export_groups[--with opt-foo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\nopt==2.2.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n] FAILED tests/command/test_command_export.py::test_export_groups[--with dev,opt-baz==2.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\nfoo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\nopt==2.2.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n] FAILED tests/command/test_command_export.py::test_export_groups[--without dev-foo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n] FAILED tests/command/test_command_export.py::test_export_groups[--without opt-foo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n] FAILED tests/command/test_command_export.py::test_export_groups[--only main-foo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n] FAILED tests/command/test_command_export.py::test_export_groups[--only dev-baz==2.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n] FAILED tests/command/test_command_export.py::test_export_groups[--only main,dev-baz==2.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\nfoo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n] FAILED tests/command/test_command_export.py::test_export_includes_extras_by_flag[feature_bar-bar==1.1.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\nfoo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n] FAILED tests/command/test_command_export.py::test_export_includes_extras_by_flag[feature_bar feature_qux-bar==1.1.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\nfoo==1.0.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\nqux==1.2.0 ; python_version >= "3.6" and python_version < "4.0" or python_version == "2.7"\n] FAILED tests/command/test_command_export.py::test_export_with_all_extras - as... FAILED tests/command/test_command_export.py::test_export_with_all_groups - as... FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_standard_packages[1.1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_standard_packages[2.1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_standard_packages_and_markers[1.1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_standard_packages_and_markers[2.1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_poetry[1.1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_poetry[2.1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_pyinstaller[1.1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_pyinstaller[2.1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_nested_packages_and_markers_any[1.1-False-lines0] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_nested_packages_and_markers_any[1.1-True-lines1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_nested_packages_and_markers_any[2.1-False-lines0] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_nested_packages_and_markers_any[2.1-True-lines1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_standard_packages_and_hashes[1.1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_standard_packages_and_hashes[2.1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_standard_packages_and_sorted_hashes[1.1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_standard_packages_and_sorted_hashes[2.1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_standard_packages_and_hashes_disabled[1.1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_standard_packages_and_hashes_disabled[2.1] FAILED tests/test_exporter.py::test_exporter_exports_requirements_txt_without_dev_packages_by_default[1.1] FAILED tests/test_exporter.py::test_exporter_exports_requirements_txt_without_dev_packages_by_default[2.1] FAILED tests/test_exporter.py::test_exporter_exports_requirements_txt_with_dev_packages_if_opted_in[1.1] FAILED tests/test_exporter.py::test_exporter_exports_requirements_txt_with_dev_packages_if_opted_in[2.1] FAILED tests/test_exporter.py::test_exporter_exports_requirements_txt_without_optional_packages[1.1] FAILED tests/test_exporter.py::test_exporter_exports_requirements_txt_without_optional_packages[2.1] FAILED tests/test_exporter.py::test_exporter_exports_requirements_txt_with_optional_packages[1.1-extras0-lines0] FAILED tests/test_exporter.py::test_exporter_exports_requirements_txt_with_optional_packages[2.1-extras0-lines0] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_git_packages[1.1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_git_packages[2.1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_nested_packages[1.1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_nested_packages[2.1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_nested_packages_cyclic[1.1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_nested_packages_cyclic[2.1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_circular_root_dependency[1.1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_circular_root_dependency[2.1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_nested_packages_and_multiple_markers[1.1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_nested_packages_and_multiple_markers[2.1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_directory_packages[1.1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_directory_packages[2.1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_directory_packages_editable[1.1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_directory_packages_editable[2.1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_nested_directory_packages[1.1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_nested_directory_packages[2.1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_file_packages[1.1] FAILED tests/test_exporter.py::test_exporter_can_export_requirements_txt_with_file_packages[2.1] FAILED tests/test_exporter.py::test_exporter_exports_requirements_txt_with_legacy_packages[1.1] FAILED tests/test_exporter.py::test_exporter_exports_requirements_txt_with_legacy_packages[2.1] FAILED tests/test_exporter.py::test_exporter_exports_requirements_txt_with_url_false[1.1] FAILED tests/test_exporter.py::test_exporter_exports_requirements_txt_with_url_false[2.1] FAILED tests/test_exporter.py::test_exporter_exports_requirements_txt_with_legacy_packages_trusted_host[1.1] FAILED tests/test_exporter.py::test_exporter_exports_requirements_txt_with_legacy_packages_trusted_host[2.1] FAILED tests/test_exporter.py::test_exporter_exports_requirements_txt_with_dev_extras[1.1-True-expected0] FAILED tests/test_exporter.py::test_exporter_exports_requirements_txt_with_dev_extras[1.1-False-expected1] FAILED tests/test_exporter.py::test_exporter_exports_requirements_txt_with_dev_extras[2.1-True-expected0] FAILED tests/test_exporter.py::test_exporter_exports_requirements_txt_with_dev_extras[2.1-False-expected1] FAILED tests/test_exporter.py::test_exporter_exports_requirements_txt_with_legacy_packages_and_duplicate_sources[1.1] FAILED tests/test_exporter.py::test_exporter_exports_requirements_txt_with_legacy_packages_and_duplicate_sources[2.1] FAILED tests/test_exporter.py::test_exporter_exports_requirements_txt_with_two_primary_sources[1.1] FAILED tests/test_exporter.py::test_exporter_exports_requirements_txt_with_two_primary_sources[2.1] FAILED tests/test_exporter.py::test_exporter_exports_requirements_txt_with_legacy_packages_and_credentials[1.1] FAILED tests/test_exporter.py::test_exporter_exports_requirements_txt_with_legacy_packages_and_credentials[2.1] FAILED tests/test_exporter.py::test_exporter_exports_requirements_txt_to_standard_output[1.1] FAILED tests/test_exporter.py::test_exporter_exports_requirements_txt_to_standard_output[2.1] FAILED tests/test_exporter.py::test_exporter_doesnt_confuse_repeated_packages[1.1] FAILED tests/test_exporter.py::test_exporter_omits_and_includes_extras_for_txt_formats[1.1-constraints.txt-expected0] FAILED tests/test_exporter.py::test_exporter_omits_and_includes_extras_for_txt_formats[1.1-requirements.txt-expected1] FAILED tests/test_exporter.py::test_exporter_omits_and_includes_extras_for_txt_formats[2.1-constraints.txt-expected0] FAILED tests/test_exporter.py::test_exporter_omits_and_includes_extras_for_txt_formats[2.1-requirements.txt-expected1] FAILED tests/test_exporter.py::test_exporter_prints_warning_for_constraints_txt_with_editable_packages[1.1] FAILED tests/test_exporter.py::test_exporter_prints_warning_for_constraints_txt_with_editable_packages[2.1] FAILED tests/test_exporter.py::test_exporter_exports_extra_index_url_and_trusted_host[1.1] FAILED tests/test_exporter.py::test_exporter_exports_extra_index_url_and_trusted_host[2.1] FAILED tests/test_exporter.py::test_exporter_index_urls[1.1-priorities0-expected0] FAILED tests/test_exporter.py::test_exporter_index_urls[1.1-priorities1-expected1] FAILED tests/test_exporter.py::test_exporter_index_urls[1.1-priorities2-expected2] FAILED tests/test_exporter.py::test_exporter_index_urls[1.1-priorities3-expected3] FAILED tests/test_exporter.py::test_exporter_index_urls[1.1-priorities4-expected4] FAILED tests/test_exporter.py::test_exporter_index_urls[1.1-priorities5-expected5] FAILED tests/test_exporter.py::test_exporter_index_urls[1.1-priorities6-expected6] FAILED tests/test_exporter.py::test_exporter_index_urls[2.1-priorities0-expected0] FAILED tests/test_exporter.py::test_exporter_index_urls[2.1-priorities1-expected1] FAILED tests/test_exporter.py::test_exporter_index_urls[2.1-priorities2-expected2] FAILED tests/test_exporter.py::test_exporter_index_urls[2.1-priorities3-expected3] FAILED tests/test_exporter.py::test_exporter_index_urls[2.1-priorities4-expected4] FAILED tests/test_exporter.py::test_exporter_index_urls[2.1-priorities5-expected5] FAILED tests/test_exporter.py::test_exporter_index_urls[2.1-priorities6-expected6] FAILED tests/test_exporter.py::test_dependency_walk_error[2.1] - assert 'bar=... ======================= 103 failed, 38 passed in 29.46s ======================== >>> ERROR: py3-poetry-plugin-export: check failed >>> py3-poetry-plugin-export: Uninstalling dependencies... ( 1/109) Purging .makedepends-py3-poetry-plugin-export (20251025.224026) ( 2/109) Purging poetry-pyc (2.1.4-r0) ( 3/109) Purging poetry (2.1.4-r0) ( 4/109) Purging py3-build-pyc (1.3.0-r1) ( 5/109) Purging py3-build (1.3.0-r1) ( 6/109) Purging py3-cachecontrol-pyc (0.14.3-r0) ( 7/109) Purging py3-cachecontrol (0.14.3-r0) ( 8/109) Purging py3-msgpack-pyc (1.0.8-r1) ( 9/109) Purging py3-msgpack (1.0.8-r1) ( 10/109) Purging py3-cleo-pyc (2.2.1-r0) ( 11/109) Purging py3-cleo (2.2.1-r0) ( 12/109) Purging py3-crashtest-pyc (0.4.1-r5) ( 13/109) Purging py3-crashtest (0.4.1-r5) ( 14/109) Purging py3-rapidfuzz-pyc (3.14.1-r0) ( 15/109) Purging py3-rapidfuzz (3.14.1-r0) ( 16/109) Purging py3-dulwich-pyc (0.22.8-r0) ( 17/109) Purging py3-dulwich (0.22.8-r0) ( 18/109) Purging py3-keyring-pyc (24.3.1-r2) ( 19/109) Purging py3-keyring (24.3.1-r2) ( 20/109) Purging py3-importlib-metadata-pyc (8.7.0-r0) ( 21/109) Purging py3-importlib-metadata (8.7.0-r0) ( 22/109) Purging py3-zipp-pyc (3.23.0-r0) ( 23/109) Purging py3-zipp (3.23.0-r0) ( 24/109) Purging py3-jaraco.classes-pyc (3.4.0-r1) ( 25/109) Purging py3-jaraco.classes (3.4.0-r1) ( 26/109) Purging py3-more-itertools-pyc (10.8.0-r0) ( 27/109) Purging py3-more-itertools (10.8.0-r0) ( 28/109) Purging py3-secretstorage-pyc (3.4.0-r0) ( 29/109) Purging py3-secretstorage (3.4.0-r0) ( 30/109) Purging py3-cryptography-pyc (46.0.2-r0) ( 31/109) Purging py3-cryptography (46.0.2-r0) ( 32/109) Purging py3-cffi-pyc (1.17.1-r1) ( 33/109) Purging py3-cffi (1.17.1-r1) ( 34/109) Purging py3-cparser-pyc (2.22-r1) ( 35/109) Purging py3-cparser (2.22-r1) ( 36/109) Purging py3-jeepney-pyc (0.9.0-r0) ( 37/109) Purging py3-jeepney (0.9.0-r0) ( 38/109) Purging py3-pkginfo-pyc (1.12.1.2-r0) ( 39/109) Purging py3-pkginfo (1.12.1.2-r0) ( 40/109) Purging py3-pyproject-hooks-pyc (1.2.0-r0) ( 41/109) Purging py3-pyproject-hooks (1.2.0-r0) ( 42/109) Purging py3-requests-toolbelt-pyc (1.0.0-r1) ( 43/109) Purging py3-requests-toolbelt (1.0.0-r1) ( 44/109) Purging py3-requests-pyc (2.32.5-r0) ( 45/109) Purging py3-requests (2.32.5-r0) ( 46/109) Purging py3-certifi-pyc (2025.10.5-r0) ( 47/109) Purging py3-certifi (2025.10.5-r0) ( 48/109) Purging py3-charset-normalizer-pyc (3.4.4-r0) ( 49/109) Purging py3-charset-normalizer (3.4.4-r0) ( 50/109) Purging py3-idna-pyc (3.10-r0) ( 51/109) Purging py3-idna (3.10-r0) ( 52/109) Purging py3-urllib3-pyc (1.26.20-r0) ( 53/109) Purging py3-urllib3 (1.26.20-r0) ( 54/109) Purging py3-shellingham-pyc (1.5.4-r1) ( 55/109) Purging py3-shellingham (1.5.4-r1) ( 56/109) Purging py3-tomlkit-pyc (0.13.3-r0) ( 57/109) Purging py3-tomlkit (0.13.3-r0) ( 58/109) Purging py3-trove-classifiers-pyc (2025.9.11.17-r0) ( 59/109) Purging py3-trove-classifiers (2025.9.11.17-r0) ( 60/109) Purging py3-virtualenv-pyc (20.32.0-r0) ( 61/109) Purging py3-virtualenv (20.32.0-r0) ( 62/109) Purging py3-distlib-pyc (0.4.0-r0) ( 63/109) Purging py3-distlib (0.4.0-r0) ( 64/109) Purging py3-filelock-pyc (3.18.0-r0) ( 65/109) Purging py3-filelock (3.18.0-r0) ( 66/109) Purging py3-findpython (0.7.0-r1) ( 67/109) Purging py3-platformdirs-pyc (4.5.0-r0) ( 68/109) Purging py3-platformdirs (4.5.0-r0) ( 69/109) Purging py3-pbs-installer-pyc (2025.10.14-r0) ( 70/109) Purging py3-pbs-installer (2025.10.14-r0) ( 71/109) Purging py3-gpep517-pyc (19-r0) ( 72/109) Purging py3-gpep517 (19-r0) ( 73/109) Purging py3-installer-pyc (0.7.0-r2) ( 74/109) Purging py3-installer (0.7.0-r2) ( 75/109) Purging py3-poetry-core-pyc (2.1.3-r0) ( 76/109) Purging py3-poetry-core (2.1.3-r0) ( 77/109) Purging py3-fastjsonschema-pyc (2.21.2-r0) ( 78/109) Purging py3-fastjsonschema (2.21.2-r0) ( 79/109) Purging py3-lark-parser-pyc (1.2.2-r0) ( 80/109) Purging py3-lark-parser (1.2.2-r0) ( 81/109) Purging py3-pytest-mock-pyc (3.10.0-r4) ( 82/109) Purging py3-pytest-mock (3.10.0-r4) ( 83/109) Purging py3-mock-pyc (5.2.0-r0) ( 84/109) Purging py3-mock (5.2.0-r0) ( 85/109) Purging py3-pytest-pyc (8.4.2-r1) ( 86/109) Purging py3-pytest (8.4.2-r1) ( 87/109) Purging py3-iniconfig-pyc (2.3.0-r0) ( 88/109) Purging py3-iniconfig (2.3.0-r0) ( 89/109) Purging py3-packaging-pyc (25.0-r0) ( 90/109) Purging py3-packaging (25.0-r0) ( 91/109) Purging py3-parsing-pyc (3.2.3-r0) ( 92/109) Purging py3-parsing (3.2.3-r0) ( 93/109) Purging py3-pluggy-pyc (1.6.0-r0) ( 94/109) Purging py3-pluggy (1.6.0-r0) ( 95/109) Purging py3-py-pyc (1.11.0-r4) ( 96/109) Purging py3-py (1.11.0-r4) ( 97/109) Purging py3-pygments-pyc (2.19.2-r0) ( 98/109) Purging py3-pygments (2.19.2-r0) ( 99/109) Purging python3-pyc (3.12.12-r0) (100/109) Purging python3-pycache-pyc0 (3.12.12-r0) (101/109) Purging pyc (3.12.12-r0) (102/109) Purging python3 (3.12.12-r0) (103/109) Purging gdbm (1.26-r0) (104/109) Purging libbz2 (1.0.8-r6) (105/109) Purging libffi (3.5.2-r0) (106/109) Purging libpanelw (6.5_p20251010-r0) (107/109) Purging mpdecimal (4.0.1-r0) (108/109) Purging sqlite-libs (3.50.4-r1) (109/109) Purging xz-libs (5.8.1-r0) busybox-1.37.0-r24.trigger: Executing script... OK: 426 MiB in 105 packages