Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.15.0: pytest is failing #1084

Closed
kloczek opened this issue May 16, 2022 · 18 comments · Fixed by #1109
Closed

1.15.0: pytest is failing #1084

kloczek opened this issue May 16, 2022 · 18 comments · Fixed by #1109
Labels
🐛 bug Something isn't working

Comments

@kloczek
Copy link

kloczek commented May 16, 2022

I'm trying to package your module as an rpm package. So I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

  • python3 -sBm build -w --no-isolation
  • because I'm calling build with --no-isolation I'm using during all processes only locally installed modules
  • install .whl file in </install/prefix>
  • run pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>
@kloczek kloczek added the 🐛 bug Something isn't working label May 16, 2022
@kloczek
Copy link
Author

kloczek commented May 16, 2022

Here is pytest output:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pdm-1.15.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pdm-1.15.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/pdm-1.15.0, configfile: pyproject.toml
plugins: mock-3.7.0
collected 388 items

tests/test_formats.py ...........                                                                                                                                    [  2%]
tests/test_installer.py FFFFFFFFFF.                                                                                                                                  [  5%]
tests/test_integration.py FFF.FF                                                                                                                                     [  7%]
tests/test_plugin.py ....                                                                                                                                            [  8%]
tests/test_project.py .............F                                                                                                                                 [ 11%]
tests/test_signals.py ..                                                                                                                                             [ 12%]
tests/test_utils.py ...............................                                                                                                                  [ 20%]
tests/cli/test_add.py ..........FF..........F..                                                                                                                      [ 26%]
tests/cli/test_build.py ..FFFFFFFF.FF                                                                                                                                [ 30%]
tests/cli/test_cache.py .......FF.F.                                                                                                                                 [ 33%]
tests/cli/test_config.py .........                                                                                                                                   [ 35%]
tests/cli/test_install.py ...........F.....                                                                                                                          [ 39%]
tests/cli/test_list.py ............                                                                                                                                  [ 43%]
tests/cli/test_lock.py .....                                                                                                                                         [ 44%]
tests/cli/test_others.py .....................F.                                                                                                                     [ 50%]
tests/cli/test_plugin.py ...                                                                                                                                         [ 51%]
tests/cli/test_remove.py ..........                                                                                                                                  [ 53%]
tests/cli/test_run.py F............F..F.....                                                                                                                         [ 59%]
tests/cli/test_update.py ...........                                                                                                                                 [ 62%]
tests/cli/test_use.py .....                                                                                                                                          [ 63%]
tests/models/test_candidates.py ....FFFFFFFF...........F.F...                                                                                                        [ 70%]
tests/models/test_marker.py ........                                                                                                                                 [ 72%]
tests/models/test_requirements.py ..................                                                                                                                 [ 77%]
tests/models/test_specifiers.py .......................................                                                                                              [ 87%]
tests/models/test_versions.py ..................                                                                                                                     [ 92%]
tests/resolver/test_resolve.py ....FF........................                                                                                                        [100%]

================================================================================= FAILURES =================================================================================
______________________________________________________________ test_install_wheel_with_inconsistent_dist_info ______________________________________________________________

project = <Project '/tmp/pytest-of-tkloczko/pytest-109/test_install_wheel_with_incons0'>

    def test_install_wheel_with_inconsistent_dist_info(project):
        req = parse_requirement("pyfunctional")
        candidate = Candidate(
            req,
            link=Link("http://fixtures.test/artifacts/PyFunctional-1.4.3-py3-none-any.whl"),
        )
        installer = InstallManager(project.environment)
>       installer.install(candidate)

tests/test_installer.py:23:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/installers/manager.py:39: in install
    installer(prepared.build(), self.environment, prepared.direct_url())
pdm/installers/installers.py:185: in install_wheel
    _install_wheel(
pdm/installers/installers.py:274: in _install_wheel
    with WheelFile.open(wheel) as source:
/usr/lib64/python3.8/contextlib.py:113: in __enter__
    return next(self.gen)
/usr/lib/python3.8/site-packages/installer/sources.py:122: in open
    with zipfile.ZipFile(path) as f:
/usr/lib64/python3.8/zipfile.py:1269: in __init__
    self._RealGetContents()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <zipfile.ZipFile [closed]>

    def _RealGetContents(self):
        """Read in the table of contents for the ZIP file."""
        fp = self.fp
        try:
            endrec = _EndRecData(fp)
        except OSError:
            raise BadZipFile("File is not a zip file")
        if not endrec:
>           raise BadZipFile("File is not a zip file")
E           zipfile.BadZipFile: File is not a zip file

/usr/lib64/python3.8/zipfile.py:1336: BadZipFile
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
Changes are written to pyproject.toml.
_____________________________________________________________________ test_install_with_file_existing ______________________________________________________________________

project = <Project '/tmp/pytest-of-tkloczko/pytest-109/test_install_with_file_existin0'>

    def test_install_with_file_existing(project):
        req = parse_requirement("demo")
        candidate = Candidate(
            req,
            link=Link("http://fixtures.test/artifacts/demo-0.0.1-py2.py3-none-any.whl"),
        )
        (project.environment.packages_path / "lib/demo.py").touch()
        installer = InstallManager(project.environment)
>       installer.install(candidate)

tests/test_installer.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/installers/manager.py:39: in install
    installer(prepared.build(), self.environment, prepared.direct_url())
pdm/installers/installers.py:185: in install_wheel
    _install_wheel(
pdm/installers/installers.py:274: in _install_wheel
    with WheelFile.open(wheel) as source:
/usr/lib64/python3.8/contextlib.py:113: in __enter__
    return next(self.gen)
/usr/lib/python3.8/site-packages/installer/sources.py:122: in open
    with zipfile.ZipFile(path) as f:
/usr/lib64/python3.8/zipfile.py:1269: in __init__
    self._RealGetContents()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <zipfile.ZipFile [closed]>

    def _RealGetContents(self):
        """Read in the table of contents for the ZIP file."""
        fp = self.fp
        try:
            endrec = _EndRecData(fp)
        except OSError:
            raise BadZipFile("File is not a zip file")
        if not endrec:
>           raise BadZipFile("File is not a zip file")
E           zipfile.BadZipFile: File is not a zip file

/usr/lib64/python3.8/zipfile.py:1336: BadZipFile
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
Changes are written to pyproject.toml.
______________________________________________________________________ test_uninstall_commit_rollback ______________________________________________________________________

project = <Project '/tmp/pytest-of-tkloczko/pytest-109/test_uninstall_commit_rollback0'>

    def test_uninstall_commit_rollback(project):
        req = parse_requirement("demo")
        candidate = Candidate(
            req,
            link=Link("http://fixtures.test/artifacts/demo-0.0.1-py2.py3-none-any.whl"),
        )
        installer = InstallManager(project.environment)
        lib_path = project.environment.get_paths()["purelib"]
>       installer.install(candidate)

tests/test_installer.py:46:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/installers/manager.py:39: in install
    installer(prepared.build(), self.environment, prepared.direct_url())
pdm/installers/installers.py:185: in install_wheel
    _install_wheel(
pdm/installers/installers.py:274: in _install_wheel
    with WheelFile.open(wheel) as source:
/usr/lib64/python3.8/contextlib.py:113: in __enter__
    return next(self.gen)
/usr/lib/python3.8/site-packages/installer/sources.py:122: in open
    with zipfile.ZipFile(path) as f:
/usr/lib64/python3.8/zipfile.py:1269: in __init__
    self._RealGetContents()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <zipfile.ZipFile [closed]>

    def _RealGetContents(self):
        """Read in the table of contents for the ZIP file."""
        fp = self.fp
        try:
            endrec = _EndRecData(fp)
        except OSError:
            raise BadZipFile("File is not a zip file")
        if not endrec:
>           raise BadZipFile("File is not a zip file")
E           zipfile.BadZipFile: File is not a zip file

/usr/lib64/python3.8/zipfile.py:1336: BadZipFile
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
Changes are written to pyproject.toml.
________________________________________________________________________ test_rollback_after_commit ________________________________________________________________________

project = <Project '/tmp/pytest-of-tkloczko/pytest-109/test_rollback_after_commit0'>, caplog = <_pytest.logging.LogCaptureFixture object at 0x7f06fc388b20>

    def test_rollback_after_commit(project, caplog):
        caplog.set_level(logging.ERROR, logger="pdm.termui")
        req = parse_requirement("demo")
        candidate = Candidate(
            req,
            link=Link("http://fixtures.test/artifacts/demo-0.0.1-py2.py3-none-any.whl"),
        )
        installer = InstallManager(project.environment)
        lib_path = project.environment.get_paths()["purelib"]
>       installer.install(candidate)

tests/test_installer.py:67:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/installers/manager.py:39: in install
    installer(prepared.build(), self.environment, prepared.direct_url())
pdm/installers/installers.py:185: in install_wheel
    _install_wheel(
pdm/installers/installers.py:274: in _install_wheel
    with WheelFile.open(wheel) as source:
/usr/lib64/python3.8/contextlib.py:113: in __enter__
    return next(self.gen)
/usr/lib/python3.8/site-packages/installer/sources.py:122: in open
    with zipfile.ZipFile(path) as f:
/usr/lib64/python3.8/zipfile.py:1269: in __init__
    self._RealGetContents()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <zipfile.ZipFile [closed]>

    def _RealGetContents(self):
        """Read in the table of contents for the ZIP file."""
        fp = self.fp
        try:
            endrec = _EndRecData(fp)
        except OSError:
            raise BadZipFile("File is not a zip file")
        if not endrec:
>           raise BadZipFile("File is not a zip file")
E           zipfile.BadZipFile: File is not a zip file

/usr/lib64/python3.8/zipfile.py:1336: BadZipFile
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
Changes are written to pyproject.toml.
________________________________________________________________ test_uninstall_with_console_scripts[False] ________________________________________________________________

project = <Project '/tmp/pytest-of-tkloczko/pytest-109/test_uninstall_with_console_sc0'>, use_install_cache = False

    @pytest.mark.parametrize("use_install_cache", [False, True])
    def test_uninstall_with_console_scripts(project, use_install_cache):
        req = parse_requirement("celery")
        candidate = Candidate(
            req,
            link=Link("http://fixtures.test/artifacts/celery-4.4.2-py2.py3-none-any.whl"),
        )
        installer = InstallManager(project.environment, use_install_cache=use_install_cache)
>       installer.install(candidate)

tests/test_installer.py:94:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/installers/manager.py:39: in install
    installer(prepared.build(), self.environment, prepared.direct_url())
pdm/installers/installers.py:185: in install_wheel
    _install_wheel(
pdm/installers/installers.py:274: in _install_wheel
    with WheelFile.open(wheel) as source:
/usr/lib64/python3.8/contextlib.py:113: in __enter__
    return next(self.gen)
/usr/lib/python3.8/site-packages/installer/sources.py:122: in open
    with zipfile.ZipFile(path) as f:
/usr/lib64/python3.8/zipfile.py:1269: in __init__
    self._RealGetContents()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <zipfile.ZipFile [closed]>

    def _RealGetContents(self):
        """Read in the table of contents for the ZIP file."""
        fp = self.fp
        try:
            endrec = _EndRecData(fp)
        except OSError:
            raise BadZipFile("File is not a zip file")
        if not endrec:
>           raise BadZipFile("File is not a zip file")
E           zipfile.BadZipFile: File is not a zip file

/usr/lib64/python3.8/zipfile.py:1336: BadZipFile
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
Changes are written to pyproject.toml.
________________________________________________________________ test_uninstall_with_console_scripts[True] _________________________________________________________________

project = <Project '/tmp/pytest-of-tkloczko/pytest-109/test_uninstall_with_console_sc1'>, use_install_cache = True

    @pytest.mark.parametrize("use_install_cache", [False, True])
    def test_uninstall_with_console_scripts(project, use_install_cache):
        req = parse_requirement("celery")
        candidate = Candidate(
            req,
            link=Link("http://fixtures.test/artifacts/celery-4.4.2-py2.py3-none-any.whl"),
        )
        installer = InstallManager(project.environment, use_install_cache=use_install_cache)
>       installer.install(candidate)

tests/test_installer.py:94:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/installers/manager.py:39: in install
    installer(prepared.build(), self.environment, prepared.direct_url())
pdm/installers/installers.py:213: in install_wheel_with_cache
    _install_wheel(wheel=wheel, destination=destination)
pdm/installers/installers.py:274: in _install_wheel
    with WheelFile.open(wheel) as source:
/usr/lib64/python3.8/contextlib.py:113: in __enter__
    return next(self.gen)
/usr/lib/python3.8/site-packages/installer/sources.py:122: in open
    with zipfile.ZipFile(path) as f:
/usr/lib64/python3.8/zipfile.py:1269: in __init__
    self._RealGetContents()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <zipfile.ZipFile [closed]>

    def _RealGetContents(self):
        """Read in the table of contents for the ZIP file."""
        fp = self.fp
        try:
            endrec = _EndRecData(fp)
        except OSError:
            raise BadZipFile("File is not a zip file")
        if not endrec:
>           raise BadZipFile("File is not a zip file")
E           zipfile.BadZipFile: File is not a zip file

/usr/lib64/python3.8/zipfile.py:1336: BadZipFile
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
Changes are written to pyproject.toml.
---------------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------------
DEBUG    pdm.termui:installers.py:206 Installing wheel into cached location /tmp/pytest-of-tkloczko/pytest-109/test_uninstall_with_console_sc1/caches/packages/celery-4.4.2-py2.py3-none-any
______________________________________________________________________ test_install_wheel_with_cache _______________________________________________________________________

project = <Project '/tmp/pytest-of-tkloczko/pytest-109/test_install_wheel_with_cache0'>, invoke = <function invoke.<locals>.caller at 0x7f06fba368b0>

    def test_install_wheel_with_cache(project, invoke):
        supports_symlink = fs_supports_symlink()
        req = parse_requirement("future-fstrings")
        candidate = Candidate(
            req,
            link=Link(
                "http://fixtures.test/artifacts/future_fstrings-1.2.0-py2.py3-none-any.whl"
            ),
        )
        installer = InstallManager(project.environment, use_install_cache=True)
>       installer.install(candidate)

tests/test_installer.py:114:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/installers/manager.py:39: in install
    installer(prepared.build(), self.environment, prepared.direct_url())
pdm/installers/installers.py:213: in install_wheel_with_cache
    _install_wheel(wheel=wheel, destination=destination)
pdm/installers/installers.py:274: in _install_wheel
    with WheelFile.open(wheel) as source:
/usr/lib64/python3.8/contextlib.py:113: in __enter__
    return next(self.gen)
/usr/lib/python3.8/site-packages/installer/sources.py:122: in open
    with zipfile.ZipFile(path) as f:
/usr/lib64/python3.8/zipfile.py:1269: in __init__
    self._RealGetContents()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <zipfile.ZipFile [closed]>

    def _RealGetContents(self):
        """Read in the table of contents for the ZIP file."""
        fp = self.fp
        try:
            endrec = _EndRecData(fp)
        except OSError:
            raise BadZipFile("File is not a zip file")
        if not endrec:
>           raise BadZipFile("File is not a zip file")
E           zipfile.BadZipFile: File is not a zip file

/usr/lib64/python3.8/zipfile.py:1336: BadZipFile
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
Changes are written to pyproject.toml.
---------------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------------
DEBUG    pdm.termui:installers.py:206 Installing wheel into cached location /tmp/pytest-of-tkloczko/pytest-109/test_install_wheel_with_cache0/caches/packages/future_fstrings-1.2.0-py2.py3-none-any
____________________________________________________________________ test_url_requirement_is_not_cached ____________________________________________________________________

project = <Project '/tmp/pytest-of-tkloczko/pytest-109/test_url_requirement_is_not_ca0'>

    def test_url_requirement_is_not_cached(project):
        req = parse_requirement(
            "future-fstrings @ http://fixtures.test/artifacts/"
            "future_fstrings-1.2.0-py2.py3-none-any.whl"
        )
        candidate = Candidate(req)
        installer = InstallManager(project.environment, use_install_cache=True)
>       installer.install(candidate)

tests/test_installer.py:148:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/installers/manager.py:39: in install
    installer(prepared.build(), self.environment, prepared.direct_url())
pdm/installers/installers.py:185: in install_wheel
    _install_wheel(
pdm/installers/installers.py:274: in _install_wheel
    with WheelFile.open(wheel) as source:
/usr/lib64/python3.8/contextlib.py:113: in __enter__
    return next(self.gen)
/usr/lib/python3.8/site-packages/installer/sources.py:122: in open
    with zipfile.ZipFile(path) as f:
/usr/lib64/python3.8/zipfile.py:1269: in __init__
    self._RealGetContents()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <zipfile.ZipFile [closed]>

    def _RealGetContents(self):
        """Read in the table of contents for the ZIP file."""
        fp = self.fp
        try:
            endrec = _EndRecData(fp)
        except OSError:
            raise BadZipFile("File is not a zip file")
        if not endrec:
>           raise BadZipFile("File is not a zip file")
E           zipfile.BadZipFile: File is not a zip file

/usr/lib64/python3.8/zipfile.py:1336: BadZipFile
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
Changes are written to pyproject.toml.
_______________________________________________________________ test_install_wheel_with_data_scripts[False] ________________________________________________________________

project = <Project '/tmp/pytest-of-tkloczko/pytest-109/test_install_wheel_with_data_s0'>, use_install_cache = False

    @pytest.mark.parametrize("use_install_cache", [False, True])
    def test_install_wheel_with_data_scripts(project, use_install_cache):
        req = parse_requirement("jmespath")
        candidate = Candidate(
            req,
            link=Link(
                "http://fixtures.test/artifacts/jmespath-0.10.0-py2.py3-none-any.whl"
            ),
        )
        installer = InstallManager(project.environment, use_install_cache=use_install_cache)
>       installer.install(candidate)

tests/test_installer.py:168:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/installers/manager.py:39: in install
    installer(prepared.build(), self.environment, prepared.direct_url())
pdm/installers/installers.py:185: in install_wheel
    _install_wheel(
pdm/installers/installers.py:274: in _install_wheel
    with WheelFile.open(wheel) as source:
/usr/lib64/python3.8/contextlib.py:113: in __enter__
    return next(self.gen)
/usr/lib/python3.8/site-packages/installer/sources.py:122: in open
    with zipfile.ZipFile(path) as f:
/usr/lib64/python3.8/zipfile.py:1269: in __init__
    self._RealGetContents()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <zipfile.ZipFile [closed]>

    def _RealGetContents(self):
        """Read in the table of contents for the ZIP file."""
        fp = self.fp
        try:
            endrec = _EndRecData(fp)
        except OSError:
            raise BadZipFile("File is not a zip file")
        if not endrec:
>           raise BadZipFile("File is not a zip file")
E           zipfile.BadZipFile: File is not a zip file

/usr/lib64/python3.8/zipfile.py:1336: BadZipFile
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
Changes are written to pyproject.toml.
________________________________________________________________ test_install_wheel_with_data_scripts[True] ________________________________________________________________

project = <Project '/tmp/pytest-of-tkloczko/pytest-109/test_install_wheel_with_data_s1'>, use_install_cache = True

    @pytest.mark.parametrize("use_install_cache", [False, True])
    def test_install_wheel_with_data_scripts(project, use_install_cache):
        req = parse_requirement("jmespath")
        candidate = Candidate(
            req,
            link=Link(
                "http://fixtures.test/artifacts/jmespath-0.10.0-py2.py3-none-any.whl"
            ),
        )
        installer = InstallManager(project.environment, use_install_cache=use_install_cache)
>       installer.install(candidate)

tests/test_installer.py:168:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/installers/manager.py:39: in install
    installer(prepared.build(), self.environment, prepared.direct_url())
pdm/installers/installers.py:213: in install_wheel_with_cache
    _install_wheel(wheel=wheel, destination=destination)
pdm/installers/installers.py:274: in _install_wheel
    with WheelFile.open(wheel) as source:
/usr/lib64/python3.8/contextlib.py:113: in __enter__
    return next(self.gen)
/usr/lib/python3.8/site-packages/installer/sources.py:122: in open
    with zipfile.ZipFile(path) as f:
/usr/lib64/python3.8/zipfile.py:1269: in __init__
    self._RealGetContents()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <zipfile.ZipFile [closed]>

    def _RealGetContents(self):
        """Read in the table of contents for the ZIP file."""
        fp = self.fp
        try:
            endrec = _EndRecData(fp)
        except OSError:
            raise BadZipFile("File is not a zip file")
        if not endrec:
>           raise BadZipFile("File is not a zip file")
E           zipfile.BadZipFile: File is not a zip file

/usr/lib64/python3.8/zipfile.py:1336: BadZipFile
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
Changes are written to pyproject.toml.
---------------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------------
DEBUG    pdm.termui:installers.py:206 Installing wheel into cached location /tmp/pytest-of-tkloczko/pytest-109/test_install_wheel_with_data_s1/caches/packages/jmespath-0.10.0-py2.py3-none-any
_______________________________________________________________________ test_basic_integration[2.7] ________________________________________________________________________

python_version = '2.7', core = <pdm.core.Core object at 0x7f06fb81ff40>, tmp_path = PosixPath('/tmp/pytest-of-tkloczko/pytest-109/test_basic_integration_2_7_0')
invoke = <function invoke.<locals>.caller at 0x7f06fb9524c0>

    @pytest.mark.integration
    @pytest.mark.network
    @pytest.mark.parametrize("python_version", ["2.7", "3.6", "3.7", "3.8", "3.9"])
    def test_basic_integration(python_version, core, tmp_path, invoke):
        """An e2e test case to ensure PDM works on all supported Python versions"""
        project = core.create_project(tmp_path)
        project.root.joinpath("foo.py").write_text("import django\n")
        additional_args = ["--no-self"] if python_version == "2.7" else []
>       invoke(["use", "-f", python_version], obj=project, strict=True)

tests/test_integration.py:14:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

args = ['use', '-f', '2.7'], strict = True, kwargs = {'obj': <Project '/tmp/pytest-of-tkloczko/pytest-109/test_basic_integration_2_7_0'>}, result = <Result SystemExit(1)>

    def caller(args, strict=False, **kwargs):
        result = runner.invoke(
            core, args, catch_exceptions=not strict, prog_name="pdm", **kwargs
        )
        if strict and result.exit_code != 0:
>           raise RuntimeError(
                f"Call command {args} failed({result.exit_code}): {result.stderr}"
            )
E           RuntimeError: Call command ['use', '-f', '2.7'] failed(1): [NoPythonVersion]: Python interpreter is not found on the system.
E           Add '-v' to see the detailed traceback

tests/conftest.py:359: RuntimeError
_______________________________________________________________________ test_basic_integration[3.6] ________________________________________________________________________

python_version = '3.6', core = <pdm.core.Core object at 0x7f06fb94de50>, tmp_path = PosixPath('/tmp/pytest-of-tkloczko/pytest-109/test_basic_integration_3_6_0')
invoke = <function invoke.<locals>.caller at 0x7f06fb820d30>

    @pytest.mark.integration
    @pytest.mark.network
    @pytest.mark.parametrize("python_version", ["2.7", "3.6", "3.7", "3.8", "3.9"])
    def test_basic_integration(python_version, core, tmp_path, invoke):
        """An e2e test case to ensure PDM works on all supported Python versions"""
        project = core.create_project(tmp_path)
        project.root.joinpath("foo.py").write_text("import django\n")
        additional_args = ["--no-self"] if python_version == "2.7" else []
>       invoke(["use", "-f", python_version], obj=project, strict=True)

tests/test_integration.py:14:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

args = ['use', '-f', '3.6'], strict = True, kwargs = {'obj': <Project '/tmp/pytest-of-tkloczko/pytest-109/test_basic_integration_3_6_0'>}, result = <Result SystemExit(1)>

    def caller(args, strict=False, **kwargs):
        result = runner.invoke(
            core, args, catch_exceptions=not strict, prog_name="pdm", **kwargs
        )
        if strict and result.exit_code != 0:
>           raise RuntimeError(
                f"Call command {args} failed({result.exit_code}): {result.stderr}"
            )
E           RuntimeError: Call command ['use', '-f', '3.6'] failed(1): [NoPythonVersion]: Python interpreter is not found on the system.
E           Add '-v' to see the detailed traceback

tests/conftest.py:359: RuntimeError
_______________________________________________________________________ test_basic_integration[3.7] ________________________________________________________________________

python_version = '3.7', core = <pdm.core.Core object at 0x7f06fc3fa190>, tmp_path = PosixPath('/tmp/pytest-of-tkloczko/pytest-109/test_basic_integration_3_7_0')
invoke = <function invoke.<locals>.caller at 0x7f06fb804280>

    @pytest.mark.integration
    @pytest.mark.network
    @pytest.mark.parametrize("python_version", ["2.7", "3.6", "3.7", "3.8", "3.9"])
    def test_basic_integration(python_version, core, tmp_path, invoke):
        """An e2e test case to ensure PDM works on all supported Python versions"""
        project = core.create_project(tmp_path)
        project.root.joinpath("foo.py").write_text("import django\n")
        additional_args = ["--no-self"] if python_version == "2.7" else []
>       invoke(["use", "-f", python_version], obj=project, strict=True)

tests/test_integration.py:14:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

args = ['use', '-f', '3.7'], strict = True, kwargs = {'obj': <Project '/tmp/pytest-of-tkloczko/pytest-109/test_basic_integration_3_7_0'>}, result = <Result SystemExit(1)>

    def caller(args, strict=False, **kwargs):
        result = runner.invoke(
            core, args, catch_exceptions=not strict, prog_name="pdm", **kwargs
        )
        if strict and result.exit_code != 0:
>           raise RuntimeError(
                f"Call command {args} failed({result.exit_code}): {result.stderr}"
            )
E           RuntimeError: Call command ['use', '-f', '3.7'] failed(1): [NoPythonVersion]: Python interpreter is not found on the system.
E           Add '-v' to see the detailed traceback

tests/conftest.py:359: RuntimeError
_______________________________________________________________________ test_basic_integration[3.9] ________________________________________________________________________

python_version = '3.9', core = <pdm.core.Core object at 0x7f06fb22fa90>, tmp_path = PosixPath('/tmp/pytest-of-tkloczko/pytest-109/test_basic_integration_3_9_0')
invoke = <function invoke.<locals>.caller at 0x7f06fa841a60>

    @pytest.mark.integration
    @pytest.mark.network
    @pytest.mark.parametrize("python_version", ["2.7", "3.6", "3.7", "3.8", "3.9"])
    def test_basic_integration(python_version, core, tmp_path, invoke):
        """An e2e test case to ensure PDM works on all supported Python versions"""
        project = core.create_project(tmp_path)
        project.root.joinpath("foo.py").write_text("import django\n")
        additional_args = ["--no-self"] if python_version == "2.7" else []
>       invoke(["use", "-f", python_version], obj=project, strict=True)

tests/test_integration.py:14:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

args = ['use', '-f', '3.9'], strict = True, kwargs = {'obj': <Project '/tmp/pytest-of-tkloczko/pytest-109/test_basic_integration_3_9_0'>}, result = <Result SystemExit(1)>

    def caller(args, strict=False, **kwargs):
        result = runner.invoke(
            core, args, catch_exceptions=not strict, prog_name="pdm", **kwargs
        )
        if strict and result.exit_code != 0:
>           raise RuntimeError(
                f"Call command {args} failed({result.exit_code}): {result.stderr}"
            )
E           RuntimeError: Call command ['use', '-f', '3.9'] failed(1): [NoPythonVersion]: Python interpreter is not found on the system.
E           Add '-v' to see the detailed traceback

tests/conftest.py:359: RuntimeError
_________________________________________________________________________ test_actual_list_freeze __________________________________________________________________________

project = <Project '/tmp/pytest-of-tkloczko/pytest-109/test_actual_list_freeze0'>, local_finder = None, invoke = <function invoke.<locals>.caller at 0x7f06fa58e820>

    def test_actual_list_freeze(project, local_finder, invoke):
        invoke(["config", "-l", "install.parallel", "false"], obj=project, strict=True)
>       invoke(["add", "first"], obj=project, strict=True)

tests/test_integration.py:36:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

args = ['add', 'first'], strict = True, kwargs = {'obj': <Project '/tmp/pytest-of-tkloczko/pytest-109/test_actual_list_freeze0'>}, result = <Result SystemExit(1)>

    def caller(args, strict=False, **kwargs):
        result = runner.invoke(
            core, args, catch_exceptions=not strict, prog_name="pdm", **kwargs
        )
        if strict and result.exit_code != 0:
>           raise RuntimeError(
                f"Call command {args} failed({result.exit_code}): {result.stderr}"
            )
E           RuntimeError: Call command ['add', 'first'] failed(1): See /tmp/pdm-lock-iv3q3a3s.log for detailed debug log.
E           [BadZipFile]: File is not a zip file
E           Add '-v' to see the detailed traceback

tests/conftest.py:359: RuntimeError
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
Changes are written to pyproject.toml.
---------------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------------
INFO     pdm.termui:reporters.py:22 ======== Start resolving requirements ========
INFO     pdm.termui:reporters.py:41   first
INFO     pdm.termui:reporters.py:41   python
INFO     pdm.termui:reporters.py:76   Adding requirement first
DEBUG    pdm.termui:repositories.py:156         Found matching candidates:
DEBUG    pdm.termui:repositories.py:168           <Candidate first 2.0.2 from None>
INFO     pdm.termui:reporters.py:76   Adding requirement python
INFO     pdm.termui:reporters.py:22 ======== Starting round 0 ========
INFO     pdm.termui:reporters.py:22 ======== Ending round 0 ========
INFO     pdm.termui:reporters.py:22 ======== Starting round 1 ========
ERROR    pdm.termui:termui.py:203 Error occurs
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/termui.py", line 200, in logging
    yield logger
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/cli/actions.py", line 95, in do_lock
    mapping, dependencies = resolve(
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/resolver/core.py", line 31, in resolve
    result = resolver.resolve(requirements, max_rounds)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 481, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 373, in resolve
    failure_causes = self._attempt_to_pin_criterion(name)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 213, in _attempt_to_pin_criterion
    criteria = self._get_updated_criteria(candidate)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 203, in _get_updated_criteria
    for requirement in self._p.get_dependencies(candidate=candidate):
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/resolver/providers.py", line 172, in get_dependencies
    deps, requires_python, _ = self.repository.get_dependencies(candidate)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/repositories.py", line 70, in get_dependencies
    requirements, requires_python, summary = getter(candidate)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/repositories.py", line 35, in wrapper
    result = func(self, candidate)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/repositories.py", line 190, in _get_dependencies_from_metadata
    deps = prepared.get_dependencies_from_metadata()
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/candidates.py", line 427, in get_dependencies_from_metadata
    self.req.project_name, self.metadata.requires or [], extras  # type: ignore
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/candidates.py", line 420, in metadata
    self._metadata = self.prepare_metadata()
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/candidates.py", line 389, in prepare_metadata
    self._metadata_dir = _get_wheel_metadata_from_wheel(
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/candidates.py", line 64, in _get_wheel_metadata_from_wheel
    with ZipFile(whl_file) as zipf:
  File "/usr/lib64/python3.8/zipfile.py", line 1269, in __init__
    self._RealGetContents()
  File "/usr/lib64/python3.8/zipfile.py", line 1336, in _RealGetContents
    raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file
______________________________________________________________________ test_set_non_exist_python_path ______________________________________________________________________

project_no_init = <Project '/tmp/pytest-of-tkloczko/pytest-109/test_set_non_exist_python_path0'>

    @pytest.mark.path
    def test_set_non_exist_python_path(project_no_init):
        project_no_init.project_config["python.path"] = "non-exist-python"
        project_no_init._python = None
>       assert project_no_init.python.executable == Path(sys.executable)
E       AssertionError: assert PosixPath('/usr/bin/python3.8') == PosixPath('/usr/bin/python3')
E        +  where PosixPath('/usr/bin/python3.8') = <pdm.models.python.PythonInfo object at 0x7f06fc336f70>.executable
E        +    where <pdm.models.python.PythonInfo object at 0x7f06fc336f70> = <Project '/tmp/pytest-of-tkloczko/pytest-109/test_set_non_exist_python_path0'>.python
E        +  and   PosixPath('/usr/bin/python3') = Path('/usr/bin/python3')
E        +    where '/usr/bin/python3' = sys.executable

tests/test_project.py:216: AssertionError
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
____________________________________________________________________ test_add_remote_package_url[False] ____________________________________________________________________

project = <Project '/tmp/pytest-of-tkloczko/pytest-109/test_add_remote_package_url_Fa0'>, is_dev = False

    @pytest.mark.usefixtures("repository", "working_set")
    def test_add_remote_package_url(project, is_dev):
        project.environment.python_requires = PySpecSet(">=3.6")
>       actions.do_add(
            project,
            is_dev,
            packages=["http://fixtures.test/artifacts/demo-0.0.1-py2.py3-none-any.whl"],
        )

tests/cli/test_add.py:133:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/cli/actions.py:256: in do_add
    resolved = do_lock(project, strategy, tracked_names, reqs, dry_run=dry_run)
pdm/cli/actions.py:95: in do_lock
    mapping, dependencies = resolve(
pdm/resolver/core.py:31: in resolve
    result = resolver.resolve(requirements, max_rounds)
/usr/lib/python3.8/site-packages/resolvelib/resolvers.py:481: in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
/usr/lib/python3.8/site-packages/resolvelib/resolvers.py:348: in resolve
    self._add_to_criteria(self.state.criteria, r, parent=None)
/usr/lib/python3.8/site-packages/resolvelib/resolvers.py:168: in _add_to_criteria
    candidates=build_iter_view(matches),
/usr/lib/python3.8/site-packages/resolvelib/structs.py:164: in build_iter_view
    matches = list(matches)
pdm/resolver/providers.py:237: in find_matches
    yield from super().find_matches(identifier, requirements, incompatibilities)
pdm/resolver/providers.py:145: in find_matches
    candidates = self._find_candidates(reqs[0])
pdm/resolver/providers.py:125: in _find_candidates
    can.prepare(self.repository.environment).prepare_metadata()
pdm/models/candidates.py:389: in prepare_metadata
    self._metadata_dir = _get_wheel_metadata_from_wheel(
pdm/models/candidates.py:64: in _get_wheel_metadata_from_wheel
    with ZipFile(whl_file) as zipf:
/usr/lib64/python3.8/zipfile.py:1269: in __init__
    self._RealGetContents()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <zipfile.ZipFile [closed]>

    def _RealGetContents(self):
        """Read in the table of contents for the ZIP file."""
        fp = self.fp
        try:
            endrec = _EndRecData(fp)
        except OSError:
            raise BadZipFile("File is not a zip file")
        if not endrec:
>           raise BadZipFile("File is not a zip file")
E           zipfile.BadZipFile: File is not a zip file

/usr/lib64/python3.8/zipfile.py:1336: BadZipFile
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
Changes are written to pyproject.toml.
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
Adding packages to default dependencies: demo @ http://fixtures.test/artifacts/demo-0.0.1-py2.py3-none-any.whl
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
See /tmp/pdm-lock-ix3mn8ww.log for detailed debug log.
---------------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------------
INFO     pdm.termui:reporters.py:22 ======== Start resolving requirements ========
INFO     pdm.termui:reporters.py:41   demo @ http://fixtures.test/artifacts/demo-0.0.1-py2.py3-none-any.whl
INFO     pdm.termui:reporters.py:41   python>=3.6
INFO     pdm.termui:reporters.py:76   Adding requirement demo @ http://fixtures.test/artifacts/demo-0.0.1-py2.py3-none-any.whl
ERROR    pdm.termui:termui.py:203 Error occurs
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/termui.py", line 200, in logging
    yield logger
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/cli/actions.py", line 95, in do_lock
    mapping, dependencies = resolve(
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/resolver/core.py", line 31, in resolve
    result = resolver.resolve(requirements, max_rounds)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 481, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 348, in resolve
    self._add_to_criteria(self.state.criteria, r, parent=None)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 168, in _add_to_criteria
    candidates=build_iter_view(matches),
  File "/usr/lib/python3.8/site-packages/resolvelib/structs.py", line 164, in build_iter_view
    matches = list(matches)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/resolver/providers.py", line 237, in find_matches
    yield from super().find_matches(identifier, requirements, incompatibilities)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/resolver/providers.py", line 145, in find_matches
    candidates = self._find_candidates(reqs[0])
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/resolver/providers.py", line 125, in _find_candidates
    can.prepare(self.repository.environment).prepare_metadata()
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/candidates.py", line 389, in prepare_metadata
    self._metadata_dir = _get_wheel_metadata_from_wheel(
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/candidates.py", line 64, in _get_wheel_metadata_from_wheel
    with ZipFile(whl_file) as zipf:
  File "/usr/lib64/python3.8/zipfile.py", line 1269, in __init__
    self._RealGetContents()
  File "/usr/lib64/python3.8/zipfile.py", line 1336, in _RealGetContents
    raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file
____________________________________________________________________ test_add_remote_package_url[True] _____________________________________________________________________

project = <Project '/tmp/pytest-of-tkloczko/pytest-109/test_add_remote_package_url_Tr0'>, is_dev = True

    @pytest.mark.usefixtures("repository", "working_set")
    def test_add_remote_package_url(project, is_dev):
        project.environment.python_requires = PySpecSet(">=3.6")
>       actions.do_add(
            project,
            is_dev,
            packages=["http://fixtures.test/artifacts/demo-0.0.1-py2.py3-none-any.whl"],
        )

tests/cli/test_add.py:133:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/cli/actions.py:256: in do_add
    resolved = do_lock(project, strategy, tracked_names, reqs, dry_run=dry_run)
pdm/cli/actions.py:95: in do_lock
    mapping, dependencies = resolve(
pdm/resolver/core.py:31: in resolve
    result = resolver.resolve(requirements, max_rounds)
/usr/lib/python3.8/site-packages/resolvelib/resolvers.py:481: in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
/usr/lib/python3.8/site-packages/resolvelib/resolvers.py:348: in resolve
    self._add_to_criteria(self.state.criteria, r, parent=None)
/usr/lib/python3.8/site-packages/resolvelib/resolvers.py:168: in _add_to_criteria
    candidates=build_iter_view(matches),
/usr/lib/python3.8/site-packages/resolvelib/structs.py:164: in build_iter_view
    matches = list(matches)
pdm/resolver/providers.py:237: in find_matches
    yield from super().find_matches(identifier, requirements, incompatibilities)
pdm/resolver/providers.py:145: in find_matches
    candidates = self._find_candidates(reqs[0])
pdm/resolver/providers.py:125: in _find_candidates
    can.prepare(self.repository.environment).prepare_metadata()
pdm/models/candidates.py:389: in prepare_metadata
    self._metadata_dir = _get_wheel_metadata_from_wheel(
pdm/models/candidates.py:64: in _get_wheel_metadata_from_wheel
    with ZipFile(whl_file) as zipf:
/usr/lib64/python3.8/zipfile.py:1269: in __init__
    self._RealGetContents()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <zipfile.ZipFile [closed]>

    def _RealGetContents(self):
        """Read in the table of contents for the ZIP file."""
        fp = self.fp
        try:
            endrec = _EndRecData(fp)
        except OSError:
            raise BadZipFile("File is not a zip file")
        if not endrec:
>           raise BadZipFile("File is not a zip file")
E           zipfile.BadZipFile: File is not a zip file

/usr/lib64/python3.8/zipfile.py:1336: BadZipFile
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
Changes are written to pyproject.toml.
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
Adding packages to dev dev-dependencies: demo @ http://fixtures.test/artifacts/demo-0.0.1-py2.py3-none-any.whl
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
See /tmp/pdm-lock-j6mz1_ms.log for detailed debug log.
---------------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------------
INFO     pdm.termui:reporters.py:22 ======== Start resolving requirements ========
INFO     pdm.termui:reporters.py:41   demo @ http://fixtures.test/artifacts/demo-0.0.1-py2.py3-none-any.whl
INFO     pdm.termui:reporters.py:41   python>=3.6
INFO     pdm.termui:reporters.py:76   Adding requirement demo @ http://fixtures.test/artifacts/demo-0.0.1-py2.py3-none-any.whl
ERROR    pdm.termui:termui.py:203 Error occurs
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/termui.py", line 200, in logging
    yield logger
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/cli/actions.py", line 95, in do_lock
    mapping, dependencies = resolve(
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/resolver/core.py", line 31, in resolve
    result = resolver.resolve(requirements, max_rounds)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 481, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 348, in resolve
    self._add_to_criteria(self.state.criteria, r, parent=None)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 168, in _add_to_criteria
    candidates=build_iter_view(matches),
  File "/usr/lib/python3.8/site-packages/resolvelib/structs.py", line 164, in build_iter_view
    matches = list(matches)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/resolver/providers.py", line 237, in find_matches
    yield from super().find_matches(identifier, requirements, incompatibilities)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/resolver/providers.py", line 145, in find_matches
    candidates = self._find_candidates(reqs[0])
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/resolver/providers.py", line 125, in _find_candidates
    can.prepare(self.repository.environment).prepare_metadata()
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/candidates.py", line 389, in prepare_metadata
    self._metadata_dir = _get_wheel_metadata_from_wheel(
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/candidates.py", line 64, in _get_wheel_metadata_from_wheel
    with ZipFile(whl_file) as zipf:
  File "/usr/lib64/python3.8/zipfile.py", line 1269, in __init__
    self._RealGetContents()
  File "/usr/lib64/python3.8/zipfile.py", line 1336, in _RealGetContents
    raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file
_____________________________________________________________________ test_add_cached_vcs_requirement ______________________________________________________________________

project = <Project '/tmp/pytest-of-tkloczko/pytest-109/test_add_cached_vcs_requiremen0'>, mocker = <pytest_mock.plugin.MockerFixture object at 0x7f06f9ae6160>

    @pytest.mark.usefixtures("repository", "working_set", "vcs")
    def test_add_cached_vcs_requirement(project, mocker):
        project.environment.python_requires = PySpecSet(">=3.6")
        url = "git+https://github.com/test-root/demo.git@1234567890abcdef#egg=demo"
        built_path = FIXTURES / "artifacts/demo-0.0.1-py2.py3-none-any.whl"
        wheel_cache = project.make_wheel_cache()
        cache_path = Path(wheel_cache.get_path_for_link(Link(url)))
        if not cache_path.exists():
            cache_path.mkdir(parents=True)
        shutil.copy2(built_path, cache_path)
        downloader = mocker.patch("pdm.models.pip_shims.unpack_url")
        builder = mocker.patch("pdm.builders.WheelBuilder.build")
>       actions.do_add(project, packages=[url], no_self=True)

tests/cli/test_add.py:289:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/cli/actions.py:256: in do_add
    resolved = do_lock(project, strategy, tracked_names, reqs, dry_run=dry_run)
pdm/cli/actions.py:95: in do_lock
    mapping, dependencies = resolve(
pdm/resolver/core.py:31: in resolve
    result = resolver.resolve(requirements, max_rounds)
/usr/lib/python3.8/site-packages/resolvelib/resolvers.py:481: in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
/usr/lib/python3.8/site-packages/resolvelib/resolvers.py:348: in resolve
    self._add_to_criteria(self.state.criteria, r, parent=None)
/usr/lib/python3.8/site-packages/resolvelib/resolvers.py:168: in _add_to_criteria
    candidates=build_iter_view(matches),
/usr/lib/python3.8/site-packages/resolvelib/structs.py:164: in build_iter_view
    matches = list(matches)
pdm/resolver/providers.py:237: in find_matches
    yield from super().find_matches(identifier, requirements, incompatibilities)
pdm/resolver/providers.py:145: in find_matches
    candidates = self._find_candidates(reqs[0])
pdm/resolver/providers.py:125: in _find_candidates
    can.prepare(self.repository.environment).prepare_metadata()
pdm/models/candidates.py:389: in prepare_metadata
    self._metadata_dir = _get_wheel_metadata_from_wheel(
pdm/models/candidates.py:64: in _get_wheel_metadata_from_wheel
    with ZipFile(whl_file) as zipf:
/usr/lib64/python3.8/zipfile.py:1269: in __init__
    self._RealGetContents()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <zipfile.ZipFile [closed]>

    def _RealGetContents(self):
        """Read in the table of contents for the ZIP file."""
        fp = self.fp
        try:
            endrec = _EndRecData(fp)
        except OSError:
            raise BadZipFile("File is not a zip file")
        if not endrec:
>           raise BadZipFile("File is not a zip file")
E           zipfile.BadZipFile: File is not a zip file

/usr/lib64/python3.8/zipfile.py:1336: BadZipFile
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
Changes are written to pyproject.toml.
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
Adding packages to default dependencies: demo @ git+https://github.com/test-root/demo.git@1234567890abcdef
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
See /tmp/pdm-lock-zy4xctc8.log for detailed debug log.
---------------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------------
INFO     pdm.termui:reporters.py:22 ======== Start resolving requirements ========
INFO     pdm.termui:reporters.py:41   demo @ git+https://github.com/test-root/demo.git@1234567890abcdef
INFO     pdm.termui:reporters.py:41   python>=3.6
INFO     pdm.termui:reporters.py:76   Adding requirement demo @ git+https://github.com/test-root/demo.git@1234567890abcdef
DEBUG    pdm.termui:candidates.py:460 Using cached wheel link: file:///tmp/pytest-of-tkloczko/pytest-109/test_add_cached_vcs_requiremen0/caches/wheels/99/70/4f/b6ae225f7713d292dda1d2dcbf7c55d3998d716ad2ac50f1e0/demo-0.0.1-py2.py3-none-any.whl
ERROR    pdm.termui:termui.py:203 Error occurs
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/termui.py", line 200, in logging
    yield logger
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/cli/actions.py", line 95, in do_lock
    mapping, dependencies = resolve(
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/resolver/core.py", line 31, in resolve
    result = resolver.resolve(requirements, max_rounds)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 481, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 348, in resolve
    self._add_to_criteria(self.state.criteria, r, parent=None)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 168, in _add_to_criteria
    candidates=build_iter_view(matches),
  File "/usr/lib/python3.8/site-packages/resolvelib/structs.py", line 164, in build_iter_view
    matches = list(matches)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/resolver/providers.py", line 237, in find_matches
    yield from super().find_matches(identifier, requirements, incompatibilities)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/resolver/providers.py", line 145, in find_matches
    candidates = self._find_candidates(reqs[0])
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/resolver/providers.py", line 125, in _find_candidates
    can.prepare(self.repository.environment).prepare_metadata()
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/candidates.py", line 389, in prepare_metadata
    self._metadata_dir = _get_wheel_metadata_from_wheel(
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/candidates.py", line 64, in _get_wheel_metadata_from_wheel
    with ZipFile(whl_file) as zipf:
  File "/usr/lib64/python3.8/zipfile.py", line 1269, in __init__
    self._RealGetContents()
  File "/usr/lib64/python3.8/zipfile.py", line 1336, in _RealGetContents
    raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file
_________________________________________________________________________ test_build_single_module _________________________________________________________________________

fixture_project = <function fixture_project.<locals>.func at 0x7f06fa694550>

    def test_build_single_module(fixture_project):
        project = fixture_project("demo-module")
        assert project.meta.version == "0.1.0"

>       actions.do_build(project)

tests/cli/test_build.py:37:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/cli/actions.py:502: in do_build
    loc = SdistBuilder(project.root, project.environment).build(
pdm/builders/sdist.py:16: in build
    self.install(self._requires, shared=True)
pdm/builders/base.py:277: in install
    self.subprocess_runner(cmd, isolated=False)
pdm/builders/base.py:238: in subprocess_runner
    return log_subprocessor(cmd, cwd, extra_environ=env)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

cmd = ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolated', '--ignore-installed', ...], cwd = None, extra_environ = {}

    def log_subprocessor(
        cmd: list[str],
        cwd: str | Path | None = None,
        extra_environ: dict[str, str] | None = None,
    ) -> None:
        env = os.environ.copy()
        if extra_environ:
            env.update(extra_environ)
        outstream = LoggerWrapper(logger, logging.DEBUG)
        try:
            subprocess.check_call(
                cmd,
                cwd=cwd,
                env=env,
                stdout=outstream.fileno(),
                stderr=subprocess.STDOUT,
            )
        except subprocess.CalledProcessError as e:
>           raise BuildError(
                f"Call command {cmd} return non-zero status({e.returncode})."
            ) from None
E           pdm.exceptions.BuildError: Call command ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolated', '--ignore-installed', '--prefix', '/tmp/pdm-build-env-7x46sooy-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-mgeja6x3.txt'] return non-zero status(1).

pdm/builders/base.py:86: BuildError
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
Building sdist...
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
See /tmp/pdm-build-k7jar__8.log for detailed debug log.
---------------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------------
DEBUG    pdm.termui:base.py:169 Preparing isolated env for PEP 517 build...
DEBUG    pdm.termui:base.py:61 Looking in links: /home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts
DEBUG    pdm.termui:base.py:61 Processing ./tests/fixtures/artifacts/pdm_pep517-0.12.0-py3-none-any.whl
DEBUG    pdm.termui:base.py:61 ERROR: Wheel 'pdm-pep517' located at /home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/pdm_pep517-0.12.0-py3-none-any.whl is invalid.
ERROR    pdm.termui:termui.py:203 Error occurs
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/termui.py", line 200, in logging
    yield logger
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/cli/actions.py", line 502, in do_build
    loc = SdistBuilder(project.root, project.environment).build(
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/sdist.py", line 16, in build
    self.install(self._requires, shared=True)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/base.py", line 277, in install
    self.subprocess_runner(cmd, isolated=False)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/base.py", line 238, in subprocess_runner
    return log_subprocessor(cmd, cwd, extra_environ=env)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/base.py", line 86, in log_subprocessor
    raise BuildError(
pdm.exceptions.BuildError: Call command ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolated', '--ignore-installed', '--prefix', '/tmp/pdm-build-env-7x46sooy-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-mgeja6x3.txt'] return non-zero status(1).
___________________________________________________________________ test_build_single_module_with_readme ___________________________________________________________________

fixture_project = <function fixture_project.<locals>.func at 0x7f06fa604b80>

    def test_build_single_module_with_readme(fixture_project):
        project = fixture_project("demo-module")
        project.meta["readme"] = "README.md"
        project.write_pyproject()
>       actions.do_build(project)

tests/cli/test_build.py:62:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/cli/actions.py:502: in do_build
    loc = SdistBuilder(project.root, project.environment).build(
pdm/builders/sdist.py:16: in build
    self.install(self._requires, shared=True)
pdm/builders/base.py:277: in install
    self.subprocess_runner(cmd, isolated=False)
pdm/builders/base.py:238: in subprocess_runner
    return log_subprocessor(cmd, cwd, extra_environ=env)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

cmd = ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolated', '--ignore-installed', ...], cwd = None, extra_environ = {}

    def log_subprocessor(
        cmd: list[str],
        cwd: str | Path | None = None,
        extra_environ: dict[str, str] | None = None,
    ) -> None:
        env = os.environ.copy()
        if extra_environ:
            env.update(extra_environ)
        outstream = LoggerWrapper(logger, logging.DEBUG)
        try:
            subprocess.check_call(
                cmd,
                cwd=cwd,
                env=env,
                stdout=outstream.fileno(),
                stderr=subprocess.STDOUT,
            )
        except subprocess.CalledProcessError as e:
>           raise BuildError(
                f"Call command {cmd} return non-zero status({e.returncode})."
            ) from None
E           pdm.exceptions.BuildError: Call command ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolated', '--ignore-installed', '--prefix', '/tmp/pdm-build-env-okf68vf0-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-q4dbgp51.txt'] return non-zero status(1).

pdm/builders/base.py:86: BuildError
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
Changes are written to pyproject.toml.
Building sdist...
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
See /tmp/pdm-build-fzeu3pf8.log for detailed debug log.
---------------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------------
DEBUG    pdm.termui:base.py:169 Preparing isolated env for PEP 517 build...
DEBUG    pdm.termui:base.py:61 Looking in links: /home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts
DEBUG    pdm.termui:base.py:61 Processing ./tests/fixtures/artifacts/pdm_pep517-0.12.0-py3-none-any.whl
DEBUG    pdm.termui:base.py:61 ERROR: Wheel 'pdm-pep517' located at /home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/pdm_pep517-0.12.0-py3-none-any.whl is invalid.
ERROR    pdm.termui:termui.py:203 Error occurs
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/termui.py", line 200, in logging
    yield logger
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/cli/actions.py", line 502, in do_build
    loc = SdistBuilder(project.root, project.environment).build(
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/sdist.py", line 16, in build
    self.install(self._requires, shared=True)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/base.py", line 277, in install
    self.subprocess_runner(cmd, isolated=False)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/base.py", line 238, in subprocess_runner
    return log_subprocessor(cmd, cwd, extra_environ=env)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/base.py", line 86, in log_subprocessor
    raise BuildError(
pdm.exceptions.BuildError: Call command ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolated', '--ignore-installed', '--prefix', '/tmp/pdm-build-env-okf68vf0-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-q4dbgp51.txt'] return non-zero status(1).
____________________________________________________________________________ test_build_package ____________________________________________________________________________

fixture_project = <function fixture_project.<locals>.func at 0x7f06fa66fdc0>

    def test_build_package(fixture_project):
        project = fixture_project("demo-package")
>       actions.do_build(project)

tests/cli/test_build.py:70:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/cli/actions.py:502: in do_build
    loc = SdistBuilder(project.root, project.environment).build(
pdm/builders/sdist.py:16: in build
    self.install(self._requires, shared=True)
pdm/builders/base.py:277: in install
    self.subprocess_runner(cmd, isolated=False)
pdm/builders/base.py:238: in subprocess_runner
    return log_subprocessor(cmd, cwd, extra_environ=env)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

cmd = ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolated', '--ignore-installed', ...], cwd = None, extra_environ = {}

    def log_subprocessor(
        cmd: list[str],
        cwd: str | Path | None = None,
        extra_environ: dict[str, str] | None = None,
    ) -> None:
        env = os.environ.copy()
        if extra_environ:
            env.update(extra_environ)
        outstream = LoggerWrapper(logger, logging.DEBUG)
        try:
            subprocess.check_call(
                cmd,
                cwd=cwd,
                env=env,
                stdout=outstream.fileno(),
                stderr=subprocess.STDOUT,
            )
        except subprocess.CalledProcessError as e:
>           raise BuildError(
                f"Call command {cmd} return non-zero status({e.returncode})."
            ) from None
E           pdm.exceptions.BuildError: Call command ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolated', '--ignore-installed', '--prefix', '/tmp/pdm-build-env-2t3koejr-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-r0qitj1c.txt'] return non-zero status(1).

pdm/builders/base.py:86: BuildError
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
Building sdist...
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
See /tmp/pdm-build-zi92jddy.log for detailed debug log.
---------------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------------
DEBUG    pdm.termui:base.py:169 Preparing isolated env for PEP 517 build...
DEBUG    pdm.termui:base.py:61 Looking in links: /home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts
DEBUG    pdm.termui:base.py:61 Processing ./tests/fixtures/artifacts/pdm_pep517-0.12.0-py3-none-any.whl
DEBUG    pdm.termui:base.py:61 ERROR: Wheel 'pdm-pep517' located at /home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/pdm_pep517-0.12.0-py3-none-any.whl is invalid.
ERROR    pdm.termui:termui.py:203 Error occurs
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/termui.py", line 200, in logging
    yield logger
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/cli/actions.py", line 502, in do_build
    loc = SdistBuilder(project.root, project.environment).build(
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/sdist.py", line 16, in build
    self.install(self._requires, shared=True)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/base.py", line 277, in install
    self.subprocess_runner(cmd, isolated=False)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/base.py", line 238, in subprocess_runner
    return log_subprocessor(cmd, cwd, extra_environ=env)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/base.py", line 86, in log_subprocessor
    raise BuildError(
pdm.exceptions.BuildError: Call command ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolated', '--ignore-installed', '--prefix', '/tmp/pdm-build-env-2t3koejr-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-r0qitj1c.txt'] return non-zero status(1).
__________________________________________________________________________ test_build_src_package __________________________________________________________________________

fixture_project = <function fixture_project.<locals>.func at 0x7f06fa799ee0>

    def test_build_src_package(fixture_project):
        project = fixture_project("demo-src-package")
>       actions.do_build(project)

tests/cli/test_build.py:89:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/cli/actions.py:502: in do_build
    loc = SdistBuilder(project.root, project.environment).build(
pdm/builders/sdist.py:16: in build
    self.install(self._requires, shared=True)
pdm/builders/base.py:277: in install
    self.subprocess_runner(cmd, isolated=False)
pdm/builders/base.py:238: in subprocess_runner
    return log_subprocessor(cmd, cwd, extra_environ=env)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

cmd = ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolated', '--ignore-installed', ...], cwd = None, extra_environ = {}

    def log_subprocessor(
        cmd: list[str],
        cwd: str | Path | None = None,
        extra_environ: dict[str, str] | None = None,
    ) -> None:
        env = os.environ.copy()
        if extra_environ:
            env.update(extra_environ)
        outstream = LoggerWrapper(logger, logging.DEBUG)
        try:
            subprocess.check_call(
                cmd,
                cwd=cwd,
                env=env,
                stdout=outstream.fileno(),
                stderr=subprocess.STDOUT,
            )
        except subprocess.CalledProcessError as e:
>           raise BuildError(
                f"Call command {cmd} return non-zero status({e.returncode})."
            ) from None
E           pdm.exceptions.BuildError: Call command ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolated', '--ignore-installed', '--prefix', '/tmp/pdm-build-env-vappytaf-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-85g21_d7.txt'] return non-zero status(1).

pdm/builders/base.py:86: BuildError
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
Building sdist...
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
See /tmp/pdm-build-ler227pe.log for detailed debug log.
---------------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------------
DEBUG    pdm.termui:base.py:169 Preparing isolated env for PEP 517 build...
DEBUG    pdm.termui:base.py:61 Looking in links: /home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts
DEBUG    pdm.termui:base.py:61 Processing ./tests/fixtures/artifacts/pdm_pep517-0.12.0-py3-none-any.whl
DEBUG    pdm.termui:base.py:61 ERROR: Wheel 'pdm-pep517' located at /home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/pdm_pep517-0.12.0-py3-none-any.whl is invalid.
ERROR    pdm.termui:termui.py:203 Error occurs
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/termui.py", line 200, in logging
    yield logger
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/cli/actions.py", line 502, in do_build
    loc = SdistBuilder(project.root, project.environment).build(
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/sdist.py", line 16, in build
    self.install(self._requires, shared=True)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/base.py", line 277, in install
    self.subprocess_runner(cmd, isolated=False)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/base.py", line 238, in subprocess_runner
    return log_subprocessor(cmd, cwd, extra_environ=env)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/base.py", line 86, in log_subprocessor
    raise BuildError(
pdm.exceptions.BuildError: Call command ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolated', '--ignore-installed', '--prefix', '/tmp/pdm-build-env-vappytaf-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-85g21_d7.txt'] return non-zero status(1).
________________________________________________________________________ test_build_package_include ________________________________________________________________________

fixture_project = <function fixture_project.<locals>.func at 0x7f06fa35c940>

    def test_build_package_include(fixture_project):
        project = fixture_project("demo-package")
        project.tool_settings["includes"] = [
            "my_package/",
            "single_module.py",
            "data_out.json",
        ]
        project.tool_settings["excludes"] = ["my_package/*.json"]
        project.write_pyproject()
>       actions.do_build(project)

tests/cli/test_build.py:111:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/cli/actions.py:502: in do_build
    loc = SdistBuilder(project.root, project.environment).build(
pdm/builders/sdist.py:16: in build
    self.install(self._requires, shared=True)
pdm/builders/base.py:277: in install
    self.subprocess_runner(cmd, isolated=False)
pdm/builders/base.py:238: in subprocess_runner
    return log_subprocessor(cmd, cwd, extra_environ=env)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

cmd = ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolated', '--ignore-installed', ...], cwd = None, extra_environ = {}

    def log_subprocessor(
        cmd: list[str],
        cwd: str | Path | None = None,
        extra_environ: dict[str, str] | None = None,
    ) -> None:
        env = os.environ.copy()
        if extra_environ:
            env.update(extra_environ)
        outstream = LoggerWrapper(logger, logging.DEBUG)
        try:
            subprocess.check_call(
                cmd,
                cwd=cwd,
                env=env,
                stdout=outstream.fileno(),
                stderr=subprocess.STDOUT,
            )
        except subprocess.CalledProcessError as e:
>           raise BuildError(
                f"Call command {cmd} return non-zero status({e.returncode})."
            ) from None
E           pdm.exceptions.BuildError: Call command ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolated', '--ignore-installed', '--prefix', '/tmp/pdm-build-env-7ezp02b1-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-5l4u4cjq.txt'] return non-zero status(1).

pdm/builders/base.py:86: BuildError
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
Changes are written to pyproject.toml.
Building sdist...
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
See /tmp/pdm-build-i8qwfqw2.log for detailed debug log.
---------------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------------
DEBUG    pdm.termui:base.py:169 Preparing isolated env for PEP 517 build...
DEBUG    pdm.termui:base.py:61 Looking in links: /home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts
DEBUG    pdm.termui:base.py:61 Processing ./tests/fixtures/artifacts/pdm_pep517-0.12.0-py3-none-any.whl
DEBUG    pdm.termui:base.py:61 ERROR: Wheel 'pdm-pep517' located at /home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/pdm_pep517-0.12.0-py3-none-any.whl is invalid.
ERROR    pdm.termui:termui.py:203 Error occurs
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/termui.py", line 200, in logging
    yield logger
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/cli/actions.py", line 502, in do_build
    loc = SdistBuilder(project.root, project.environment).build(
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/sdist.py", line 16, in build
    self.install(self._requires, shared=True)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/base.py", line 277, in install
    self.subprocess_runner(cmd, isolated=False)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/base.py", line 238, in subprocess_runner
    return log_subprocessor(cmd, cwd, extra_environ=env)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/base.py", line 86, in log_subprocessor
    raise BuildError(
pdm.exceptions.BuildError: Call command ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolated', '--ignore-installed', '--prefix', '/tmp/pdm-build-env-7ezp02b1-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-5l4u4cjq.txt'] return non-zero status(1).
____________________________________________________________________ test_build_src_package_by_include _____________________________________________________________________

fixture_project = <function fixture_project.<locals>.func at 0x7f06f996ab80>

    def test_build_src_package_by_include(fixture_project):
        project = fixture_project("demo-src-package")
        project.includes = ["src/my_package"]
        project.write_pyproject()
>       actions.do_build(project)

tests/cli/test_build.py:132:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/cli/actions.py:502: in do_build
    loc = SdistBuilder(project.root, project.environment).build(
pdm/builders/sdist.py:16: in build
    self.install(self._requires, shared=True)
pdm/builders/base.py:277: in install
    self.subprocess_runner(cmd, isolated=False)
pdm/builders/base.py:238: in subprocess_runner
    return log_subprocessor(cmd, cwd, extra_environ=env)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

cmd = ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolated', '--ignore-installed', ...], cwd = None, extra_environ = {}

    def log_subprocessor(
        cmd: list[str],
        cwd: str | Path | None = None,
        extra_environ: dict[str, str] | None = None,
    ) -> None:
        env = os.environ.copy()
        if extra_environ:
            env.update(extra_environ)
        outstream = LoggerWrapper(logger, logging.DEBUG)
        try:
            subprocess.check_call(
                cmd,
                cwd=cwd,
                env=env,
                stdout=outstream.fileno(),
                stderr=subprocess.STDOUT,
            )
        except subprocess.CalledProcessError as e:
>           raise BuildError(
                f"Call command {cmd} return non-zero status({e.returncode})."
            ) from None
E           pdm.exceptions.BuildError: Call command ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolated', '--ignore-installed', '--prefix', '/tmp/pdm-build-env-o8i21z5_-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-a_szv0ow.txt'] return non-zero status(1).

pdm/builders/base.py:86: BuildError
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
Changes are written to pyproject.toml.
Building sdist...
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
See /tmp/pdm-build-2s8f0u1a.log for detailed debug log.
---------------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------------
DEBUG    pdm.termui:base.py:169 Preparing isolated env for PEP 517 build...
DEBUG    pdm.termui:base.py:61 Looking in links: /home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts
DEBUG    pdm.termui:base.py:61 Processing ./tests/fixtures/artifacts/pdm_pep517-0.12.0-py3-none-any.whl
DEBUG    pdm.termui:base.py:61 ERROR: Wheel 'pdm-pep517' located at /home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/pdm_pep517-0.12.0-py3-none-any.whl is invalid.
ERROR    pdm.termui:termui.py:203 Error occurs
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/termui.py", line 200, in logging
    yield logger
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/cli/actions.py", line 502, in do_build
    loc = SdistBuilder(project.root, project.environment).build(
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/sdist.py", line 16, in build
    self.install(self._requires, shared=True)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/base.py", line 277, in install
    self.subprocess_runner(cmd, isolated=False)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/base.py", line 238, in subprocess_runner
    return log_subprocessor(cmd, cwd, extra_environ=env)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/base.py", line 86, in log_subprocessor
    raise BuildError(
pdm.exceptions.BuildError: Call command ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolated', '--ignore-installed', '--prefix', '/tmp/pdm-build-env-o8i21z5_-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-a_szv0ow.txt'] return non-zero status(1).
_____________________________________________________________________ test_build_with_config_settings ______________________________________________________________________

fixture_project = <function fixture_project.<locals>.func at 0x7f06fa5a84c0>

    def test_build_with_config_settings(fixture_project):
        project = fixture_project("demo-src-package")
>       actions.do_build(project, config_settings={"--plat-name": "win_amd64"})

tests/cli/test_build.py:147:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/cli/actions.py:502: in do_build
    loc = SdistBuilder(project.root, project.environment).build(
pdm/builders/sdist.py:16: in build
    self.install(self._requires, shared=True)
pdm/builders/base.py:277: in install
    self.subprocess_runner(cmd, isolated=False)
pdm/builders/base.py:238: in subprocess_runner
    return log_subprocessor(cmd, cwd, extra_environ=env)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

cmd = ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolated', '--ignore-installed', ...], cwd = None, extra_environ = {}

    def log_subprocessor(
        cmd: list[str],
        cwd: str | Path | None = None,
        extra_environ: dict[str, str] | None = None,
    ) -> None:
        env = os.environ.copy()
        if extra_environ:
            env.update(extra_environ)
        outstream = LoggerWrapper(logger, logging.DEBUG)
        try:
            subprocess.check_call(
                cmd,
                cwd=cwd,
                env=env,
                stdout=outstream.fileno(),
                stderr=subprocess.STDOUT,
            )
        except subprocess.CalledProcessError as e:
>           raise BuildError(
                f"Call command {cmd} return non-zero status({e.returncode})."
            ) from None
E           pdm.exceptions.BuildError: Call command ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolated', '--ignore-installed', '--prefix', '/tmp/pdm-build-env-6kcuixle-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-q_l1yvnn.txt'] return non-zero status(1).

pdm/builders/base.py:86: BuildError
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
Building sdist...
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
See /tmp/pdm-build-ryusw28w.log for detailed debug log.
---------------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------------
DEBUG    pdm.termui:base.py:169 Preparing isolated env for PEP 517 build...
DEBUG    pdm.termui:base.py:61 Looking in links: /home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts
DEBUG    pdm.termui:base.py:61 Processing ./tests/fixtures/artifacts/pdm_pep517-0.12.0-py3-none-any.whl
DEBUG    pdm.termui:base.py:61 ERROR: Wheel 'pdm-pep517' located at /home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/pdm_pep517-0.12.0-py3-none-any.whl is invalid.
ERROR    pdm.termui:termui.py:203 Error occurs
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/termui.py", line 200, in logging
    yield logger
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/cli/actions.py", line 502, in do_build
    loc = SdistBuilder(project.root, project.environment).build(
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/sdist.py", line 16, in build
    self.install(self._requires, shared=True)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/base.py", line 277, in install
    self.subprocess_runner(cmd, isolated=False)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/base.py", line 238, in subprocess_runner
    return log_subprocessor(cmd, cwd, extra_environ=env)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/base.py", line 86, in log_subprocessor
    raise BuildError(
pdm.exceptions.BuildError: Call command ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolated', '--ignore-installed', '--prefix', '/tmp/pdm-build-env-6kcuixle-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-q_l1yvnn.txt'] return non-zero status(1).
___________________________________________________________________ test_cli_build_with_config_settings ____________________________________________________________________

fixture_project = <function fixture_project.<locals>.func at 0x7f06f97da430>, invoke = <function invoke.<locals>.caller at 0x7f06f9958700>

    def test_cli_build_with_config_settings(fixture_project, invoke):
        project = fixture_project("demo-src-package")
        result = invoke(["build", "-C--plat-name=win_amd64"], obj=project)
>       assert result.exit_code == 0
E       assert 1 == 0
E        +  where 1 = <Result SystemExit(1)>.exit_code

tests/cli/test_build.py:155: AssertionError
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
---------------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------------
DEBUG    pdm.termui:base.py:169 Preparing isolated env for PEP 517 build...
DEBUG    pdm.termui:base.py:61 Looking in links: /home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts
DEBUG    pdm.termui:base.py:61 Processing ./tests/fixtures/artifacts/pdm_pep517-0.12.0-py3-none-any.whl
DEBUG    pdm.termui:base.py:61 ERROR: Wheel 'pdm-pep517' located at /home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/pdm_pep517-0.12.0-py3-none-any.whl is invalid.
ERROR    pdm.termui:termui.py:203 Error occurs
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/termui.py", line 200, in logging
    yield logger
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/cli/actions.py", line 502, in do_build
    loc = SdistBuilder(project.root, project.environment).build(
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/sdist.py", line 16, in build
    self.install(self._requires, shared=True)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/base.py", line 277, in install
    self.subprocess_runner(cmd, isolated=False)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/base.py", line 238, in subprocess_runner
    return log_subprocessor(cmd, cwd, extra_environ=env)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/base.py", line 86, in log_subprocessor
    raise BuildError(
pdm.exceptions.BuildError: Call command ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolated', '--ignore-installed', '--prefix', '/tmp/pdm-build-env-pp_hyx2d-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-612isqze.txt'] return non-zero status(1).
___________________________________________________________________ test_build_with_no_isolation[False] ____________________________________________________________________

fixture_project = <function fixture_project.<locals>.func at 0x7f06fa381b80>, invoke = <function invoke.<locals>.caller at 0x7f06fa381ee0>, isolated = False

    @pytest.mark.parametrize("isolated", (True, False))
    def test_build_with_no_isolation(fixture_project, invoke, isolated):
        project = fixture_project("demo-failure")
        project.pyproject = {"project": {"name": "demo", "version": "0.1.0"}}
        project.write_pyproject()
        invoke(["add", "first"], obj=project)
        args = ["build"]
        if not isolated:
            args.append("--no-isolation")
        result = invoke(args, obj=project)
>       assert result.exit_code == int(isolated)
E       assert 1 == 0
E        +  where 1 = <Result SystemExit(1)>.exit_code
E        +  and   0 = int(False)

tests/cli/test_build.py:169: AssertionError
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
Changes are written to pyproject.toml.
---------------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------------
INFO     pdm.termui:reporters.py:22 ======== Start resolving requirements ========
INFO     pdm.termui:reporters.py:41   first
INFO     pdm.termui:reporters.py:41   python
INFO     pdm.termui:reporters.py:76   Adding requirement first
DEBUG    pdm.termui:repositories.py:156         Found matching candidates:
DEBUG    pdm.termui:repositories.py:168           <Candidate first 2.0.2 from None>
INFO     pdm.termui:reporters.py:76   Adding requirement python
INFO     pdm.termui:reporters.py:22 ======== Starting round 0 ========
INFO     pdm.termui:reporters.py:22 ======== Ending round 0 ========
INFO     pdm.termui:reporters.py:22 ======== Starting round 1 ========
ERROR    pdm.termui:termui.py:203 Error occurs
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/termui.py", line 200, in logging
    yield logger
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/cli/actions.py", line 95, in do_lock
    mapping, dependencies = resolve(
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/resolver/core.py", line 31, in resolve
    result = resolver.resolve(requirements, max_rounds)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 481, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 373, in resolve
    failure_causes = self._attempt_to_pin_criterion(name)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 213, in _attempt_to_pin_criterion
    criteria = self._get_updated_criteria(candidate)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 203, in _get_updated_criteria
    for requirement in self._p.get_dependencies(candidate=candidate):
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/resolver/providers.py", line 172, in get_dependencies
    deps, requires_python, _ = self.repository.get_dependencies(candidate)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/repositories.py", line 70, in get_dependencies
    requirements, requires_python, summary = getter(candidate)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/repositories.py", line 35, in wrapper
    result = func(self, candidate)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/repositories.py", line 190, in _get_dependencies_from_metadata
    deps = prepared.get_dependencies_from_metadata()
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/candidates.py", line 427, in get_dependencies_from_metadata
    self.req.project_name, self.metadata.requires or [], extras  # type: ignore
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/candidates.py", line 420, in metadata
    self._metadata = self.prepare_metadata()
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/candidates.py", line 389, in prepare_metadata
    self._metadata_dir = _get_wheel_metadata_from_wheel(
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/candidates.py", line 64, in _get_wheel_metadata_from_wheel
    with ZipFile(whl_file) as zipf:
  File "/usr/lib64/python3.8/zipfile.py", line 1269, in __init__
    self._RealGetContents()
  File "/usr/lib64/python3.8/zipfile.py", line 1336, in _RealGetContents
    raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file
DEBUG    pdm.termui:base.py:169 Preparing isolated env for PEP 517 build...
DEBUG    pdm.termui:base.py:148 Reusing shared build env: /tmp/pdm-build-env-s78ro4i0-shared
DEBUG    pdm.termui:base.py:61 Traceback (most recent call last):
DEBUG    pdm.termui:base.py:61   File "/usr/lib/python3.8/site-packages/pep517/in_process/_in_process.py", line 363, in <module>
DEBUG    pdm.termui:base.py:61     main()
DEBUG    pdm.termui:base.py:61   File "/usr/lib/python3.8/site-packages/pep517/in_process/_in_process.py", line 345, in main
DEBUG    pdm.termui:base.py:61     json_out['return_val'] = hook(**hook_input['kwargs'])
DEBUG    pdm.termui:base.py:61   File "/usr/lib/python3.8/site-packages/pep517/in_process/_in_process.py", line 297, in get_requires_for_build_sdist
DEBUG    pdm.termui:base.py:61     return hook(config_settings)
DEBUG    pdm.termui:base.py:61   File "/tmp/pdm-build-env-s78ro4i0-shared/lib/python3.8/site-packages/setuptools/build_meta.py", line 181, in get_requires_for_build_sdist
DEBUG    pdm.termui:base.py:61     return self._get_build_requires(config_settings, requirements=[])
DEBUG    pdm.termui:base.py:61   File "/tmp/pdm-build-env-s78ro4i0-shared/lib/python3.8/site-packages/setuptools/build_meta.py", line 159, in _get_build_requires
DEBUG    pdm.termui:base.py:61     self.run_setup()
DEBUG    pdm.termui:base.py:61   File "/tmp/pdm-build-env-s78ro4i0-shared/lib/python3.8/site-packages/setuptools/build_meta.py", line 281, in run_setup
DEBUG    pdm.termui:base.py:61     super(_BuildMetaLegacyBackend,
DEBUG    pdm.termui:base.py:61   File "/tmp/pdm-build-env-s78ro4i0-shared/lib/python3.8/site-packages/setuptools/build_meta.py", line 174, in run_setup
DEBUG    pdm.termui:base.py:61     exec(compile(code, __file__, 'exec'), locals())
DEBUG    pdm.termui:base.py:61   File "setup.py", line 3, in <module>
DEBUG    pdm.termui:base.py:61     import first
DEBUG    pdm.termui:base.py:61 ModuleNotFoundError: No module named 'first'
ERROR    pdm.termui:termui.py:203 Error occurs
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/termui.py", line 200, in logging
    yield logger
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/cli/actions.py", line 502, in do_build
    loc = SdistBuilder(project.root, project.environment).build(
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/sdist.py", line 17, in build
    requires = self._hook.get_requires_for_build_sdist(config_settings)
  File "/usr/lib/python3.8/site-packages/pep517/wrappers.py", line 278, in get_requires_for_build_sdist
    return self._call_hook('get_requires_for_build_sdist', {
  File "/usr/lib/python3.8/site-packages/pep517/wrappers.py", line 322, in _call_hook
    self._subprocess_runner(
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/base.py", line 238, in subprocess_runner
    return log_subprocessor(cmd, cwd, extra_environ=env)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/base.py", line 86, in log_subprocessor
    raise BuildError(
pdm.exceptions.BuildError: Call command ['/usr/bin/python3.8', '/usr/lib/python3.8/site-packages/pep517/in_process/_in_process.py', 'get_requires_for_build_sdist', '/tmp/tmphs05j6_s'] return non-zero status(1).
___________________________________________________________________ test_build_ignoring_pip_environment ____________________________________________________________________

fixture_project = <function fixture_project.<locals>.func at 0x7f06fa4a8700>

    def test_build_ignoring_pip_environment(fixture_project):
        project = fixture_project("demo-module")
        os.environ["PIP_REQUIRE_VIRTUALENV"] = "1"
>       actions.do_build(project)

tests/cli/test_build.py:175:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/cli/actions.py:502: in do_build
    loc = SdistBuilder(project.root, project.environment).build(
pdm/builders/sdist.py:16: in build
    self.install(self._requires, shared=True)
pdm/builders/base.py:277: in install
    self.subprocess_runner(cmd, isolated=False)
pdm/builders/base.py:238: in subprocess_runner
    return log_subprocessor(cmd, cwd, extra_environ=env)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

cmd = ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolated', '--ignore-installed', ...], cwd = None, extra_environ = {}

    def log_subprocessor(
        cmd: list[str],
        cwd: str | Path | None = None,
        extra_environ: dict[str, str] | None = None,
    ) -> None:
        env = os.environ.copy()
        if extra_environ:
            env.update(extra_environ)
        outstream = LoggerWrapper(logger, logging.DEBUG)
        try:
            subprocess.check_call(
                cmd,
                cwd=cwd,
                env=env,
                stdout=outstream.fileno(),
                stderr=subprocess.STDOUT,
            )
        except subprocess.CalledProcessError as e:
>           raise BuildError(
                f"Call command {cmd} return non-zero status({e.returncode})."
            ) from None
E           pdm.exceptions.BuildError: Call command ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolated', '--ignore-installed', '--prefix', '/tmp/pdm-build-env-i553sp32-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-c6ophe16.txt'] return non-zero status(1).

pdm/builders/base.py:86: BuildError
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
Building sdist...
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
See /tmp/pdm-build-kcqf745h.log for detailed debug log.
---------------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------------
DEBUG    pdm.termui:base.py:169 Preparing isolated env for PEP 517 build...
DEBUG    pdm.termui:base.py:61 Looking in links: /home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts
DEBUG    pdm.termui:base.py:61 Processing ./tests/fixtures/artifacts/pdm_pep517-0.12.0-py3-none-any.whl
DEBUG    pdm.termui:base.py:61 ERROR: Wheel 'pdm-pep517' located at /home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/pdm_pep517-0.12.0-py3-none-any.whl is invalid.
ERROR    pdm.termui:termui.py:203 Error occurs
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/termui.py", line 200, in logging
    yield logger
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/cli/actions.py", line 502, in do_build
    loc = SdistBuilder(project.root, project.environment).build(
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/sdist.py", line 16, in build
    self.install(self._requires, shared=True)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/base.py", line 277, in install
    self.subprocess_runner(cmd, isolated=False)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/base.py", line 238, in subprocess_runner
    return log_subprocessor(cmd, cwd, extra_environ=env)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/builders/base.py", line 86, in log_subprocessor
    raise BuildError(
pdm.exceptions.BuildError: Call command ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolated', '--ignore-installed', '--prefix', '/tmp/pdm-build-env-i553sp32-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-c6ophe16.txt'] return non-zero status(1).
________________ test_hash_cache[http://fixtures.test/artifacts/demo-0.0.1.tar.gz-sha256:d57bf5e3b8723e4fc68275159dcc4ca983d86d4c84220a4d715d491401f27db2] _________________

project = <Project '/tmp/pytest-of-tkloczko/pytest-109/test_hash_cache_http___fixture0'>, url = 'http://fixtures.test/artifacts/demo-0.0.1.tar.gz'
hash = 'sha256:d57bf5e3b8723e4fc68275159dcc4ca983d86d4c84220a4d715d491401f27db2'

    @pytest.mark.parametrize(
        "url,hash",
        [
            (
                "http://fixtures.test/artifacts/demo-0.0.1.tar.gz",
                "sha256:d57bf5e3b8723e4fc68275159dcc4ca983d86d4c84220a4d715d491401f27db2",
            ),
            (
                f"file://{(FIXTURES / 'artifacts/demo-0.0.1.tar.gz').as_posix()}",
                "sha256:d57bf5e3b8723e4fc68275159dcc4ca983d86d4c84220a4d715d491401f27db2",
            ),
            (
                "http://fixtures.test/artifacts/demo-0.0.1.tar.gz#sha384=9130e5e4912bc78b"
                "1ffabbf406d56bc74b9165b0adc8c627168b7b563b80d5ff6c30e269398d01144ee52aa3"
                "3292682d",
                "sha384:9130e5e4912bc78b1ffabbf406d56bc74b9165b0adc8c627168b7b563b80d5ff6"
                "c30e269398d01144ee52aa33292682d",
            ),
            (
                "http://fixtures.test/artifacts/demo-0.0.1.tar.gz#md5=5218509812c9fcb4646a"
                "dde8fd3307e1",
                "sha256:d57bf5e3b8723e4fc68275159dcc4ca983d86d4c84220a4d715d491401f27db2",
            ),
        ],
    )
    def test_hash_cache(project, url, hash):
        with project.environment.get_finder() as finder:
            hash_cache = project.make_hash_cache()
            hash_cache.session = finder.session
>           assert hash_cache.get_hash(Link(url)) == hash
E           AssertionError: assert 'sha256:275ab...0ed64233991eb' == 'sha256:d57bf...d491401f27db2'
E             - sha256:d57bf5e3b8723e4fc68275159dcc4ca983d86d4c84220a4d715d491401f27db2
E             + sha256:275abb8d2ccd018d25f17d83c603d16258f68d71a32d2e53ee70ed64233991eb

tests/cli/test_cache.py:163: AssertionError
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
Changes are written to pyproject.toml.
_ test_hash_cache[file:///home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/demo-0.0.1.tar.gz-sha256:d57bf5e3b8723e4fc68275159dcc4ca983d86d4c84220a4d715d491401f27db2] _

project = <Project '/tmp/pytest-of-tkloczko/pytest-109/test_hash_cache_file____home_t0'>
url = 'file:///home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/demo-0.0.1.tar.gz'
hash = 'sha256:d57bf5e3b8723e4fc68275159dcc4ca983d86d4c84220a4d715d491401f27db2'

    @pytest.mark.parametrize(
        "url,hash",
        [
            (
                "http://fixtures.test/artifacts/demo-0.0.1.tar.gz",
                "sha256:d57bf5e3b8723e4fc68275159dcc4ca983d86d4c84220a4d715d491401f27db2",
            ),
            (
                f"file://{(FIXTURES / 'artifacts/demo-0.0.1.tar.gz').as_posix()}",
                "sha256:d57bf5e3b8723e4fc68275159dcc4ca983d86d4c84220a4d715d491401f27db2",
            ),
            (
                "http://fixtures.test/artifacts/demo-0.0.1.tar.gz#sha384=9130e5e4912bc78b"
                "1ffabbf406d56bc74b9165b0adc8c627168b7b563b80d5ff6c30e269398d01144ee52aa3"
                "3292682d",
                "sha384:9130e5e4912bc78b1ffabbf406d56bc74b9165b0adc8c627168b7b563b80d5ff6"
                "c30e269398d01144ee52aa33292682d",
            ),
            (
                "http://fixtures.test/artifacts/demo-0.0.1.tar.gz#md5=5218509812c9fcb4646a"
                "dde8fd3307e1",
                "sha256:d57bf5e3b8723e4fc68275159dcc4ca983d86d4c84220a4d715d491401f27db2",
            ),
        ],
    )
    def test_hash_cache(project, url, hash):
        with project.environment.get_finder() as finder:
            hash_cache = project.make_hash_cache()
            hash_cache.session = finder.session
>           assert hash_cache.get_hash(Link(url)) == hash
E           AssertionError: assert 'sha256:275ab...0ed64233991eb' == 'sha256:d57bf...d491401f27db2'
E             - sha256:d57bf5e3b8723e4fc68275159dcc4ca983d86d4c84220a4d715d491401f27db2
E             + sha256:275abb8d2ccd018d25f17d83c603d16258f68d71a32d2e53ee70ed64233991eb

tests/cli/test_cache.py:163: AssertionError
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
Changes are written to pyproject.toml.
_ test_hash_cache[http://fixtures.test/artifacts/demo-0.0.1.tar.gz#md5=5218509812c9fcb4646adde8fd3307e1-sha256:d57bf5e3b8723e4fc68275159dcc4ca983d86d4c84220a4d715d491401f27db2] _

project = <Project '/tmp/pytest-of-tkloczko/pytest-109/test_hash_cache_http___fixture2'>
url = 'http://fixtures.test/artifacts/demo-0.0.1.tar.gz#md5=5218509812c9fcb4646adde8fd3307e1'
hash = 'sha256:d57bf5e3b8723e4fc68275159dcc4ca983d86d4c84220a4d715d491401f27db2'

    @pytest.mark.parametrize(
        "url,hash",
        [
            (
                "http://fixtures.test/artifacts/demo-0.0.1.tar.gz",
                "sha256:d57bf5e3b8723e4fc68275159dcc4ca983d86d4c84220a4d715d491401f27db2",
            ),
            (
                f"file://{(FIXTURES / 'artifacts/demo-0.0.1.tar.gz').as_posix()}",
                "sha256:d57bf5e3b8723e4fc68275159dcc4ca983d86d4c84220a4d715d491401f27db2",
            ),
            (
                "http://fixtures.test/artifacts/demo-0.0.1.tar.gz#sha384=9130e5e4912bc78b"
                "1ffabbf406d56bc74b9165b0adc8c627168b7b563b80d5ff6c30e269398d01144ee52aa3"
                "3292682d",
                "sha384:9130e5e4912bc78b1ffabbf406d56bc74b9165b0adc8c627168b7b563b80d5ff6"
                "c30e269398d01144ee52aa33292682d",
            ),
            (
                "http://fixtures.test/artifacts/demo-0.0.1.tar.gz#md5=5218509812c9fcb4646a"
                "dde8fd3307e1",
                "sha256:d57bf5e3b8723e4fc68275159dcc4ca983d86d4c84220a4d715d491401f27db2",
            ),
        ],
    )
    def test_hash_cache(project, url, hash):
        with project.environment.get_finder() as finder:
            hash_cache = project.make_hash_cache()
            hash_cache.session = finder.session
>           assert hash_cache.get_hash(Link(url)) == hash
E           AssertionError: assert 'sha256:275ab...0ed64233991eb' == 'sha256:d57bf...d491401f27db2'
E             - sha256:d57bf5e3b8723e4fc68275159dcc4ca983d86d4c84220a4d715d491401f27db2
E             + sha256:275abb8d2ccd018d25f17d83c603d16258f68d71a32d2e53ee70ed64233991eb

tests/cli/test_cache.py:163: AssertionError
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
Changes are written to pyproject.toml.
_______________________________________________________________________ test_sync_with_index_change ________________________________________________________________________

project = <Project '/tmp/pytest-of-tkloczko/pytest-109/test_sync_with_index_change0'>
index = {'future-fstrings': b'\n    <html>\n    <body>\n        <h1>future-fstrings</h1>\n        <a href="http://fixtures.tes...038c3039d802c91c0a55505da318c63">\n        future_fstrings-1.2.0.tar.gz\n        </a>\n    </body>\n    </html>\n    '}

    def test_sync_with_index_change(project, index):
        project.meta["requires-python"] = ">=3.6"
        project.meta["dependencies"] = ["future-fstrings"]
        project.write_pyproject()
        index[
            "future-fstrings"
        ] = """
        <html>
        <body>
            <h1>future-fstrings</h1>
            <a href="http://fixtures.test/artifacts/future_fstrings-1.2.0-py2.py3-none-any\
    .whl#sha256=90e49598b553d8746c4dc7d9442e0359d038c3039d802c91c0a55505da318c63">
            future_fstrings-1.2.0.tar.gz
            </a>
        </body>
        </html>
        """.encode()
>       actions.do_lock(project)

tests/cli/test_install.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/cli/actions.py:95: in do_lock
    mapping, dependencies = resolve(
pdm/resolver/core.py:31: in resolve
    result = resolver.resolve(requirements, max_rounds)
/usr/lib/python3.8/site-packages/resolvelib/resolvers.py:481: in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
/usr/lib/python3.8/site-packages/resolvelib/resolvers.py:373: in resolve
    failure_causes = self._attempt_to_pin_criterion(name)
/usr/lib/python3.8/site-packages/resolvelib/resolvers.py:213: in _attempt_to_pin_criterion
    criteria = self._get_updated_criteria(candidate)
/usr/lib/python3.8/site-packages/resolvelib/resolvers.py:203: in _get_updated_criteria
    for requirement in self._p.get_dependencies(candidate=candidate):
pdm/resolver/providers.py:172: in get_dependencies
    deps, requires_python, _ = self.repository.get_dependencies(candidate)
pdm/models/repositories.py:70: in get_dependencies
    requirements, requires_python, summary = getter(candidate)
pdm/models/repositories.py:35: in wrapper
    result = func(self, candidate)
pdm/models/repositories.py:190: in _get_dependencies_from_metadata
    deps = prepared.get_dependencies_from_metadata()
pdm/models/candidates.py:427: in get_dependencies_from_metadata
    self.req.project_name, self.metadata.requires or [], extras  # type: ignore
pdm/models/candidates.py:420: in metadata
    self._metadata = self.prepare_metadata()
pdm/models/candidates.py:385: in prepare_metadata
    self.obtain(allow_all=True)
pdm/models/candidates.py:370: in obtain
    downloaded = pip_shims.unpack_url(  # type: ignore
/usr/lib/python3.8/site-packages/pip/_internal/operations/prepare.py:214: in unpack_url
    file = get_http_url(
/usr/lib/python3.8/site-packages/pip/_internal/operations/prepare.py:96: in get_http_url
    hashes.check_against_path(from_path)
/usr/lib/python3.8/site-packages/pip/_internal/utils/hashes.py:106: in check_against_path
    return self.check_against_file(file)
/usr/lib/python3.8/site-packages/pip/_internal/utils/hashes.py:102: in check_against_file
    return self.check_against_chunks(read_chunks(file))
/usr/lib/python3.8/site-packages/pip/_internal/utils/hashes.py:91: in check_against_chunks
    self._raise(gots)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <pip._internal.utils.hashes.Hashes object at 0x7f06f85ef820>, gots = {'sha256': <sha256 HASH object @ 0x7f06f96ed510>}

    def _raise(self, gots: Dict[str, "_Hash"]) -> "NoReturn":
>       raise HashMismatch(self._allowed, gots)
E       pip._internal.exceptions.HashMismatch: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
E           unknown package:
E               Expected sha256 90e49598b553d8746c4dc7d9442e0359d038c3039d802c91c0a55505da318c63
E                    Got        89d65fe79018386ddda40a815a5db15466b20e10cbeb35d0e5d5a733d2f3afcb

/usr/lib/python3.8/site-packages/pip/_internal/utils/hashes.py:94: HashMismatch
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
Changes are written to pyproject.toml.
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
Changes are written to pyproject.toml.
Resolving: new pin python >=3.6
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
See /tmp/pdm-lock-x0dhlnx5.log for detailed debug log.
---------------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------------
INFO     pdm.termui:reporters.py:22 ======== Start resolving requirements ========
INFO     pdm.termui:reporters.py:41   future-fstrings
INFO     pdm.termui:reporters.py:41   python>=3.6
INFO     pdm.termui:reporters.py:76   Adding requirement future-fstrings
DEBUG    pdm.termui:repositories.py:156         Found matching candidates:
DEBUG    pdm.termui:repositories.py:168           <Candidate future-fstrings 1.2.0 from https://pypi.org/simple/future-fstrings/>
INFO     pdm.termui:reporters.py:76   Adding requirement python>=3.6
INFO     pdm.termui:reporters.py:22 ======== Starting round 0 ========
INFO     pdm.termui:reporters.py:22 ======== Ending round 0 ========
INFO     pdm.termui:reporters.py:22 ======== Starting round 1 ========
ERROR    pdm.termui:termui.py:203 Error occurs
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/termui.py", line 200, in logging
    yield logger
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/cli/actions.py", line 95, in do_lock
    mapping, dependencies = resolve(
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/resolver/core.py", line 31, in resolve
    result = resolver.resolve(requirements, max_rounds)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 481, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 373, in resolve
    failure_causes = self._attempt_to_pin_criterion(name)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 213, in _attempt_to_pin_criterion
    criteria = self._get_updated_criteria(candidate)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 203, in _get_updated_criteria
    for requirement in self._p.get_dependencies(candidate=candidate):
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/resolver/providers.py", line 172, in get_dependencies
    deps, requires_python, _ = self.repository.get_dependencies(candidate)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/repositories.py", line 70, in get_dependencies
    requirements, requires_python, summary = getter(candidate)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/repositories.py", line 35, in wrapper
    result = func(self, candidate)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/repositories.py", line 190, in _get_dependencies_from_metadata
    deps = prepared.get_dependencies_from_metadata()
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/candidates.py", line 427, in get_dependencies_from_metadata
    self.req.project_name, self.metadata.requires or [], extras  # type: ignore
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/candidates.py", line 420, in metadata
    self._metadata = self.prepare_metadata()
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/candidates.py", line 385, in prepare_metadata
    self.obtain(allow_all=True)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/candidates.py", line 370, in obtain
    downloaded = pip_shims.unpack_url(  # type: ignore
  File "/usr/lib/python3.8/site-packages/pip/_internal/operations/prepare.py", line 214, in unpack_url
    file = get_http_url(
  File "/usr/lib/python3.8/site-packages/pip/_internal/operations/prepare.py", line 96, in get_http_url
    hashes.check_against_path(from_path)
  File "/usr/lib/python3.8/site-packages/pip/_internal/utils/hashes.py", line 106, in check_against_path
    return self.check_against_file(file)
  File "/usr/lib/python3.8/site-packages/pip/_internal/utils/hashes.py", line 102, in check_against_file
    return self.check_against_chunks(read_chunks(file))
  File "/usr/lib/python3.8/site-packages/pip/_internal/utils/hashes.py", line 91, in check_against_chunks
    self._raise(gots)
  File "/usr/lib/python3.8/site-packages/pip/_internal/utils/hashes.py", line 94, in _raise
    raise HashMismatch(self._allowed, gots)
pip._internal.exceptions.HashMismatch: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
    unknown package:
        Expected sha256 90e49598b553d8746c4dc7d9442e0359d038c3039d802c91c0a55505da318c63
             Got        89d65fe79018386ddda40a815a5db15466b20e10cbeb35d0e5d5a733d2f3afcb
_________________________________________________________________________ test_completion_command __________________________________________________________________________

invoke = <function invoke.<locals>.caller at 0x7f06ebb58280>

    def test_completion_command(invoke):
        result = invoke(["completion", "bash"])
>       assert result.exit_code == 0
E       assert 1 == 0
E        +  where 1 = <Result SystemExit(1)>.exit_code

tests/cli/test_others.py:244: AssertionError
_______________________________________________________________ test_pep582_launcher_for_python_interpreter ________________________________________________________________

project = <Project '/tmp/pytest-of-tkloczko/pytest-109/test_pep582_launcher_for_pytho0'>, local_finder = None, invoke = <function invoke.<locals>.caller at 0x7f06eb4ba1f0>

    def test_pep582_launcher_for_python_interpreter(project, local_finder, invoke):
        project.root.joinpath("main.py").write_text(
            "import first;print(first.first([0, False, 1, 2]))\n"
        )
        result = invoke(["add", "first"], obj=project)
>       assert result.exit_code == 0, result.stderr
E       AssertionError: See /tmp/pdm-lock-kq790uke.log for detailed debug log.
E         [BadZipFile]: File is not a zip file
E         Add '-v' to see the detailed traceback
E
E       assert 1 == 0
E        +  where 1 = <Result SystemExit(1)>.exit_code

tests/cli/test_run.py:17: AssertionError
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
Changes are written to pyproject.toml.
---------------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------------
INFO     pdm.termui:reporters.py:22 ======== Start resolving requirements ========
INFO     pdm.termui:reporters.py:41   first
INFO     pdm.termui:reporters.py:41   python
INFO     pdm.termui:reporters.py:76   Adding requirement first
DEBUG    pdm.termui:repositories.py:156         Found matching candidates:
DEBUG    pdm.termui:repositories.py:168           <Candidate first 2.0.2 from None>
INFO     pdm.termui:reporters.py:76   Adding requirement python
INFO     pdm.termui:reporters.py:22 ======== Starting round 0 ========
INFO     pdm.termui:reporters.py:22 ======== Ending round 0 ========
INFO     pdm.termui:reporters.py:22 ======== Starting round 1 ========
ERROR    pdm.termui:termui.py:203 Error occurs
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/termui.py", line 200, in logging
    yield logger
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/cli/actions.py", line 95, in do_lock
    mapping, dependencies = resolve(
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/resolver/core.py", line 31, in resolve
    result = resolver.resolve(requirements, max_rounds)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 481, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 373, in resolve
    failure_causes = self._attempt_to_pin_criterion(name)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 213, in _attempt_to_pin_criterion
    criteria = self._get_updated_criteria(candidate)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 203, in _get_updated_criteria
    for requirement in self._p.get_dependencies(candidate=candidate):
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/resolver/providers.py", line 172, in get_dependencies
    deps, requires_python, _ = self.repository.get_dependencies(candidate)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/repositories.py", line 70, in get_dependencies
    requirements, requires_python, summary = getter(candidate)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/repositories.py", line 35, in wrapper
    result = func(self, candidate)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/repositories.py", line 190, in _get_dependencies_from_metadata
    deps = prepared.get_dependencies_from_metadata()
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/candidates.py", line 427, in get_dependencies_from_metadata
    self.req.project_name, self.metadata.requires or [], extras  # type: ignore
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/candidates.py", line 420, in metadata
    self._metadata = self.prepare_metadata()
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/candidates.py", line 389, in prepare_metadata
    self._metadata_dir = _get_wheel_metadata_from_wheel(
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/candidates.py", line 64, in _get_wheel_metadata_from_wheel
    with ZipFile(whl_file) as zipf:
  File "/usr/lib64/python3.8/zipfile.py", line 1269, in __init__
    self._RealGetContents()
  File "/usr/lib64/python3.8/zipfile.py", line 1336, in _RealGetContents
    raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file
_____________________________________________________________________ test_run_script_with_dotenv_file _____________________________________________________________________

project = <Project '/tmp/pytest-of-tkloczko/pytest-109/test_run_script_with_dotenv_fi0'>, invoke = <function invoke.<locals>.caller at 0x7f06ebb58b80>
capfd = <_pytest.capture.CaptureFixture object at 0x7f06eb7e4730>

    def test_run_script_with_dotenv_file(project, invoke, capfd):
        (project.root / "test_script.py").write_text("import os; print(os.getenv('FOO'))")
        project.tool_settings["scripts"] = {
            "test_script": {"cmd": "python test_script.py", "env_file": ".env"}
        }
        project.write_pyproject()
        (project.root / ".env").write_text("FOO=bar")
        capfd.readouterr()
        with cd(project.root):
            invoke(["run", "test_script"], obj=project)
>           assert capfd.readouterr()[0].strip() == "bar"
E           AssertionError: assert '' == 'bar'
E             - bar

tests/cli/test_run.py:207: AssertionError
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
Changes are written to pyproject.toml.
____________________________________________________________________ test_run_with_another_project_root ____________________________________________________________________

project = <Project '/tmp/pytest-of-tkloczko/pytest-109/test_run_with_another_project_0'>, local_finder = None, invoke = <function invoke.<locals>.caller at 0x7f06eb5b15e0>
capfd = <_pytest.capture.CaptureFixture object at 0x7f06eb814df0>

    def test_run_with_another_project_root(project, local_finder, invoke, capfd):
        project.meta["requires-python"] = ">=3.6"
        project.write_pyproject()
        invoke(["add", "first"], obj=project)
        with TemporaryDirectory(prefix="pytest-run-") as tmp_dir:
            Path(tmp_dir).joinpath("main.py").write_text(
                "import first;print(first.first([0, False, 1, 2]))\n"
            )
            capfd.readouterr()
            with cd(tmp_dir):
                ret = invoke(["run", "-p", str(project.root), "python", "main.py"])
>               assert ret.exit_code == 0
E               assert 1 == 0
E                +  where 1 = <Result SystemExit(1)>.exit_code

tests/cli/test_run.py:254: AssertionError
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
Changes are written to pyproject.toml.
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
Traceback (most recent call last):
  File "main.py", line 1, in <module>
    import first;print(first.first([0, False, 1, 2]))
ModuleNotFoundError: No module named 'first'
---------------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------------
INFO     pdm.termui:reporters.py:22 ======== Start resolving requirements ========
INFO     pdm.termui:reporters.py:41   first
INFO     pdm.termui:reporters.py:41   python>=3.6
INFO     pdm.termui:reporters.py:76   Adding requirement first
DEBUG    pdm.termui:repositories.py:156         Found matching candidates:
DEBUG    pdm.termui:repositories.py:168           <Candidate first 2.0.2 from None>
INFO     pdm.termui:reporters.py:76   Adding requirement python>=3.6
INFO     pdm.termui:reporters.py:22 ======== Starting round 0 ========
INFO     pdm.termui:reporters.py:22 ======== Ending round 0 ========
INFO     pdm.termui:reporters.py:22 ======== Starting round 1 ========
ERROR    pdm.termui:termui.py:203 Error occurs
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/termui.py", line 200, in logging
    yield logger
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/cli/actions.py", line 95, in do_lock
    mapping, dependencies = resolve(
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/resolver/core.py", line 31, in resolve
    result = resolver.resolve(requirements, max_rounds)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 481, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 373, in resolve
    failure_causes = self._attempt_to_pin_criterion(name)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 213, in _attempt_to_pin_criterion
    criteria = self._get_updated_criteria(candidate)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 203, in _get_updated_criteria
    for requirement in self._p.get_dependencies(candidate=candidate):
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/resolver/providers.py", line 172, in get_dependencies
    deps, requires_python, _ = self.repository.get_dependencies(candidate)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/repositories.py", line 70, in get_dependencies
    requirements, requires_python, summary = getter(candidate)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/repositories.py", line 35, in wrapper
    result = func(self, candidate)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/repositories.py", line 190, in _get_dependencies_from_metadata
    deps = prepared.get_dependencies_from_metadata()
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/candidates.py", line 427, in get_dependencies_from_metadata
    self.req.project_name, self.metadata.requires or [], extras  # type: ignore
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/candidates.py", line 420, in metadata
    self._metadata = self.prepare_metadata()
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/candidates.py", line 389, in prepare_metadata
    self._metadata_dir = _get_wheel_metadata_from_wheel(
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/candidates.py", line 64, in _get_wheel_metadata_from_wheel
    with ZipFile(whl_file) as zipf:
  File "/usr/lib64/python3.8/zipfile.py", line 1269, in __init__
    self._RealGetContents()
  File "/usr/lib64/python3.8/zipfile.py", line 1336, in _RealGetContents
    raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file
____________________________ test_parse_artifact_metadata[/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/demo-0.0.1.tar.gz] _____________________________

cls = <class 'tarfile.TarFile'>, name = '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/demo-0.0.1.tar.gz', mode = 'r'
fileobj = <gzip on 0x7f06eb0761c0>, compresslevel = 9, kwargs = {'encoding': 'utf-8'}, GzipFile = <class 'gzip.GzipFile'>

    @classmethod
    def gzopen(cls, name, mode="r", fileobj=None, compresslevel=9, **kwargs):
        """Open gzip compressed tar archive name for reading or writing.
           Appending is not allowed.
        """
        if mode not in ("r", "w", "x"):
            raise ValueError("mode must be 'r', 'w' or 'x'")

        try:
            from gzip import GzipFile
        except ImportError:
            raise CompressionError("gzip module is not available")

        try:
            fileobj = GzipFile(name, mode + "b", compresslevel, fileobj)
        except OSError:
            if fileobj is not None and mode == 'r':
                raise ReadError("not a gzip file")
            raise

        try:
>           t = cls.taropen(name, mode, fileobj, **kwargs)

/usr/lib64/python3.8/tarfile.py:1674:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

cls = <class 'tarfile.TarFile'>, name = '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/demo-0.0.1.tar.gz', mode = 'r'
fileobj = <gzip on 0x7f06eb0761c0>, kwargs = {'encoding': 'utf-8'}

    @classmethod
    def taropen(cls, name, mode="r", fileobj=None, **kwargs):
        """Open uncompressed tar archive name for reading or writing.
        """
        if mode not in ("r", "a", "w", "x"):
            raise ValueError("mode must be 'r', 'a', 'w' or 'x'")
>       return cls(name, mode, fileobj, **kwargs)

/usr/lib64/python3.8/tarfile.py:1651:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <tarfile.TarFile object at 0x7f06eb0762b0>, name = '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/demo-0.0.1.tar.gz', mode = 'r'
fileobj = <gzip on 0x7f06eb0761c0>, format = None, tarinfo = None, dereference = None, ignore_zeros = None, encoding = 'utf-8', errors = 'surrogateescape'
pax_headers = None, debug = None, errorlevel = None, copybufsize = None

    def __init__(self, name=None, mode="r", fileobj=None, format=None,
            tarinfo=None, dereference=None, ignore_zeros=None, encoding=None,
            errors="surrogateescape", pax_headers=None, debug=None,
            errorlevel=None, copybufsize=None):
        """Open an (uncompressed) tar archive `name'. `mode' is either 'r' to
           read from an existing archive, 'a' to append data to an existing
           file or 'w' to create a new file overwriting an existing one. `mode'
           defaults to 'r'.
           If `fileobj' is given, it is used for reading or writing data. If it
           can be determined, `mode' is overridden by `fileobj's mode.
           `fileobj' is not closed, when TarFile is closed.
        """
        modes = {"r": "rb", "a": "r+b", "w": "wb", "x": "xb"}
        if mode not in modes:
            raise ValueError("mode must be 'r', 'a', 'w' or 'x'")
        self.mode = mode
        self._mode = modes[mode]

        if not fileobj:
            if self.mode == "a" and not os.path.exists(name):
                # Create nonexistent files in append mode.
                self.mode = "w"
                self._mode = "wb"
            fileobj = bltn_open(name, self._mode)
            self._extfileobj = False
        else:
            if (name is None and hasattr(fileobj, "name") and
                isinstance(fileobj.name, (str, bytes))):
                name = fileobj.name
            if hasattr(fileobj, "mode"):
                self._mode = fileobj.mode
            self._extfileobj = True
        self.name = os.path.abspath(name) if name else None
        self.fileobj = fileobj

        # Init attributes.
        if format is not None:
            self.format = format
        if tarinfo is not None:
            self.tarinfo = tarinfo
        if dereference is not None:
            self.dereference = dereference
        if ignore_zeros is not None:
            self.ignore_zeros = ignore_zeros
        if encoding is not None:
            self.encoding = encoding
        self.errors = errors

        if pax_headers is not None and self.format == PAX_FORMAT:
            self.pax_headers = pax_headers
        else:
            self.pax_headers = {}

        if debug is not None:
            self.debug = debug
        if errorlevel is not None:
            self.errorlevel = errorlevel

        # Init datastructures.
        self.copybufsize = copybufsize
        self.closed = False
        self.members = []       # list of members as TarInfo objects
        self._loaded = False    # flag if all members have been read
        self.offset = self.fileobj.tell()
                                # current position in the archive file
        self.inodes = {}        # dictionary caching the inodes of
                                # archive members already added

        try:
            if self.mode == "r":
                self.firstmember = None
>               self.firstmember = self.next()

/usr/lib64/python3.8/tarfile.py:1514:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <tarfile.TarFile object at 0x7f06eb0762b0>

    def next(self):
        """Return the next member of the archive as a TarInfo object, when
           TarFile is opened for reading. Return None if there is no more
           available.
        """
        self._check("ra")
        if self.firstmember is not None:
            m = self.firstmember
            self.firstmember = None
            return m

        # Advance the file pointer.
        if self.offset != self.fileobj.tell():
            self.fileobj.seek(self.offset - 1)
            if not self.fileobj.read(1):
                raise ReadError("unexpected end of data")

        # Read the next block.
        tarinfo = None
        while True:
            try:
>               tarinfo = self.tarinfo.fromtarfile(self)

/usr/lib64/python3.8/tarfile.py:2318:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

cls = <class 'tarfile.TarInfo'>, tarfile = <tarfile.TarFile object at 0x7f06eb0762b0>

    @classmethod
    def fromtarfile(cls, tarfile):
        """Return the next TarInfo object from TarFile object
           tarfile.
        """
>       buf = tarfile.fileobj.read(BLOCKSIZE)

/usr/lib64/python3.8/tarfile.py:1104:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <gzip on 0x7f06eb0761c0>, size = 512

    def read(self, size=-1):
        self._check_not_closed()
        if self.mode != READ:
            import errno
            raise OSError(errno.EBADF, "read() on write-only GzipFile object")
>       return self._buffer.read(size)

/usr/lib64/python3.8/gzip.py:292:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <gzip._GzipReader object at 0x7f06eb0760d0>, b = <memory at 0x7f06fdac0340>

    def readinto(self, b):
        with memoryview(b) as view, view.cast("B") as byte_view:
>           data = self.read(len(byte_view))

/usr/lib64/python3.8/_compression.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <gzip._GzipReader object at 0x7f06eb0760d0>, size = 8192

    def read(self, size=-1):
        if size < 0:
            return self.readall()
        # size=0 is special because decompress(max_length=0) is not supported
        if not size:
            return b""

        # For certain input data, a single
        # call to decompress() may not return
        # any data. In this case, retry until we get some data or reach EOF.
        while True:
            if self._decompressor.eof:
                # Ending case: we've come to the end of a member in the file,
                # so finish up this member, and read a new gzip header.
                # Check the CRC and file size, and set the flag so we read
                # a new member
                self._read_eof()
                self._new_member = True
                self._decompressor = self._decomp_factory(
                    **self._decomp_args)

            if self._new_member:
                # If the _new_member flag is set, we have to
                # jump to the next member, if there is one.
                self._init_read()
>               if not self._read_gzip_header():

/usr/lib64/python3.8/gzip.py:479:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <gzip._GzipReader object at 0x7f06eb0760d0>

    def _read_gzip_header(self):
        magic = self._fp.read(2)
        if magic == b'':
            return False

        if magic != b'\037\213':
>           raise BadGzipFile('Not a gzipped file (%r)' % magic)
E           gzip.BadGzipFile: Not a gzipped file (b've')

/usr/lib64/python3.8/gzip.py:427: BadGzipFile

During handling of the above exception, another exception occurred:

requirement_line = '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/demo-0.0.1.tar.gz'
project = <Project '/tmp/pytest-of-tkloczko/pytest-109/test_parse_artifact_metadata__0'>

    @pytest.mark.usefixtures("local_finder")
    @pytest.mark.parametrize(
        "requirement_line",
        [
            f"{(FIXTURES / 'artifacts/demo-0.0.1.tar.gz').as_posix()}",
            f"{(FIXTURES / 'artifacts/demo-0.0.1-py2.py3-none-any.whl').as_posix()}",
        ],
    )
    def test_parse_artifact_metadata(requirement_line, project):
        req = parse_requirement(requirement_line)
        candidate = Candidate(req)
>       assert candidate.prepare(project.environment).get_dependencies_from_metadata() == [
            "idna",
            'chardet; os_name == "nt"',
        ]

tests/models/test_candidates.py:56:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/models/candidates.py:427: in get_dependencies_from_metadata
    self.req.project_name, self.metadata.requires or [], extras  # type: ignore
pdm/models/candidates.py:420: in metadata
    self._metadata = self.prepare_metadata()
pdm/models/candidates.py:385: in prepare_metadata
    self.obtain(allow_all=True)
pdm/models/candidates.py:370: in obtain
    downloaded = pip_shims.unpack_url(  # type: ignore
/usr/lib/python3.8/site-packages/pip/_internal/operations/prepare.py:224: in unpack_url
    unpack_file(file.path, location, file.content_type)
/usr/lib/python3.8/site-packages/pip/_internal/utils/unpacking.py:247: in unpack_file
    untar_file(filename, location)
/usr/lib/python3.8/site-packages/pip/_internal/utils/unpacking.py:173: in untar_file
    tar = tarfile.open(filename, mode, encoding="utf-8")
/usr/lib64/python3.8/tarfile.py:1621: in open
    return func(name, filemode, fileobj, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

cls = <class 'tarfile.TarFile'>, name = '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/demo-0.0.1.tar.gz', mode = 'r'
fileobj = <gzip on 0x7f06eb0761c0>, compresslevel = 9, kwargs = {'encoding': 'utf-8'}, GzipFile = <class 'gzip.GzipFile'>

    @classmethod
    def gzopen(cls, name, mode="r", fileobj=None, compresslevel=9, **kwargs):
        """Open gzip compressed tar archive name for reading or writing.
           Appending is not allowed.
        """
        if mode not in ("r", "w", "x"):
            raise ValueError("mode must be 'r', 'w' or 'x'")

        try:
            from gzip import GzipFile
        except ImportError:
            raise CompressionError("gzip module is not available")

        try:
            fileobj = GzipFile(name, mode + "b", compresslevel, fileobj)
        except OSError:
            if fileobj is not None and mode == 'r':
                raise ReadError("not a gzip file")
            raise

        try:
            t = cls.taropen(name, mode, fileobj, **kwargs)
        except OSError:
            fileobj.close()
            if mode == 'r':
>               raise ReadError("not a gzip file")
E               tarfile.ReadError: not a gzip file

/usr/lib64/python3.8/tarfile.py:1678: ReadError
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
Changes are written to pyproject.toml.
_____________________ test_parse_artifact_metadata[/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/demo-0.0.1-py2.py3-none-any.whl] ______________________

requirement_line = '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/demo-0.0.1-py2.py3-none-any.whl'
project = <Project '/tmp/pytest-of-tkloczko/pytest-109/test_parse_artifact_metadata__1'>

    @pytest.mark.usefixtures("local_finder")
    @pytest.mark.parametrize(
        "requirement_line",
        [
            f"{(FIXTURES / 'artifacts/demo-0.0.1.tar.gz').as_posix()}",
            f"{(FIXTURES / 'artifacts/demo-0.0.1-py2.py3-none-any.whl').as_posix()}",
        ],
    )
    def test_parse_artifact_metadata(requirement_line, project):
        req = parse_requirement(requirement_line)
        candidate = Candidate(req)
>       assert candidate.prepare(project.environment).get_dependencies_from_metadata() == [
            "idna",
            'chardet; os_name == "nt"',
        ]

tests/models/test_candidates.py:56:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/models/candidates.py:427: in get_dependencies_from_metadata
    self.req.project_name, self.metadata.requires or [], extras  # type: ignore
pdm/models/candidates.py:420: in metadata
    self._metadata = self.prepare_metadata()
pdm/models/candidates.py:389: in prepare_metadata
    self._metadata_dir = _get_wheel_metadata_from_wheel(
pdm/models/candidates.py:64: in _get_wheel_metadata_from_wheel
    with ZipFile(whl_file) as zipf:
/usr/lib64/python3.8/zipfile.py:1269: in __init__
    self._RealGetContents()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <zipfile.ZipFile [closed]>

    def _RealGetContents(self):
        """Read in the table of contents for the ZIP file."""
        fp = self.fp
        try:
            endrec = _EndRecData(fp)
        except OSError:
            raise BadZipFile("File is not a zip file")
        if not endrec:
>           raise BadZipFile("File is not a zip file")
E           zipfile.BadZipFile: File is not a zip file

/usr/lib64/python3.8/zipfile.py:1336: BadZipFile
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
Changes are written to pyproject.toml.
_____________________________________________________________________ test_parse_metadata_with_extras ______________________________________________________________________

project = <Project '/tmp/pytest-of-tkloczko/pytest-109/test_parse_metadata_with_extra0'>

    @pytest.mark.usefixtures("local_finder")
    def test_parse_metadata_with_extras(project):
        req = parse_requirement(
            f"demo[tests,security] @ file://"
            f"{(FIXTURES / 'artifacts/demo-0.0.1-py2.py3-none-any.whl').as_posix()}"
        )
        candidate = Candidate(req)
        prepared = candidate.prepare(project.environment)
        assert prepared.ireq.is_wheel
>       assert sorted(prepared.get_dependencies_from_metadata()) == [
            "pytest",
            'requests; python_version >= "3.6"',
        ]

tests/models/test_candidates.py:73:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/models/candidates.py:427: in get_dependencies_from_metadata
    self.req.project_name, self.metadata.requires or [], extras  # type: ignore
pdm/models/candidates.py:420: in metadata
    self._metadata = self.prepare_metadata()
pdm/models/candidates.py:389: in prepare_metadata
    self._metadata_dir = _get_wheel_metadata_from_wheel(
pdm/models/candidates.py:64: in _get_wheel_metadata_from_wheel
    with ZipFile(whl_file) as zipf:
/usr/lib64/python3.8/zipfile.py:1269: in __init__
    self._RealGetContents()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <zipfile.ZipFile [closed]>

    def _RealGetContents(self):
        """Read in the table of contents for the ZIP file."""
        fp = self.fp
        try:
            endrec = _EndRecData(fp)
        except OSError:
            raise BadZipFile("File is not a zip file")
        if not endrec:
>           raise BadZipFile("File is not a zip file")
E           zipfile.BadZipFile: File is not a zip file

/usr/lib64/python3.8/zipfile.py:1336: BadZipFile
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
Changes are written to pyproject.toml.
_____________________________________________________________________ test_parse_remote_link_metadata ______________________________________________________________________

project = <Project '/tmp/pytest-of-tkloczko/pytest-109/test_parse_remote_link_metadat0'>

    @pytest.mark.usefixtures("local_finder")
    def test_parse_remote_link_metadata(project):
        req = parse_requirement(
            "http://fixtures.test/artifacts/demo-0.0.1-py2.py3-none-any.whl"
        )
        candidate = Candidate(req)
        prepared = candidate.prepare(project.environment)
        assert prepared.ireq.is_wheel
>       assert prepared.get_dependencies_from_metadata() == [
            "idna",
            'chardet; os_name == "nt"',
        ]

tests/models/test_candidates.py:87:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/models/candidates.py:427: in get_dependencies_from_metadata
    self.req.project_name, self.metadata.requires or [], extras  # type: ignore
pdm/models/candidates.py:420: in metadata
    self._metadata = self.prepare_metadata()
pdm/models/candidates.py:389: in prepare_metadata
    self._metadata_dir = _get_wheel_metadata_from_wheel(
pdm/models/candidates.py:64: in _get_wheel_metadata_from_wheel
    with ZipFile(whl_file) as zipf:
/usr/lib64/python3.8/zipfile.py:1269: in __init__
    self._RealGetContents()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <zipfile.ZipFile [closed]>

    def _RealGetContents(self):
        """Read in the table of contents for the ZIP file."""
        fp = self.fp
        try:
            endrec = _EndRecData(fp)
        except OSError:
            raise BadZipFile("File is not a zip file")
        if not endrec:
>           raise BadZipFile("File is not a zip file")
E           zipfile.BadZipFile: File is not a zip file

/usr/lib64/python3.8/zipfile.py:1336: BadZipFile
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
Changes are written to pyproject.toml.
___________________________________________________________________________ test_extras_warning ____________________________________________________________________________

project = <Project '/tmp/pytest-of-tkloczko/pytest-109/test_extras_warning0'>, recwarn = WarningsRecorder(record=True)

    @pytest.mark.usefixtures("local_finder")
    def test_extras_warning(project, recwarn):
        req = parse_requirement(
            "demo[foo] @ http://fixtures.test/artifacts/demo-0.0.1-py2.py3-none-any.whl"
        )
        candidate = Candidate(req)
        prepared = candidate.prepare(project.environment)
        assert prepared.ireq.is_wheel
>       assert prepared.get_dependencies_from_metadata() == []

tests/models/test_candidates.py:103:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/models/candidates.py:427: in get_dependencies_from_metadata
    self.req.project_name, self.metadata.requires or [], extras  # type: ignore
pdm/models/candidates.py:420: in metadata
    self._metadata = self.prepare_metadata()
pdm/models/candidates.py:389: in prepare_metadata
    self._metadata_dir = _get_wheel_metadata_from_wheel(
pdm/models/candidates.py:64: in _get_wheel_metadata_from_wheel
    with ZipFile(whl_file) as zipf:
/usr/lib64/python3.8/zipfile.py:1269: in __init__
    self._RealGetContents()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <zipfile.ZipFile [closed]>

    def _RealGetContents(self):
        """Read in the table of contents for the ZIP file."""
        fp = self.fp
        try:
            endrec = _EndRecData(fp)
        except OSError:
            raise BadZipFile("File is not a zip file")
        if not endrec:
>           raise BadZipFile("File is not a zip file")
E           zipfile.BadZipFile: File is not a zip file

/usr/lib64/python3.8/zipfile.py:1336: BadZipFile
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
Changes are written to pyproject.toml.
______________________________________________________________________ test_parse_abnormal_specifiers ______________________________________________________________________

project = <Project '/tmp/pytest-of-tkloczko/pytest-109/test_parse_abnormal_specifiers0'>

    @pytest.mark.usefixtures("local_finder")
    def test_parse_abnormal_specifiers(project):
        req = parse_requirement(
            "http://fixtures.test/artifacts/celery-4.4.2-py2.py3-none-any.whl"
        )
        candidate = Candidate(req)
>       assert candidate.prepare(project.environment).get_dependencies_from_metadata()

tests/models/test_candidates.py:116:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/models/candidates.py:427: in get_dependencies_from_metadata
    self.req.project_name, self.metadata.requires or [], extras  # type: ignore
pdm/models/candidates.py:420: in metadata
    self._metadata = self.prepare_metadata()
pdm/models/candidates.py:389: in prepare_metadata
    self._metadata_dir = _get_wheel_metadata_from_wheel(
pdm/models/candidates.py:64: in _get_wheel_metadata_from_wheel
    with ZipFile(whl_file) as zipf:
/usr/lib64/python3.8/zipfile.py:1269: in __init__
    self._RealGetContents()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <zipfile.ZipFile [closed]>

    def _RealGetContents(self):
        """Read in the table of contents for the ZIP file."""
        fp = self.fp
        try:
            endrec = _EndRecData(fp)
        except OSError:
            raise BadZipFile("File is not a zip file")
        if not endrec:
>           raise BadZipFile("File is not a zip file")
E           zipfile.BadZipFile: File is not a zip file

/usr/lib64/python3.8/zipfile.py:1336: BadZipFile
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
Changes are written to pyproject.toml.
_________________________ test_expand_project_root_in_url[demo @ file:///${PROJECT_ROOT}/tests/fixtures/artifacts/demo-0.0.1-py2.py3-none-any.whl] _________________________

req_str = 'demo @ file:///${PROJECT_ROOT}/tests/fixtures/artifacts/demo-0.0.1-py2.py3-none-any.whl', core = <pdm.core.Core object at 0x7f06eb2947c0>

    @pytest.mark.usefixtures("local_finder")
    @pytest.mark.parametrize(
        "req_str",
        [
            "demo @ file:///${PROJECT_ROOT}/tests/fixtures/artifacts"
            "/demo-0.0.1-py2.py3-none-any.whl",
            "demo @ file:///${PROJECT_ROOT}/tests/fixtures/artifacts/demo-0.0.1.tar.gz",
            "demo @ file:///${PROJECT_ROOT}/tests/fixtures/projects/demo",
            "-e ${PROJECT_ROOT}/tests/fixtures/projects/demo",
        ],
    )
    def test_expand_project_root_in_url(req_str, core):
        project = core.create_project(FIXTURES.parent.parent)
        if req_str.startswith("-e "):
            req = parse_requirement(req_str[3:], True)
        else:
            req = parse_requirement(req_str)
        candidate = Candidate(req)
>       assert candidate.prepare(project.environment).get_dependencies_from_metadata() == [
            "idna",
            'chardet; os_name == "nt"',
        ]

tests/models/test_candidates.py:137:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/models/candidates.py:427: in get_dependencies_from_metadata
    self.req.project_name, self.metadata.requires or [], extras  # type: ignore
pdm/models/candidates.py:420: in metadata
    self._metadata = self.prepare_metadata()
pdm/models/candidates.py:389: in prepare_metadata
    self._metadata_dir = _get_wheel_metadata_from_wheel(
pdm/models/candidates.py:64: in _get_wheel_metadata_from_wheel
    with ZipFile(whl_file) as zipf:
/usr/lib64/python3.8/zipfile.py:1269: in __init__
    self._RealGetContents()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <zipfile.ZipFile [closed]>

    def _RealGetContents(self):
        """Read in the table of contents for the ZIP file."""
        fp = self.fp
        try:
            endrec = _EndRecData(fp)
        except OSError:
            raise BadZipFile("File is not a zip file")
        if not endrec:
>           raise BadZipFile("File is not a zip file")
E           zipfile.BadZipFile: File is not a zip file

/usr/lib64/python3.8/zipfile.py:1336: BadZipFile
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
________________________________ test_expand_project_root_in_url[demo @ file:///${PROJECT_ROOT}/tests/fixtures/artifacts/demo-0.0.1.tar.gz] ________________________________

cls = <class 'tarfile.TarFile'>, name = '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/demo-0.0.1.tar.gz', mode = 'r'
fileobj = <gzip on 0x7f06eb1d62b0>, compresslevel = 9, kwargs = {'encoding': 'utf-8'}, GzipFile = <class 'gzip.GzipFile'>

    @classmethod
    def gzopen(cls, name, mode="r", fileobj=None, compresslevel=9, **kwargs):
        """Open gzip compressed tar archive name for reading or writing.
           Appending is not allowed.
        """
        if mode not in ("r", "w", "x"):
            raise ValueError("mode must be 'r', 'w' or 'x'")

        try:
            from gzip import GzipFile
        except ImportError:
            raise CompressionError("gzip module is not available")

        try:
            fileobj = GzipFile(name, mode + "b", compresslevel, fileobj)
        except OSError:
            if fileobj is not None and mode == 'r':
                raise ReadError("not a gzip file")
            raise

        try:
>           t = cls.taropen(name, mode, fileobj, **kwargs)

/usr/lib64/python3.8/tarfile.py:1674:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

cls = <class 'tarfile.TarFile'>, name = '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/demo-0.0.1.tar.gz', mode = 'r'
fileobj = <gzip on 0x7f06eb1d62b0>, kwargs = {'encoding': 'utf-8'}

    @classmethod
    def taropen(cls, name, mode="r", fileobj=None, **kwargs):
        """Open uncompressed tar archive name for reading or writing.
        """
        if mode not in ("r", "a", "w", "x"):
            raise ValueError("mode must be 'r', 'a', 'w' or 'x'")
>       return cls(name, mode, fileobj, **kwargs)

/usr/lib64/python3.8/tarfile.py:1651:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <tarfile.TarFile object at 0x7f06f85568e0>, name = '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/demo-0.0.1.tar.gz', mode = 'r'
fileobj = <gzip on 0x7f06eb1d62b0>, format = None, tarinfo = None, dereference = None, ignore_zeros = None, encoding = 'utf-8', errors = 'surrogateescape'
pax_headers = None, debug = None, errorlevel = None, copybufsize = None

    def __init__(self, name=None, mode="r", fileobj=None, format=None,
            tarinfo=None, dereference=None, ignore_zeros=None, encoding=None,
            errors="surrogateescape", pax_headers=None, debug=None,
            errorlevel=None, copybufsize=None):
        """Open an (uncompressed) tar archive `name'. `mode' is either 'r' to
           read from an existing archive, 'a' to append data to an existing
           file or 'w' to create a new file overwriting an existing one. `mode'
           defaults to 'r'.
           If `fileobj' is given, it is used for reading or writing data. If it
           can be determined, `mode' is overridden by `fileobj's mode.
           `fileobj' is not closed, when TarFile is closed.
        """
        modes = {"r": "rb", "a": "r+b", "w": "wb", "x": "xb"}
        if mode not in modes:
            raise ValueError("mode must be 'r', 'a', 'w' or 'x'")
        self.mode = mode
        self._mode = modes[mode]

        if not fileobj:
            if self.mode == "a" and not os.path.exists(name):
                # Create nonexistent files in append mode.
                self.mode = "w"
                self._mode = "wb"
            fileobj = bltn_open(name, self._mode)
            self._extfileobj = False
        else:
            if (name is None and hasattr(fileobj, "name") and
                isinstance(fileobj.name, (str, bytes))):
                name = fileobj.name
            if hasattr(fileobj, "mode"):
                self._mode = fileobj.mode
            self._extfileobj = True
        self.name = os.path.abspath(name) if name else None
        self.fileobj = fileobj

        # Init attributes.
        if format is not None:
            self.format = format
        if tarinfo is not None:
            self.tarinfo = tarinfo
        if dereference is not None:
            self.dereference = dereference
        if ignore_zeros is not None:
            self.ignore_zeros = ignore_zeros
        if encoding is not None:
            self.encoding = encoding
        self.errors = errors

        if pax_headers is not None and self.format == PAX_FORMAT:
            self.pax_headers = pax_headers
        else:
            self.pax_headers = {}

        if debug is not None:
            self.debug = debug
        if errorlevel is not None:
            self.errorlevel = errorlevel

        # Init datastructures.
        self.copybufsize = copybufsize
        self.closed = False
        self.members = []       # list of members as TarInfo objects
        self._loaded = False    # flag if all members have been read
        self.offset = self.fileobj.tell()
                                # current position in the archive file
        self.inodes = {}        # dictionary caching the inodes of
                                # archive members already added

        try:
            if self.mode == "r":
                self.firstmember = None
>               self.firstmember = self.next()

/usr/lib64/python3.8/tarfile.py:1514:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <tarfile.TarFile object at 0x7f06f85568e0>

    def next(self):
        """Return the next member of the archive as a TarInfo object, when
           TarFile is opened for reading. Return None if there is no more
           available.
        """
        self._check("ra")
        if self.firstmember is not None:
            m = self.firstmember
            self.firstmember = None
            return m

        # Advance the file pointer.
        if self.offset != self.fileobj.tell():
            self.fileobj.seek(self.offset - 1)
            if not self.fileobj.read(1):
                raise ReadError("unexpected end of data")

        # Read the next block.
        tarinfo = None
        while True:
            try:
>               tarinfo = self.tarinfo.fromtarfile(self)

/usr/lib64/python3.8/tarfile.py:2318:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

cls = <class 'tarfile.TarInfo'>, tarfile = <tarfile.TarFile object at 0x7f06f85568e0>

    @classmethod
    def fromtarfile(cls, tarfile):
        """Return the next TarInfo object from TarFile object
           tarfile.
        """
>       buf = tarfile.fileobj.read(BLOCKSIZE)

/usr/lib64/python3.8/tarfile.py:1104:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <gzip on 0x7f06eb1d62b0>, size = 512

    def read(self, size=-1):
        self._check_not_closed()
        if self.mode != READ:
            import errno
            raise OSError(errno.EBADF, "read() on write-only GzipFile object")
>       return self._buffer.read(size)

/usr/lib64/python3.8/gzip.py:292:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <gzip._GzipReader object at 0x7f06eb1d6850>, b = <memory at 0x7f06fdac0340>

    def readinto(self, b):
        with memoryview(b) as view, view.cast("B") as byte_view:
>           data = self.read(len(byte_view))

/usr/lib64/python3.8/_compression.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <gzip._GzipReader object at 0x7f06eb1d6850>, size = 8192

    def read(self, size=-1):
        if size < 0:
            return self.readall()
        # size=0 is special because decompress(max_length=0) is not supported
        if not size:
            return b""

        # For certain input data, a single
        # call to decompress() may not return
        # any data. In this case, retry until we get some data or reach EOF.
        while True:
            if self._decompressor.eof:
                # Ending case: we've come to the end of a member in the file,
                # so finish up this member, and read a new gzip header.
                # Check the CRC and file size, and set the flag so we read
                # a new member
                self._read_eof()
                self._new_member = True
                self._decompressor = self._decomp_factory(
                    **self._decomp_args)

            if self._new_member:
                # If the _new_member flag is set, we have to
                # jump to the next member, if there is one.
                self._init_read()
>               if not self._read_gzip_header():

/usr/lib64/python3.8/gzip.py:479:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <gzip._GzipReader object at 0x7f06eb1d6850>

    def _read_gzip_header(self):
        magic = self._fp.read(2)
        if magic == b'':
            return False

        if magic != b'\037\213':
>           raise BadGzipFile('Not a gzipped file (%r)' % magic)
E           gzip.BadGzipFile: Not a gzipped file (b've')

/usr/lib64/python3.8/gzip.py:427: BadGzipFile

During handling of the above exception, another exception occurred:

req_str = 'demo @ file:///${PROJECT_ROOT}/tests/fixtures/artifacts/demo-0.0.1.tar.gz', core = <pdm.core.Core object at 0x7f06eb48d4f0>

    @pytest.mark.usefixtures("local_finder")
    @pytest.mark.parametrize(
        "req_str",
        [
            "demo @ file:///${PROJECT_ROOT}/tests/fixtures/artifacts"
            "/demo-0.0.1-py2.py3-none-any.whl",
            "demo @ file:///${PROJECT_ROOT}/tests/fixtures/artifacts/demo-0.0.1.tar.gz",
            "demo @ file:///${PROJECT_ROOT}/tests/fixtures/projects/demo",
            "-e ${PROJECT_ROOT}/tests/fixtures/projects/demo",
        ],
    )
    def test_expand_project_root_in_url(req_str, core):
        project = core.create_project(FIXTURES.parent.parent)
        if req_str.startswith("-e "):
            req = parse_requirement(req_str[3:], True)
        else:
            req = parse_requirement(req_str)
        candidate = Candidate(req)
>       assert candidate.prepare(project.environment).get_dependencies_from_metadata() == [
            "idna",
            'chardet; os_name == "nt"',
        ]

tests/models/test_candidates.py:137:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/models/candidates.py:427: in get_dependencies_from_metadata
    self.req.project_name, self.metadata.requires or [], extras  # type: ignore
pdm/models/candidates.py:420: in metadata
    self._metadata = self.prepare_metadata()
pdm/models/candidates.py:385: in prepare_metadata
    self.obtain(allow_all=True)
pdm/models/candidates.py:370: in obtain
    downloaded = pip_shims.unpack_url(  # type: ignore
/usr/lib/python3.8/site-packages/pip/_internal/operations/prepare.py:224: in unpack_url
    unpack_file(file.path, location, file.content_type)
/usr/lib/python3.8/site-packages/pip/_internal/utils/unpacking.py:247: in unpack_file
    untar_file(filename, location)
/usr/lib/python3.8/site-packages/pip/_internal/utils/unpacking.py:173: in untar_file
    tar = tarfile.open(filename, mode, encoding="utf-8")
/usr/lib64/python3.8/tarfile.py:1621: in open
    return func(name, filemode, fileobj, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

cls = <class 'tarfile.TarFile'>, name = '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/demo-0.0.1.tar.gz', mode = 'r'
fileobj = <gzip on 0x7f06eb1d62b0>, compresslevel = 9, kwargs = {'encoding': 'utf-8'}, GzipFile = <class 'gzip.GzipFile'>

    @classmethod
    def gzopen(cls, name, mode="r", fileobj=None, compresslevel=9, **kwargs):
        """Open gzip compressed tar archive name for reading or writing.
           Appending is not allowed.
        """
        if mode not in ("r", "w", "x"):
            raise ValueError("mode must be 'r', 'w' or 'x'")

        try:
            from gzip import GzipFile
        except ImportError:
            raise CompressionError("gzip module is not available")

        try:
            fileobj = GzipFile(name, mode + "b", compresslevel, fileobj)
        except OSError:
            if fileobj is not None and mode == 'r':
                raise ReadError("not a gzip file")
            raise

        try:
            t = cls.taropen(name, mode, fileobj, **kwargs)
        except OSError:
            fileobj.close()
            if mode == 'r':
>               raise ReadError("not a gzip file")
E               tarfile.ReadError: not a gzip file

/usr/lib64/python3.8/tarfile.py:1678: ReadError
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
__________________________________________________________________ test_sdist_candidate_with_wheel_cache ___________________________________________________________________

project = <Project '/tmp/pytest-of-tkloczko/pytest-109/test_sdist_candidate_with_whee0'>, mocker = <pytest_mock.plugin.MockerFixture object at 0x7f06eb680e80>

    @pytest.mark.usefixtures("local_finder")
    def test_sdist_candidate_with_wheel_cache(project, mocker):
        file_link = Link(path_to_url((FIXTURES / "artifacts/demo-0.0.1.tar.gz").as_posix()))
        built_path = (FIXTURES / "artifacts/demo-0.0.1-py2.py3-none-any.whl").as_posix()
        wheel_cache = project.make_wheel_cache()
        cache_path = wheel_cache.get_path_for_link(file_link)
        if not Path(cache_path).exists():
            Path(cache_path).mkdir(parents=True)
        shutil.copy2(built_path, cache_path)
        req = parse_requirement(file_link.url)
        downloader = mocker.patch("pdm.models.pip_shims.unpack_url")
        prepared = Candidate(req).prepare(project.environment)
>       prepared.prepare_metadata()

tests/models/test_candidates.py:250:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/models/candidates.py:389: in prepare_metadata
    self._metadata_dir = _get_wheel_metadata_from_wheel(
pdm/models/candidates.py:64: in _get_wheel_metadata_from_wheel
    with ZipFile(whl_file) as zipf:
/usr/lib64/python3.8/zipfile.py:1269: in __init__
    self._RealGetContents()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <zipfile.ZipFile [closed]>

    def _RealGetContents(self):
        """Read in the table of contents for the ZIP file."""
        fp = self.fp
        try:
            endrec = _EndRecData(fp)
        except OSError:
            raise BadZipFile("File is not a zip file")
        if not endrec:
>           raise BadZipFile("File is not a zip file")
E           zipfile.BadZipFile: File is not a zip file

/usr/lib64/python3.8/zipfile.py:1336: BadZipFile
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
Changes are written to pyproject.toml.
---------------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------------
DEBUG    pdm.termui:candidates.py:460 Using cached wheel link: file:///tmp/pytest-of-tkloczko/pytest-109/test_sdist_candidate_with_whee0/caches/wheels/6c/cb/89/b9c7a61b30b3d26532db46be5af3f6b479d42f701a43fd514e/demo-0.0.1-py2.py3-none-any.whl
________________________________________________________________________ test_cache_egg_info_sdist _________________________________________________________________________

cls = <class 'tarfile.TarFile'>, name = '/tmp/pip-unpack-1cp9l345/demo-0.0.1.tar.gz', mode = 'r', fileobj = <gzip on 0x7f06eb56d910>, compresslevel = 9
kwargs = {'encoding': 'utf-8'}, GzipFile = <class 'gzip.GzipFile'>

    @classmethod
    def gzopen(cls, name, mode="r", fileobj=None, compresslevel=9, **kwargs):
        """Open gzip compressed tar archive name for reading or writing.
           Appending is not allowed.
        """
        if mode not in ("r", "w", "x"):
            raise ValueError("mode must be 'r', 'w' or 'x'")

        try:
            from gzip import GzipFile
        except ImportError:
            raise CompressionError("gzip module is not available")

        try:
            fileobj = GzipFile(name, mode + "b", compresslevel, fileobj)
        except OSError:
            if fileobj is not None and mode == 'r':
                raise ReadError("not a gzip file")
            raise

        try:
>           t = cls.taropen(name, mode, fileobj, **kwargs)

/usr/lib64/python3.8/tarfile.py:1674:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

cls = <class 'tarfile.TarFile'>, name = '/tmp/pip-unpack-1cp9l345/demo-0.0.1.tar.gz', mode = 'r', fileobj = <gzip on 0x7f06eb56d910>, kwargs = {'encoding': 'utf-8'}

    @classmethod
    def taropen(cls, name, mode="r", fileobj=None, **kwargs):
        """Open uncompressed tar archive name for reading or writing.
        """
        if mode not in ("r", "a", "w", "x"):
            raise ValueError("mode must be 'r', 'a', 'w' or 'x'")
>       return cls(name, mode, fileobj, **kwargs)

/usr/lib64/python3.8/tarfile.py:1651:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <tarfile.TarFile object at 0x7f06eb56d0a0>, name = '/tmp/pip-unpack-1cp9l345/demo-0.0.1.tar.gz', mode = 'r', fileobj = <gzip on 0x7f06eb56d910>, format = None
tarinfo = None, dereference = None, ignore_zeros = None, encoding = 'utf-8', errors = 'surrogateescape', pax_headers = None, debug = None, errorlevel = None
copybufsize = None

    def __init__(self, name=None, mode="r", fileobj=None, format=None,
            tarinfo=None, dereference=None, ignore_zeros=None, encoding=None,
            errors="surrogateescape", pax_headers=None, debug=None,
            errorlevel=None, copybufsize=None):
        """Open an (uncompressed) tar archive `name'. `mode' is either 'r' to
           read from an existing archive, 'a' to append data to an existing
           file or 'w' to create a new file overwriting an existing one. `mode'
           defaults to 'r'.
           If `fileobj' is given, it is used for reading or writing data. If it
           can be determined, `mode' is overridden by `fileobj's mode.
           `fileobj' is not closed, when TarFile is closed.
        """
        modes = {"r": "rb", "a": "r+b", "w": "wb", "x": "xb"}
        if mode not in modes:
            raise ValueError("mode must be 'r', 'a', 'w' or 'x'")
        self.mode = mode
        self._mode = modes[mode]

        if not fileobj:
            if self.mode == "a" and not os.path.exists(name):
                # Create nonexistent files in append mode.
                self.mode = "w"
                self._mode = "wb"
            fileobj = bltn_open(name, self._mode)
            self._extfileobj = False
        else:
            if (name is None and hasattr(fileobj, "name") and
                isinstance(fileobj.name, (str, bytes))):
                name = fileobj.name
            if hasattr(fileobj, "mode"):
                self._mode = fileobj.mode
            self._extfileobj = True
        self.name = os.path.abspath(name) if name else None
        self.fileobj = fileobj

        # Init attributes.
        if format is not None:
            self.format = format
        if tarinfo is not None:
            self.tarinfo = tarinfo
        if dereference is not None:
            self.dereference = dereference
        if ignore_zeros is not None:
            self.ignore_zeros = ignore_zeros
        if encoding is not None:
            self.encoding = encoding
        self.errors = errors

        if pax_headers is not None and self.format == PAX_FORMAT:
            self.pax_headers = pax_headers
        else:
            self.pax_headers = {}

        if debug is not None:
            self.debug = debug
        if errorlevel is not None:
            self.errorlevel = errorlevel

        # Init datastructures.
        self.copybufsize = copybufsize
        self.closed = False
        self.members = []       # list of members as TarInfo objects
        self._loaded = False    # flag if all members have been read
        self.offset = self.fileobj.tell()
                                # current position in the archive file
        self.inodes = {}        # dictionary caching the inodes of
                                # archive members already added

        try:
            if self.mode == "r":
                self.firstmember = None
>               self.firstmember = self.next()

/usr/lib64/python3.8/tarfile.py:1514:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <tarfile.TarFile object at 0x7f06eb56d0a0>

    def next(self):
        """Return the next member of the archive as a TarInfo object, when
           TarFile is opened for reading. Return None if there is no more
           available.
        """
        self._check("ra")
        if self.firstmember is not None:
            m = self.firstmember
            self.firstmember = None
            return m

        # Advance the file pointer.
        if self.offset != self.fileobj.tell():
            self.fileobj.seek(self.offset - 1)
            if not self.fileobj.read(1):
                raise ReadError("unexpected end of data")

        # Read the next block.
        tarinfo = None
        while True:
            try:
>               tarinfo = self.tarinfo.fromtarfile(self)

/usr/lib64/python3.8/tarfile.py:2318:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

cls = <class 'tarfile.TarInfo'>, tarfile = <tarfile.TarFile object at 0x7f06eb56d0a0>

    @classmethod
    def fromtarfile(cls, tarfile):
        """Return the next TarInfo object from TarFile object
           tarfile.
        """
>       buf = tarfile.fileobj.read(BLOCKSIZE)

/usr/lib64/python3.8/tarfile.py:1104:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <gzip on 0x7f06eb56d910>, size = 512

    def read(self, size=-1):
        self._check_not_closed()
        if self.mode != READ:
            import errno
            raise OSError(errno.EBADF, "read() on write-only GzipFile object")
>       return self._buffer.read(size)

/usr/lib64/python3.8/gzip.py:292:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <gzip._GzipReader object at 0x7f06eb56d820>, b = <memory at 0x7f06eb0f1040>

    def readinto(self, b):
        with memoryview(b) as view, view.cast("B") as byte_view:
>           data = self.read(len(byte_view))

/usr/lib64/python3.8/_compression.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <gzip._GzipReader object at 0x7f06eb56d820>, size = 8192

    def read(self, size=-1):
        if size < 0:
            return self.readall()
        # size=0 is special because decompress(max_length=0) is not supported
        if not size:
            return b""

        # For certain input data, a single
        # call to decompress() may not return
        # any data. In this case, retry until we get some data or reach EOF.
        while True:
            if self._decompressor.eof:
                # Ending case: we've come to the end of a member in the file,
                # so finish up this member, and read a new gzip header.
                # Check the CRC and file size, and set the flag so we read
                # a new member
                self._read_eof()
                self._new_member = True
                self._decompressor = self._decomp_factory(
                    **self._decomp_args)

            if self._new_member:
                # If the _new_member flag is set, we have to
                # jump to the next member, if there is one.
                self._init_read()
>               if not self._read_gzip_header():

/usr/lib64/python3.8/gzip.py:479:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <gzip._GzipReader object at 0x7f06eb56d820>

    def _read_gzip_header(self):
        magic = self._fp.read(2)
        if magic == b'':
            return False

        if magic != b'\037\213':
>           raise BadGzipFile('Not a gzipped file (%r)' % magic)
E           gzip.BadGzipFile: Not a gzipped file (b've')

/usr/lib64/python3.8/gzip.py:427: BadGzipFile

During handling of the above exception, another exception occurred:

project = <Project '/tmp/pytest-of-tkloczko/pytest-109/test_cache_egg_info_sdist0'>

    @pytest.mark.usefixtures("local_finder")
    def test_cache_egg_info_sdist(project):
        req = parse_requirement("demo @ http://fixtures.test/artifacts/demo-0.0.1.tar.gz")
        candidate = Candidate(req)
>       wheel = candidate.prepare(project.environment).build()

tests/models/test_candidates.py:288:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pdm/models/candidates.py:317: in build
    self.obtain(allow_all=False)
pdm/models/candidates.py:370: in obtain
    downloaded = pip_shims.unpack_url(  # type: ignore
/usr/lib/python3.8/site-packages/pip/_internal/operations/prepare.py:224: in unpack_url
    unpack_file(file.path, location, file.content_type)
/usr/lib/python3.8/site-packages/pip/_internal/utils/unpacking.py:247: in unpack_file
    untar_file(filename, location)
/usr/lib/python3.8/site-packages/pip/_internal/utils/unpacking.py:173: in untar_file
    tar = tarfile.open(filename, mode, encoding="utf-8")
/usr/lib64/python3.8/tarfile.py:1621: in open
    return func(name, filemode, fileobj, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

cls = <class 'tarfile.TarFile'>, name = '/tmp/pip-unpack-1cp9l345/demo-0.0.1.tar.gz', mode = 'r', fileobj = <gzip on 0x7f06eb56d910>, compresslevel = 9
kwargs = {'encoding': 'utf-8'}, GzipFile = <class 'gzip.GzipFile'>

    @classmethod
    def gzopen(cls, name, mode="r", fileobj=None, compresslevel=9, **kwargs):
        """Open gzip compressed tar archive name for reading or writing.
           Appending is not allowed.
        """
        if mode not in ("r", "w", "x"):
            raise ValueError("mode must be 'r', 'w' or 'x'")

        try:
            from gzip import GzipFile
        except ImportError:
            raise CompressionError("gzip module is not available")

        try:
            fileobj = GzipFile(name, mode + "b", compresslevel, fileobj)
        except OSError:
            if fileobj is not None and mode == 'r':
                raise ReadError("not a gzip file")
            raise

        try:
            t = cls.taropen(name, mode, fileobj, **kwargs)
        except OSError:
            fileobj.close()
            if mode == 'r':
>               raise ReadError("not a gzip file")
E               tarfile.ReadError: not a gzip file

/usr/lib64/python3.8/tarfile.py:1678: ReadError
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
Changes are written to pyproject.toml.
____________________________ test_resolve_local_artifacts[/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/demo-0.0.1.tar.gz] _____________________________

cls = <class 'tarfile.TarFile'>, name = '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/demo-0.0.1.tar.gz', mode = 'r'
fileobj = <gzip on 0x7f06eb39ea30>, compresslevel = 9, kwargs = {'encoding': 'utf-8'}, GzipFile = <class 'gzip.GzipFile'>

    @classmethod
    def gzopen(cls, name, mode="r", fileobj=None, compresslevel=9, **kwargs):
        """Open gzip compressed tar archive name for reading or writing.
           Appending is not allowed.
        """
        if mode not in ("r", "w", "x"):
            raise ValueError("mode must be 'r', 'w' or 'x'")

        try:
            from gzip import GzipFile
        except ImportError:
            raise CompressionError("gzip module is not available")

        try:
            fileobj = GzipFile(name, mode + "b", compresslevel, fileobj)
        except OSError:
            if fileobj is not None and mode == 'r':
                raise ReadError("not a gzip file")
            raise

        try:
>           t = cls.taropen(name, mode, fileobj, **kwargs)

/usr/lib64/python3.8/tarfile.py:1674:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

cls = <class 'tarfile.TarFile'>, name = '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/demo-0.0.1.tar.gz', mode = 'r'
fileobj = <gzip on 0x7f06eb39ea30>, kwargs = {'encoding': 'utf-8'}

    @classmethod
    def taropen(cls, name, mode="r", fileobj=None, **kwargs):
        """Open uncompressed tar archive name for reading or writing.
        """
        if mode not in ("r", "a", "w", "x"):
            raise ValueError("mode must be 'r', 'a', 'w' or 'x'")
>       return cls(name, mode, fileobj, **kwargs)

/usr/lib64/python3.8/tarfile.py:1651:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <tarfile.TarFile object at 0x7f06eb39e550>, name = '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/demo-0.0.1.tar.gz', mode = 'r'
fileobj = <gzip on 0x7f06eb39ea30>, format = None, tarinfo = None, dereference = None, ignore_zeros = None, encoding = 'utf-8', errors = 'surrogateescape'
pax_headers = None, debug = None, errorlevel = None, copybufsize = None

    def __init__(self, name=None, mode="r", fileobj=None, format=None,
            tarinfo=None, dereference=None, ignore_zeros=None, encoding=None,
            errors="surrogateescape", pax_headers=None, debug=None,
            errorlevel=None, copybufsize=None):
        """Open an (uncompressed) tar archive `name'. `mode' is either 'r' to
           read from an existing archive, 'a' to append data to an existing
           file or 'w' to create a new file overwriting an existing one. `mode'
           defaults to 'r'.
           If `fileobj' is given, it is used for reading or writing data. If it
           can be determined, `mode' is overridden by `fileobj's mode.
           `fileobj' is not closed, when TarFile is closed.
        """
        modes = {"r": "rb", "a": "r+b", "w": "wb", "x": "xb"}
        if mode not in modes:
            raise ValueError("mode must be 'r', 'a', 'w' or 'x'")
        self.mode = mode
        self._mode = modes[mode]

        if not fileobj:
            if self.mode == "a" and not os.path.exists(name):
                # Create nonexistent files in append mode.
                self.mode = "w"
                self._mode = "wb"
            fileobj = bltn_open(name, self._mode)
            self._extfileobj = False
        else:
            if (name is None and hasattr(fileobj, "name") and
                isinstance(fileobj.name, (str, bytes))):
                name = fileobj.name
            if hasattr(fileobj, "mode"):
                self._mode = fileobj.mode
            self._extfileobj = True
        self.name = os.path.abspath(name) if name else None
        self.fileobj = fileobj

        # Init attributes.
        if format is not None:
            self.format = format
        if tarinfo is not None:
            self.tarinfo = tarinfo
        if dereference is not None:
            self.dereference = dereference
        if ignore_zeros is not None:
            self.ignore_zeros = ignore_zeros
        if encoding is not None:
            self.encoding = encoding
        self.errors = errors

        if pax_headers is not None and self.format == PAX_FORMAT:
            self.pax_headers = pax_headers
        else:
            self.pax_headers = {}

        if debug is not None:
            self.debug = debug
        if errorlevel is not None:
            self.errorlevel = errorlevel

        # Init datastructures.
        self.copybufsize = copybufsize
        self.closed = False
        self.members = []       # list of members as TarInfo objects
        self._loaded = False    # flag if all members have been read
        self.offset = self.fileobj.tell()
                                # current position in the archive file
        self.inodes = {}        # dictionary caching the inodes of
                                # archive members already added

        try:
            if self.mode == "r":
                self.firstmember = None
>               self.firstmember = self.next()

/usr/lib64/python3.8/tarfile.py:1514:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <tarfile.TarFile object at 0x7f06eb39e550>

    def next(self):
        """Return the next member of the archive as a TarInfo object, when
           TarFile is opened for reading. Return None if there is no more
           available.
        """
        self._check("ra")
        if self.firstmember is not None:
            m = self.firstmember
            self.firstmember = None
            return m

        # Advance the file pointer.
        if self.offset != self.fileobj.tell():
            self.fileobj.seek(self.offset - 1)
            if not self.fileobj.read(1):
                raise ReadError("unexpected end of data")

        # Read the next block.
        tarinfo = None
        while True:
            try:
>               tarinfo = self.tarinfo.fromtarfile(self)

/usr/lib64/python3.8/tarfile.py:2318:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

cls = <class 'tarfile.TarInfo'>, tarfile = <tarfile.TarFile object at 0x7f06eb39e550>

    @classmethod
    def fromtarfile(cls, tarfile):
        """Return the next TarInfo object from TarFile object
           tarfile.
        """
>       buf = tarfile.fileobj.read(BLOCKSIZE)

/usr/lib64/python3.8/tarfile.py:1104:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <gzip on 0x7f06eb39ea30>, size = 512

    def read(self, size=-1):
        self._check_not_closed()
        if self.mode != READ:
            import errno
            raise OSError(errno.EBADF, "read() on write-only GzipFile object")
>       return self._buffer.read(size)

/usr/lib64/python3.8/gzip.py:292:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <gzip._GzipReader object at 0x7f06eb39e8b0>, b = <memory at 0x7f06eb0f1f40>

    def readinto(self, b):
        with memoryview(b) as view, view.cast("B") as byte_view:
>           data = self.read(len(byte_view))

/usr/lib64/python3.8/_compression.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <gzip._GzipReader object at 0x7f06eb39e8b0>, size = 8192

    def read(self, size=-1):
        if size < 0:
            return self.readall()
        # size=0 is special because decompress(max_length=0) is not supported
        if not size:
            return b""

        # For certain input data, a single
        # call to decompress() may not return
        # any data. In this case, retry until we get some data or reach EOF.
        while True:
            if self._decompressor.eof:
                # Ending case: we've come to the end of a member in the file,
                # so finish up this member, and read a new gzip header.
                # Check the CRC and file size, and set the flag so we read
                # a new member
                self._read_eof()
                self._new_member = True
                self._decompressor = self._decomp_factory(
                    **self._decomp_args)

            if self._new_member:
                # If the _new_member flag is set, we have to
                # jump to the next member, if there is one.
                self._init_read()
>               if not self._read_gzip_header():

/usr/lib64/python3.8/gzip.py:479:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <gzip._GzipReader object at 0x7f06eb39e8b0>

    def _read_gzip_header(self):
        magic = self._fp.read(2)
        if magic == b'':
            return False

        if magic != b'\037\213':
>           raise BadGzipFile('Not a gzipped file (%r)' % magic)
E           gzip.BadGzipFile: Not a gzipped file (b've')

/usr/lib64/python3.8/gzip.py:427: BadGzipFile

During handling of the above exception, another exception occurred:

resolve = <function resolve.<locals>.resolve_func at 0x7f06eb5df9d0>
requirement_line = '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/demo-0.0.1.tar.gz'

    @pytest.mark.parametrize(
        "requirement_line",
        [
            f"{(FIXTURES / 'artifacts/demo-0.0.1.tar.gz').as_posix()}",
            f"{(FIXTURES / 'artifacts/demo-0.0.1-py2.py3-none-any.whl').as_posix()}",
        ],
    )
    def test_resolve_local_artifacts(resolve, requirement_line):
>       result = resolve([requirement_line], ">=3.6")

tests/resolver/test_resolve.py:102:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/resolver/test_resolve.py:36: in resolve_func
    mapping, *_ = _resolve(
pdm/resolver/core.py:31: in resolve
    result = resolver.resolve(requirements, max_rounds)
/usr/lib/python3.8/site-packages/resolvelib/resolvers.py:481: in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
/usr/lib/python3.8/site-packages/resolvelib/resolvers.py:348: in resolve
    self._add_to_criteria(self.state.criteria, r, parent=None)
/usr/lib/python3.8/site-packages/resolvelib/resolvers.py:147: in _add_to_criteria
    matches = self._p.find_matches(
pdm/resolver/providers.py:145: in find_matches
    candidates = self._find_candidates(reqs[0])
pdm/resolver/providers.py:125: in _find_candidates
    can.prepare(self.repository.environment).prepare_metadata()
pdm/models/candidates.py:385: in prepare_metadata
    self.obtain(allow_all=True)
pdm/models/candidates.py:370: in obtain
    downloaded = pip_shims.unpack_url(  # type: ignore
/usr/lib/python3.8/site-packages/pip/_internal/operations/prepare.py:224: in unpack_url
    unpack_file(file.path, location, file.content_type)
/usr/lib/python3.8/site-packages/pip/_internal/utils/unpacking.py:247: in unpack_file
    untar_file(filename, location)
/usr/lib/python3.8/site-packages/pip/_internal/utils/unpacking.py:173: in untar_file
    tar = tarfile.open(filename, mode, encoding="utf-8")
/usr/lib64/python3.8/tarfile.py:1621: in open
    return func(name, filemode, fileobj, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

cls = <class 'tarfile.TarFile'>, name = '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/demo-0.0.1.tar.gz', mode = 'r'
fileobj = <gzip on 0x7f06eb39ea30>, compresslevel = 9, kwargs = {'encoding': 'utf-8'}, GzipFile = <class 'gzip.GzipFile'>

    @classmethod
    def gzopen(cls, name, mode="r", fileobj=None, compresslevel=9, **kwargs):
        """Open gzip compressed tar archive name for reading or writing.
           Appending is not allowed.
        """
        if mode not in ("r", "w", "x"):
            raise ValueError("mode must be 'r', 'w' or 'x'")

        try:
            from gzip import GzipFile
        except ImportError:
            raise CompressionError("gzip module is not available")

        try:
            fileobj = GzipFile(name, mode + "b", compresslevel, fileobj)
        except OSError:
            if fileobj is not None and mode == 'r':
                raise ReadError("not a gzip file")
            raise

        try:
            t = cls.taropen(name, mode, fileobj, **kwargs)
        except OSError:
            fileobj.close()
            if mode == 'r':
>               raise ReadError("not a gzip file")
E               tarfile.ReadError: not a gzip file

/usr/lib64/python3.8/tarfile.py:1678: ReadError
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
Changes are written to pyproject.toml.
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
See /tmp/pdm-lock-4ecijf_i.log for detailed debug log.
---------------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------------
INFO     pdm.termui:reporters.py:22 ======== Start resolving requirements ========
INFO     pdm.termui:reporters.py:41   demo @ file:///home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/demo-0.0.1.tar.gz
INFO     pdm.termui:reporters.py:41   python>=3.6
INFO     pdm.termui:reporters.py:76   Adding requirement demo @ file:///home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/demo-0.0.1.tar.gz
ERROR    pdm.termui:termui.py:203 Error occurs
Traceback (most recent call last):
  File "/usr/lib64/python3.8/tarfile.py", line 1674, in gzopen
    t = cls.taropen(name, mode, fileobj, **kwargs)
  File "/usr/lib64/python3.8/tarfile.py", line 1651, in taropen
    return cls(name, mode, fileobj, **kwargs)
  File "/usr/lib64/python3.8/tarfile.py", line 1514, in __init__
    self.firstmember = self.next()
  File "/usr/lib64/python3.8/tarfile.py", line 2318, in next
    tarinfo = self.tarinfo.fromtarfile(self)
  File "/usr/lib64/python3.8/tarfile.py", line 1104, in fromtarfile
    buf = tarfile.fileobj.read(BLOCKSIZE)
  File "/usr/lib64/python3.8/gzip.py", line 292, in read
    return self._buffer.read(size)
  File "/usr/lib64/python3.8/_compression.py", line 68, in readinto
    data = self.read(len(byte_view))
  File "/usr/lib64/python3.8/gzip.py", line 479, in read
    if not self._read_gzip_header():
  File "/usr/lib64/python3.8/gzip.py", line 427, in _read_gzip_header
    raise BadGzipFile('Not a gzipped file (%r)' % magic)
gzip.BadGzipFile: Not a gzipped file (b've')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/termui.py", line 200, in logging
    yield logger
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/resolver/test_resolve.py", line 36, in resolve_func
    mapping, *_ = _resolve(
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/resolver/core.py", line 31, in resolve
    result = resolver.resolve(requirements, max_rounds)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 481, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 348, in resolve
    self._add_to_criteria(self.state.criteria, r, parent=None)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 147, in _add_to_criteria
    matches = self._p.find_matches(
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/resolver/providers.py", line 145, in find_matches
    candidates = self._find_candidates(reqs[0])
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/resolver/providers.py", line 125, in _find_candidates
    can.prepare(self.repository.environment).prepare_metadata()
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/candidates.py", line 385, in prepare_metadata
    self.obtain(allow_all=True)
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/candidates.py", line 370, in obtain
    downloaded = pip_shims.unpack_url(  # type: ignore
  File "/usr/lib/python3.8/site-packages/pip/_internal/operations/prepare.py", line 224, in unpack_url
    unpack_file(file.path, location, file.content_type)
  File "/usr/lib/python3.8/site-packages/pip/_internal/utils/unpacking.py", line 247, in unpack_file
    untar_file(filename, location)
  File "/usr/lib/python3.8/site-packages/pip/_internal/utils/unpacking.py", line 173, in untar_file
    tar = tarfile.open(filename, mode, encoding="utf-8")
  File "/usr/lib64/python3.8/tarfile.py", line 1621, in open
    return func(name, filemode, fileobj, **kwargs)
  File "/usr/lib64/python3.8/tarfile.py", line 1678, in gzopen
    raise ReadError("not a gzip file")
tarfile.ReadError: not a gzip file
_____________________ test_resolve_local_artifacts[/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/demo-0.0.1-py2.py3-none-any.whl] ______________________

resolve = <function resolve.<locals>.resolve_func at 0x7f06eaf15e50>
requirement_line = '/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/demo-0.0.1-py2.py3-none-any.whl'

    @pytest.mark.parametrize(
        "requirement_line",
        [
            f"{(FIXTURES / 'artifacts/demo-0.0.1.tar.gz').as_posix()}",
            f"{(FIXTURES / 'artifacts/demo-0.0.1-py2.py3-none-any.whl').as_posix()}",
        ],
    )
    def test_resolve_local_artifacts(resolve, requirement_line):
>       result = resolve([requirement_line], ">=3.6")

tests/resolver/test_resolve.py:102:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/resolver/test_resolve.py:36: in resolve_func
    mapping, *_ = _resolve(
pdm/resolver/core.py:31: in resolve
    result = resolver.resolve(requirements, max_rounds)
/usr/lib/python3.8/site-packages/resolvelib/resolvers.py:481: in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
/usr/lib/python3.8/site-packages/resolvelib/resolvers.py:348: in resolve
    self._add_to_criteria(self.state.criteria, r, parent=None)
/usr/lib/python3.8/site-packages/resolvelib/resolvers.py:147: in _add_to_criteria
    matches = self._p.find_matches(
pdm/resolver/providers.py:145: in find_matches
    candidates = self._find_candidates(reqs[0])
pdm/resolver/providers.py:125: in _find_candidates
    can.prepare(self.repository.environment).prepare_metadata()
pdm/models/candidates.py:389: in prepare_metadata
    self._metadata_dir = _get_wheel_metadata_from_wheel(
pdm/models/candidates.py:64: in _get_wheel_metadata_from_wheel
    with ZipFile(whl_file) as zipf:
/usr/lib64/python3.8/zipfile.py:1269: in __init__
    self._RealGetContents()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <zipfile.ZipFile [closed]>

    def _RealGetContents(self):
        """Read in the table of contents for the ZIP file."""
        fp = self.fp
        try:
            endrec = _EndRecData(fp)
        except OSError:
            raise BadZipFile("File is not a zip file")
        if not endrec:
>           raise BadZipFile("File is not a zip file")
E           zipfile.BadZipFile: File is not a zip file

/usr/lib64/python3.8/zipfile.py:1336: BadZipFile
-------------------------------------------------------------------------- Captured stdout setup ---------------------------------------------------------------------------
Using Python interpreter: /usr/bin/python3.8 (3.8)
Changes are written to pyproject.toml.
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
See /tmp/pdm-lock-pnxy6b1l.log for detailed debug log.
---------------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------------
INFO     pdm.termui:reporters.py:22 ======== Start resolving requirements ========
INFO     pdm.termui:reporters.py:41   demo @ file:///home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/demo-0.0.1-py2.py3-none-any.whl
INFO     pdm.termui:reporters.py:41   python>=3.6
INFO     pdm.termui:reporters.py:76   Adding requirement demo @ file:///home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/demo-0.0.1-py2.py3-none-any.whl
ERROR    pdm.termui:termui.py:203 Error occurs
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/termui.py", line 200, in logging
    yield logger
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/resolver/test_resolve.py", line 36, in resolve_func
    mapping, *_ = _resolve(
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/resolver/core.py", line 31, in resolve
    result = resolver.resolve(requirements, max_rounds)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 481, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 348, in resolve
    self._add_to_criteria(self.state.criteria, r, parent=None)
  File "/usr/lib/python3.8/site-packages/resolvelib/resolvers.py", line 147, in _add_to_criteria
    matches = self._p.find_matches(
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/resolver/providers.py", line 145, in find_matches
    candidates = self._find_candidates(reqs[0])
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/resolver/providers.py", line 125, in _find_candidates
    can.prepare(self.repository.environment).prepare_metadata()
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/candidates.py", line 389, in prepare_metadata
    self._metadata_dir = _get_wheel_metadata_from_wheel(
  File "/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/pdm/models/candidates.py", line 64, in _get_wheel_metadata_from_wheel
    with ZipFile(whl_file) as zipf:
  File "/usr/lib64/python3.8/zipfile.py", line 1269, in __init__
    self._RealGetContents()
  File "/usr/lib64/python3.8/zipfile.py", line 1336, in _RealGetContents
    raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file
========================================================================= short test summary info ==========================================================================
FAILED tests/test_installer.py::test_install_wheel_with_inconsistent_dist_info - zipfile.BadZipFile: File is not a zip file
FAILED tests/test_installer.py::test_install_with_file_existing - zipfile.BadZipFile: File is not a zip file
FAILED tests/test_installer.py::test_uninstall_commit_rollback - zipfile.BadZipFile: File is not a zip file
FAILED tests/test_installer.py::test_rollback_after_commit - zipfile.BadZipFile: File is not a zip file
FAILED tests/test_installer.py::test_uninstall_with_console_scripts[False] - zipfile.BadZipFile: File is not a zip file
FAILED tests/test_installer.py::test_uninstall_with_console_scripts[True] - zipfile.BadZipFile: File is not a zip file
FAILED tests/test_installer.py::test_install_wheel_with_cache - zipfile.BadZipFile: File is not a zip file
FAILED tests/test_installer.py::test_url_requirement_is_not_cached - zipfile.BadZipFile: File is not a zip file
FAILED tests/test_installer.py::test_install_wheel_with_data_scripts[False] - zipfile.BadZipFile: File is not a zip file
FAILED tests/test_installer.py::test_install_wheel_with_data_scripts[True] - zipfile.BadZipFile: File is not a zip file
FAILED tests/test_integration.py::test_basic_integration[2.7] - RuntimeError: Call command ['use', '-f', '2.7'] failed(1): [NoPythonVersion]: Python interpreter is not f...
FAILED tests/test_integration.py::test_basic_integration[3.6] - RuntimeError: Call command ['use', '-f', '3.6'] failed(1): [NoPythonVersion]: Python interpreter is not f...
FAILED tests/test_integration.py::test_basic_integration[3.7] - RuntimeError: Call command ['use', '-f', '3.7'] failed(1): [NoPythonVersion]: Python interpreter is not f...
FAILED tests/test_integration.py::test_basic_integration[3.9] - RuntimeError: Call command ['use', '-f', '3.9'] failed(1): [NoPythonVersion]: Python interpreter is not f...
FAILED tests/test_integration.py::test_actual_list_freeze - RuntimeError: Call command ['add', 'first'] failed(1): See /tmp/pdm-lock-iv3q3a3s.log for detailed debug log.
FAILED tests/test_project.py::test_set_non_exist_python_path - AssertionError: assert PosixPath('/usr/bin/python3.8') == PosixPath('/usr/bin/python3')
FAILED tests/cli/test_add.py::test_add_remote_package_url[False] - zipfile.BadZipFile: File is not a zip file
FAILED tests/cli/test_add.py::test_add_remote_package_url[True] - zipfile.BadZipFile: File is not a zip file
FAILED tests/cli/test_add.py::test_add_cached_vcs_requirement - zipfile.BadZipFile: File is not a zip file
FAILED tests/cli/test_build.py::test_build_single_module - pdm.exceptions.BuildError: Call command ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolated', '--igno...
FAILED tests/cli/test_build.py::test_build_single_module_with_readme - pdm.exceptions.BuildError: Call command ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolat...
FAILED tests/cli/test_build.py::test_build_package - pdm.exceptions.BuildError: Call command ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolated', '--ignore-ins...
FAILED tests/cli/test_build.py::test_build_src_package - pdm.exceptions.BuildError: Call command ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolated', '--ignore...
FAILED tests/cli/test_build.py::test_build_package_include - pdm.exceptions.BuildError: Call command ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolated', '--ig...
FAILED tests/cli/test_build.py::test_build_src_package_by_include - pdm.exceptions.BuildError: Call command ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolated'...
FAILED tests/cli/test_build.py::test_build_with_config_settings - pdm.exceptions.BuildError: Call command ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolated', ...
FAILED tests/cli/test_build.py::test_cli_build_with_config_settings - assert 1 == 0
FAILED tests/cli/test_build.py::test_build_with_no_isolation[False] - assert 1 == 0
FAILED tests/cli/test_build.py::test_build_ignoring_pip_environment - pdm.exceptions.BuildError: Call command ['/usr/bin/python3.8', '-Esm', 'pip', 'install', '--isolate...
FAILED tests/cli/test_cache.py::test_hash_cache[http://fixtures.test/artifacts/demo-0.0.1.tar.gz-sha256:d57bf5e3b8723e4fc68275159dcc4ca983d86d4c84220a4d715d491401f27db2]
FAILED tests/cli/test_cache.py::test_hash_cache[file:///home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/demo-0.0.1.tar.gz-sha256:d57bf5e3b8723e4fc68275159dcc4ca983d86d4c84220a4d715d491401f27db2]
FAILED tests/cli/test_cache.py::test_hash_cache[http://fixtures.test/artifacts/demo-0.0.1.tar.gz#md5=5218509812c9fcb4646adde8fd3307e1-sha256:d57bf5e3b8723e4fc68275159dcc4ca983d86d4c84220a4d715d491401f27db2]
FAILED tests/cli/test_install.py::test_sync_with_index_change - pip._internal.exceptions.HashMismatch: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE....
FAILED tests/cli/test_others.py::test_completion_command - assert 1 == 0
FAILED tests/cli/test_run.py::test_pep582_launcher_for_python_interpreter - AssertionError: See /tmp/pdm-lock-kq790uke.log for detailed debug log.
FAILED tests/cli/test_run.py::test_run_script_with_dotenv_file - AssertionError: assert '' == 'bar'
FAILED tests/cli/test_run.py::test_run_with_another_project_root - assert 1 == 0
FAILED tests/models/test_candidates.py::test_parse_artifact_metadata[/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/demo-0.0.1.tar.gz] - tarfile.ReadE...
FAILED tests/models/test_candidates.py::test_parse_artifact_metadata[/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/demo-0.0.1-py2.py3-none-any.whl]
FAILED tests/models/test_candidates.py::test_parse_metadata_with_extras - zipfile.BadZipFile: File is not a zip file
FAILED tests/models/test_candidates.py::test_parse_remote_link_metadata - zipfile.BadZipFile: File is not a zip file
FAILED tests/models/test_candidates.py::test_extras_warning - zipfile.BadZipFile: File is not a zip file
FAILED tests/models/test_candidates.py::test_parse_abnormal_specifiers - zipfile.BadZipFile: File is not a zip file
FAILED tests/models/test_candidates.py::test_expand_project_root_in_url[demo @ file:///${PROJECT_ROOT}/tests/fixtures/artifacts/demo-0.0.1-py2.py3-none-any.whl] - zipfil...
FAILED tests/models/test_candidates.py::test_expand_project_root_in_url[demo @ file:///${PROJECT_ROOT}/tests/fixtures/artifacts/demo-0.0.1.tar.gz] - tarfile.ReadError: n...
FAILED tests/models/test_candidates.py::test_sdist_candidate_with_wheel_cache - zipfile.BadZipFile: File is not a zip file
FAILED tests/models/test_candidates.py::test_cache_egg_info_sdist - tarfile.ReadError: not a gzip file
FAILED tests/resolver/test_resolve.py::test_resolve_local_artifacts[/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/demo-0.0.1.tar.gz] - tarfile.ReadEr...
FAILED tests/resolver/test_resolve.py::test_resolve_local_artifacts[/home/tkloczko/rpmbuild/BUILD/pdm-1.15.0/tests/fixtures/artifacts/demo-0.0.1-py2.py3-none-any.whl] - ...
================================================================ 49 failed, 339 passed in 247.40s (0:04:07) ================================================================

@frostming
Copy link
Collaborator

The large files are managed by Git LFS and just can't be included in the VCS.

@kloczek
Copy link
Author

kloczek commented May 16, 2022

OK so where I can find missing files? 🤔

@frostming
Copy link
Collaborator

OK so where I can find missing files? 🤔

By Git LFS clone or from the sdist. Those artifacts are separate from the code base and won't break the ability to apply patches I think.

@kloczek
Copy link
Author

kloczek commented May 18, 2022

OK but where is that git repo?

@pawamoy
Copy link
Sponsor Contributor

pawamoy commented May 18, 2022

Check out how git LFS is used on the internet. It should just be a matter of running git lfs pull in the PDM repo.

@kloczek
Copy link
Author

kloczek commented May 18, 2022

Can you drop just URL from which is possible to download missing file(s)?
I don't see over github web interface any large files.

@kloczek
Copy link
Author

kloczek commented May 18, 2022

If you are talking bout content of tests/fixtures/artifacts all those files are included in autogenerated from git tag tar ball which I'm using as input resource https://github.com/pdm-project/pdm/archive/refs/tags/1.15.0.tar.gz

https://github.com/pdm-project/pdm/tree/1.15.0/tests/fixtures/artifacts

@frostming
Copy link
Collaborator

frostming commented May 19, 2022

@kloczek

all those files are included in autogenerated from git tag tarball

Nope, they are only Git LFS spec files, not the real files.

@kloczek
Copy link
Author

kloczek commented May 19, 2022

When I'm building actual package build env is curoff from access to public networ.
Only when I'm nuilding src.rpm tht component have access access to public network, On that stabe best method to asembly that src.rpm is to provide list of URLs from where is possible to download files.
What is the problem with storing those files as regular files?

@frostming
Copy link
Collaborator

Checking in binary files in a git repository is not a good practice. Because Git will store all histories in the .git directory, if the file is a binary the storage is not efficient: it can't store the delta changes like a plain text file.

@kloczek
Copy link
Author

kloczek commented May 19, 2022

I understand .. nevertheless that kind of approach creates kind of difficulty on packaging 🤔
For now I'v added those units in my spec file to --deselect list

%check
%pytest %{!?with_failing_tests: \
        --deselect tests/cli/test_add.py::test_add_cached_vcs_requirement \
        --deselect tests/cli/test_add.py::test_add_remote_package_url[False] \
        --deselect tests/cli/test_add.py::test_add_remote_package_url[True] \
        --deselect tests/cli/test_build.py::test_build_ignoring_pip_environment \
        --deselect tests/cli/test_build.py::test_build_package \
        --deselect tests/cli/test_build.py::test_build_package_include \
        --deselect tests/cli/test_build.py::test_build_single_module \
        --deselect tests/cli/test_build.py::test_build_single_module_with_readme \
        --deselect tests/cli/test_build.py::test_build_src_package \
        --deselect tests/cli/test_build.py::test_build_src_package_by_include \
        --deselect tests/cli/test_build.py::test_build_with_config_settings \
        --deselect tests/cli/test_build.py::test_build_with_no_isolation[False] \
        --deselect tests/cli/test_build.py::test_cli_build_with_config_settings \
        --deselect tests/cli/test_cache.py::test_hash_cache \
        --deselect tests/cli/test_install.py::test_sync_with_index_change \
        --deselect tests/cli/test_others.py::test_completion_command \
        --deselect tests/cli/test_run.py::test_pep582_launcher_for_python_interpreter \
        --deselect tests/cli/test_run.py::test_run_script_with_dotenv_file \
        --deselect tests/cli/test_run.py::test_run_with_another_project_root \
        --deselect tests/models/test_candidates.py \
        --deselect tests/resolver/test_resolve.py \
        --deselect tests/test_installer.py::test_install_wheel_with_cache \
        --deselect tests/test_installer.py::test_install_wheel_with_data_scripts[False] \
        --deselect tests/test_installer.py::test_install_wheel_with_data_scripts[True] \
        --deselect tests/test_installer.py::test_install_wheel_with_inconsistent_dist_info \
        --deselect tests/test_installer.py::test_install_with_file_existing \
        --deselect tests/test_installer.py::test_rollback_after_commit \
        --deselect tests/test_installer.py::test_uninstall_commit_rollback \
        --deselect tests/test_installer.py::test_uninstall_with_console_scripts[False] \
        --deselect tests/test_installer.py::test_uninstall_with_console_scripts[True] \
        --deselect tests/test_installer.py::test_url_requirement_is_not_cached \
        --deselect tests/test_integration.py::test_actual_list_freeze \
        --deselect tests/test_integration.py::test_basic_integration[2.7] \
        --deselect tests/test_integration.py::test_basic_integration[3.6] \
        --deselect tests/test_integration.py::test_basic_integration[3.7] \
        --deselect tests/test_integration.py::test_basic_integration[3.9] \
        --deselect tests/test_project.py::test_set_non_exist_python_path \
}

Looking on aboe list .. some of those units should be probably automatically skipped like units against python 2.x 🤔

@frostming
Copy link
Collaborator

frostming commented May 29, 2022

@kloczek Hi, I've uploaded the artifacts to github release: https://github.com/pdm-project/pdm/releases/download/1.15.0/test-artifacts.tar.gz

Tell me if that works for you. /cc @pombredanne

@frostming frostming linked a pull request May 29, 2022 that will close this issue
2 tasks
@pombredanne
Copy link

@frostming you rock!

@pombredanne
Copy link

@frostming but are you still using git-lfs?

@frostming
Copy link
Collaborator

@frostming but are you still using git-lfs?

Yes

@pombredanne
Copy link

@frostming but are you still using git-lfs?

Yes

Your call, but a standard git installation cannot do a mere checkout which is IMHO an unneeded barrier to entry.

@pombredanne
Copy link

@frostming Thank you ++... you are awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
4 participants