Closed kloczek closed 2 years ago
How do you get the source? If you used git clone or downloaded sdist from PyPI it works perfectly, other ways may not
I'm using source tar ball from git tag. https://github.com/pdm-project/pdm/archive/refs/tags/1.14.1.tar.gz I've checked what is in sdist tar ball and I see that icluded in sdist pyproject.toml file is completly different
--- a//pyproject.toml~ 2022-04-21 02:02:41.000000000 +0000
+++ b//pyproject.toml 1970-01-01 00:00:00.000000000 +0000
@@ -1,12 +1,9 @@
[project]
-# PEP 621 project metadata
-# See https://www.python.org/dev/peps/pep-0621/
authors = [
- {name = "frostming", email = "mianghong@gmail.com"},
+ { name = "frostming", email = "mianghong@gmail.com" },
]
-dynamic = ["version"]
+dynamic = []
requires-python = ">=3.7"
-license = {text = "MIT"}
dependencies = [
"blinker",
"click>=7",
@@ -29,7 +26,11 @@
name = "pdm"
description = "Python Development Master"
readme = "README.md"
-keywords = ["packaging", "dependency", "workflow"]
+keywords = [
+ "packaging",
+ "dependency",
+ "workflow",
+]
classifiers = [
"Topic :: Software Development :: Build Tools",
"Programming Language :: Python :: 3",
@@ -38,6 +39,10 @@
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
]
+version = "1.14.1"
+
+[project.license]
+text = "MIT"
[project.urls]
Homepage = "https://pdm.fming.dev"
@@ -51,27 +56,41 @@
pdm = "pdm.core:main"
[tool.pdm]
-includes = ["pdm"]
-source-includes = ["tests", "CHANGELOG.md", "LICENSE", "README.md"]
-# editables backend doesn't work well with namespace packages
+includes = [
+ "pdm",
+]
+source-includes = [
+ "tests",
+ "CHANGELOG.md",
+ "LICENSE",
+ "README.md",
+]
editable-backend = "path"
-version = {use_scm = true}
+
+[tool.pdm.version]
+use_scm = true
[tool.pdm.scripts]
pre_release = "python tasks/max_versions.py"
release = "python tasks/release.py"
test = "pytest tests/"
-doc = {shell = "cd docs && mkdocs serve", help = "Start the dev server for doc preview"}
lint = "pre-commit run --all-files"
-complete = {call = "tasks.complete:main", help = "Create autocomplete files for bash and fish"}
benchmark = "python tasks/benchmarks/main.py"
+[tool.pdm.scripts.doc]
+shell = "cd docs && mkdocs serve"
+help = "Start the dev server for doc preview"
+
+[tool.pdm.scripts.complete]
+call = "tasks.complete:main"
+help = "Create autocomplete files for bash and fish"
+
[tool.pdm.dev-dependencies]
test = [
"pytest",
"pytest-cov",
"pytest-mock",
- "pytest-xdist>=1.31.0"
+ "pytest-xdist>=1.31.0",
]
doc = [
"mkdocs>=1.1",
@@ -83,27 +102,12 @@
"parver>=0.3.1",
"towncrier>=20",
"vendoring; python_version >= \"3.8\"",
- "pycomplete~=0.3"
+ "pycomplete~=0.3",
]
[tool.black]
line-length = 88
-exclude = '''
-/(
- \.eggs
- | \.git
- | \.hg
- | \.mypy_cache
- | \.tox
- | \.venv
- | _build
- | buck-out
- | build
- | dist
- | pdm/_vendor
- | tests/fixtures
-)/
-'''
+exclude = "/(\n \\.eggs\n | \\.git\n | \\.hg\n | \\.mypy_cache\n | \\.tox\n | \\.venv\n | _build\n | buck-out\n | build\n | dist\n | pdm/_vendor\n | tests/fixtures\n)/\n"
[tool.towncrier]
package = "pdm"
@@ -113,52 +117,27 @@
title_format = "Release v{version} ({project_date})"
template = "news/towncrier_template.md"
underlines = "-~^"
-
- [[tool.towncrier.type]]
- directory = "feature"
- name = "Features & Improvements"
- showcontent = true
-
- [[tool.towncrier.type]]
- directory = "bugfix"
- name = "Bug Fixes"
- showcontent = true
-
- [[tool.towncrier.type]]
- directory = "doc"
- name = "Improved Documentation"
- showcontent = true
-
- [[tool.towncrier.type]]
- directory = "dep"
- name = "Dependencies"
- showcontent = true
-
- [[tool.towncrier.type]]
- directory = "removal"
- name = "Removals and Deprecations"
- showcontent = true
-
- [[tool.towncrier.type]]
- directory = "misc"
- name = "Miscellany"
- showcontent = true
-
- [[tool.towncrier.type]]
- directory = "refactor"
- name = "Refactor"
- showcontent = true
-
-[build-system]
-requires = ["pdm-pep517>=0.12.0"]
-build-backend = "pdm.pep517.api"
+type = [
+ { directory = "feature", name = "Features & Improvements", showcontent = true },
+ { directory = "bugfix", name = "Bug Fixes", showcontent = true },
+ { directory = "doc", name = "Improved Documentation", showcontent = true },
+ { directory = "dep", name = "Dependencies", showcontent = true },
+ { directory = "removal", name = "Removals and Deprecations", showcontent = true },
+ { directory = "misc", name = "Miscellany", showcontent = true },
+ { directory = "refactor", name = "Refactor", showcontent = true },
+]
[tool.isort]
profile = "black"
atomic = true
-skip_glob = ["*/setup.py", "pdm/_vendor/*"]
+skip_glob = [
+ "*/setup.py",
+ "pdm/_vendor/*",
+]
filter_files = true
-known_first_party = ["pdm"]
+known_first_party = [
+ "pdm",
+]
known_third_party = [
"appdirs",
"click",
@@ -169,26 +148,29 @@
"pip_shims",
"pytest",
"pythonfinder",
- "tomlkit"
+ "tomlkit",
]
[tool.vendoring]
destination = "pdm/_vendor/"
requirements = "pdm/_vendor/vendors.txt"
namespace = "pdm._vendor"
-
-protected-files = ["__init__.py", "README.md", "vendors.txt"]
+protected-files = [
+ "__init__.py",
+ "README.md",
+ "vendors.txt",
+]
patches-dir = "tasks/patches"
[tool.vendoring.transformations]
substitute = [
- {match = 'import halo\.', replace = 'import pdm._vendor.halo.'}
+ { match = "import halo\\.", replace = "import pdm._vendor.halo." },
]
drop = [
"bin/",
"*.so",
"typing.*",
- "*/tests/"
+ "*/tests/",
]
[tool.vendoring.typing-stubs]
@@ -204,7 +186,7 @@
[tool.pytest.ini_options]
filterwarnings = [
- "ignore::DeprecationWarning"
+ "ignore::DeprecationWarning",
]
markers = [
"network: Tests that require network",
@@ -213,3 +195,9 @@
"deprecated: Tests about deprecated features",
]
addopts = "-ra"
+
+[build-system]
+requires = [
+ "pdm-pep517>=0.12.0",
+]
+build-backend = "pdm.pep517.api"
Looks like there is no possiblity on using pdm-pep517
to inject version like it is in case for exampe setuptools_scm
which can take version from $SETUPTOOLS_SCM_PRETEND_VERSION
env variable.
How do you get the source? If you used git clone or downloaded sdist from PyPI it works perfectly, other ways may not
So how can I handle that on using autogenerated from git tag source tar ball? 🤔 Reason why I want to have VCS tar ball as inpout rtesource is very simple: becauee I want to have 100% gurantee that that tar ball would be useable on apply any patches taken from commits added after last version tag. To give you kind of context:
[tkloczko@devel-g2v SPECS]$ grep ^Source0:.*VCS python-* | wc -l; ls -1 python-* |wc -l
853
918
Here is for rexmple my current pdb
module rpm spec file
# BUG: broken pep517 build pdm-project/pdm-pep517#89
Summary: Python Development Master
Name: python-pdm
Version: 1.14.1
Release: 2%{dist}
License: MIT (https://opensource.org/licenses/MIT/)
URL: https://pypi.org/project/pdm/
VCS: https://github.com/pdm-project/pdm/
Source0: %{VCS}/archive/%{version}/%{name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python3dist(build)
BuildRequires: python3dist(pdm-pep517)
BuildRequires: python3dist(pip)
BuildRequires: python3dist(setuptools-scm)
BuildRequires: python3dist(wheel)
# CheckRequires:
BuildRequires: python3dist(blinker)
BuildRequires: python3dist(click)
BuildRequires: python3dist(findpython)
BuildRequires: python3dist(installer)
BuildRequires: python3dist(platformdirs)
BuildRequires: python3dist(pytest)
BuildRequires: python3dist(pytest-mock)
BuildRequires: python3dist(resolvelib)
BuildRequires: python3dist(tomlkit)
%description
PDM - Python Development Master
PDM is meant to be a next generation Python package management tool. It was
originally built for personal use. If you feel you are going well with `Pipenv`
or `Poetry` and don't want to introduce another package manager, just stick to
it. But if you are missing something that is not present in those tools, you can
probably find some goodness in `pdm`.
%prep
%autosetup -p1 -n pdm-%{version}
%build
PYTHONPATH=$PWD \
%pyproject_wheel
%install
%pyproject_install
%check
%pytest
%files
%doc docs/*
%{python3_sitelib}/pdm
%{python3_sitelib}/pdm-*.*-info
.. line with 'setuptools-scm` can be removed 😄
Sounds reasonable, is it possible to pull the .git
folder as well? A shallow copy is enough
When that tar ball is generated whole .git content is skipped.
Effectively that tar ball offers only source tree snapshot without git data files.
In other words looks like setuptool_scm
and and pbr
are preparted to be able used without git/scm data ('pbruses
$PBR_VERSIONenv variable) and
pdm-pep517` is not .. 😞
Is it possible to add similar functionality? 🤔
Kust finished integrate https://github.com/pdm-project/pdm-pep517/pull/88 with my build tooling and I was able to generate .whl archive with proper version.
+ /usr/bin/python3 -sBm build -w --no-isolation
* Getting dependencies for wheel...
* Building wheel...
- Adding pdm/__init__.py
- Adding pdm/__main__.py
- Adding pdm/_types.py
- Adding pdm/_vendor/__init__.py
- Adding pdm/_vendor/colorama/LICENSE.txt
- Adding pdm/_vendor/colorama/__init__.py
- Adding pdm/_vendor/colorama/ansi.py
- Adding pdm/_vendor/colorama/ansitowin32.py
- Adding pdm/_vendor/colorama/initialise.py
- Adding pdm/_vendor/colorama/win32.py
- Adding pdm/_vendor/colorama/winterm.py
- Adding pdm/_vendor/halo/LICENSE
- Adding pdm/_vendor/halo/__init__.py
- Adding pdm/_vendor/halo/_utils.py
- Adding pdm/_vendor/halo/cursor.py
- Adding pdm/_vendor/halo/halo.py
- Adding pdm/_vendor/halo/halo_notebook.py
- Adding pdm/_vendor/log_symbols/LICENSE
- Adding pdm/_vendor/log_symbols/__init__.py
- Adding pdm/_vendor/log_symbols/symbols.py
- Adding pdm/_vendor/spinners/LICENSE
- Adding pdm/_vendor/spinners/__init__.py
- Adding pdm/_vendor/spinners/spinners.py
- Adding pdm/_vendor/termcolor.COPYING.txt
- Adding pdm/_vendor/termcolor.py
- Adding pdm/_vendor/vendors.txt
- Adding pdm/builders/__init__.py
- Adding pdm/builders/base.py
- Adding pdm/builders/editable.py
- Adding pdm/builders/sdist.py
- Adding pdm/builders/wheel.py
- Adding pdm/cli/__init__.py
- Adding pdm/cli/actions.py
- Adding pdm/cli/commands/__init__.py
- Adding pdm/cli/commands/add.py
- Adding pdm/cli/commands/base.py
- Adding pdm/cli/commands/build.py
- Adding pdm/cli/commands/cache.py
- Adding pdm/cli/commands/completion.py
- Adding pdm/cli/commands/config.py
- Adding pdm/cli/commands/export.py
- Adding pdm/cli/commands/import_cmd.py
- Adding pdm/cli/commands/info.py
- Adding pdm/cli/commands/init.py
- Adding pdm/cli/commands/install.py
- Adding pdm/cli/commands/list.py
- Adding pdm/cli/commands/lock.py
- Adding pdm/cli/commands/plugin.py
- Adding pdm/cli/commands/remove.py
- Adding pdm/cli/commands/run.py
- Adding pdm/cli/commands/search.py
- Adding pdm/cli/commands/show.py
- Adding pdm/cli/commands/sync.py
- Adding pdm/cli/commands/update.py
- Adding pdm/cli/commands/use.py
- Adding pdm/cli/completions/__init__.py
- Adding pdm/cli/completions/pdm.bash
- Adding pdm/cli/completions/pdm.fish
- Adding pdm/cli/completions/pdm.ps1
- Adding pdm/cli/completions/pdm.zsh
- Adding pdm/cli/options.py
- Adding pdm/cli/utils.py
- Adding pdm/core.py
- Adding pdm/exceptions.py
- Adding pdm/formats/__init__.py
- Adding pdm/formats/base.py
- Adding pdm/formats/flit.py
- Adding pdm/formats/legacy.py
- Adding pdm/formats/pipfile.py
- Adding pdm/formats/poetry.py
- Adding pdm/formats/requirements.py
- Adding pdm/formats/setup_py.py
- Adding pdm/installers/__init__.py
- Adding pdm/installers/installers.py
- Adding pdm/installers/manager.py
- Adding pdm/installers/packages.py
- Adding pdm/installers/synchronizers.py
- Adding pdm/installers/uninstallers.py
- Adding pdm/models/__init__.py
- Adding pdm/models/auth.py
- Adding pdm/models/caches.py
- Adding pdm/models/candidates.py
- Adding pdm/models/environment.py
- Adding pdm/models/in_process/__init__.py
- Adding pdm/models/in_process/get_abi_tag.py
- Adding pdm/models/in_process/pep508.py
- Adding pdm/models/in_process/sysconfig_get_paths.py
- Adding pdm/models/markers.py
- Adding pdm/models/pip_shims.py
- Adding pdm/models/project_info.py
- Adding pdm/models/python.py
- Adding pdm/models/python_max_versions.json
- Adding pdm/models/repositories.py
- Adding pdm/models/requirements.py
- Adding pdm/models/setup.py
- Adding pdm/models/specifiers.py
- Adding pdm/models/versions.py
- Adding pdm/models/working_set.py
- Adding pdm/pep582/sitecustomize.py
- Adding pdm/project/__init__.py
- Adding pdm/project/config.py
- Adding pdm/project/core.py
- Adding pdm/project/metadata.py
- Adding pdm/py.typed
- Adding pdm/resolver/__init__.py
- Adding pdm/resolver/core.py
- Adding pdm/resolver/providers.py
- Adding pdm/resolver/python.py
- Adding pdm/resolver/reporters.py
- Adding pdm/signals.py
- Adding pdm/termui.py
- Adding pdm/utils.py
- Adding pdm-1.14.1.dist-info/entry_points.txt
- Adding pdm-1.14.1.dist-info/WHEEL
- Adding pdm-1.14.1.dist-info/METADATA
- Adding pdm-1.14.1.dist-info/license_files/LICENSE
- Adding pdm-1.14.1.dist-info/RECORD
Successfully built pdm-1.14.1-py3-none-any.whl
Now I see that test suite i sfailing. 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
build
with --no-isolation
I'm using during all processes only locally installed modules
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 [ 29%] tests/cli/test_cache.py .......FF.F. [ 32%] tests/cli/test_config.py ......... [ 35%] tests/cli/test_install.py ...........F..... [ 39%] tests/cli/test_list.py ............ [ 42%] tests/cli/test_others.py .......................F... [ 49%] tests/cli/test_plugin.py ... [ 50%] tests/cli/test_remove.py .......... [ 53%] tests/cli/test_run.py F............F..F..... [ 58%] tests/cli/test_update.py ........... [ 61%] 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-54/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-54/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-54/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-54/test_rollback_after_commit0'>, caplog = <_pytest.logging.LogCaptureFixture object at 0x7f04d24ca880>
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-54/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_consolescripts[True] ____
project = <Project '/tmp/pytest-of-tkloczko/pytest-54/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-54/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-54/test_install_wheel_with_cache0'>, invoke = <function invoke.
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-54/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-54/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-54/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-54/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-54/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 0x7f04d25e2af0>, tmp_path = PosixPath('/tmp/pytest-of-tkloczko/pytest-54/test_basic_integration_2_7_0')
invoke = <function invoke.
@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-54/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 0x7f04d1975700>, tmp_path = PosixPath('/tmp/pytest-of-tkloczko/pytest-54/test_basic_integration_3_6_0')
invoke = <function invoke.
@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-54/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 0x7f04d1975be0>, tmp_path = PosixPath('/tmp/pytest-of-tkloczko/pytest-54/test_basic_integration_3_7_0')
invoke = <function invoke.
@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-54/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 0x7f04d1a8f610>, tmp_path = PosixPath('/tmp/pytest-of-tkloczko/pytest-54/test_basic_integration_3_9_0')
invoke = <function invoke.
@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-54/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-54/test_actual_list_freeze0'>, local_finder = None, invoke = <function invoke.
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-54/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-61hp283a.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.14.1/pdm/termui.py", line 200, in logging yield logger File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/cli/actions.py", line 95, in do_lock mapping, dependencies = resolve( File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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.14.1/pdm/resolver/providers.py", line 172, in get_dependencies deps, requirespython, = self.repository.get_dependencies(candidate) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/models/repositories.py", line 70, in get_dependencies requirements, requires_python, summary = getter(candidate) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/models/repositories.py", line 35, in wrapper result = func(self, candidate) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/models/repositories.py", line 190, in _get_dependencies_from_metadata deps = prepared.get_dependencies_from_metadata() File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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.14.1/pdm/models/candidates.py", line 420, in metadata self._metadata = self.prepare_metadata() File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/models/candidates.py", line 389, in prepare_metadata self._metadata_dir = _get_wheel_metadata_from_wheel( File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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-54/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 0x7f04d09a5490>.executable E + where <pdm.models.python.PythonInfo object at 0x7f04d09a5490> = <Project '/tmp/pytest-of-tkloczko/pytest-54/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-54/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:121:
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-opgararv.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.14.1/pdm/termui.py", line 200, in logging yield logger File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/cli/actions.py", line 95, in do_lock mapping, dependencies = resolve( File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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.14.1/pdm/resolver/providers.py", line 237, in find_matches yield from super().find_matches(identifier, requirements, incompatibilities) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/resolver/providers.py", line 145, in find_matches candidates = self._find_candidates(reqs[0]) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/resolver/providers.py", line 125, in _find_candidates can.prepare(self.repository.environment).prepare_metadata() File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/models/candidates.py", line 389, in prepare_metadata self._metadata_dir = _get_wheel_metadata_from_wheel( File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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_packageurl[True] ____
project = <Project '/tmp/pytest-of-tkloczko/pytest-54/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:121:
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-dv0s3d7e.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.14.1/pdm/termui.py", line 200, in logging yield logger File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/cli/actions.py", line 95, in do_lock mapping, dependencies = resolve( File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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.14.1/pdm/resolver/providers.py", line 237, in find_matches yield from super().find_matches(identifier, requirements, incompatibilities) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/resolver/providers.py", line 145, in find_matches candidates = self._find_candidates(reqs[0]) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/resolver/providers.py", line 125, in _find_candidates can.prepare(self.repository.environment).prepare_metadata() File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/models/candidates.py", line 389, in prepare_metadata self._metadata_dir = _get_wheel_metadata_from_wheel( File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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-54/test_add_cached_vcs_requiremen0'>, mocker = <pytest_mock.plugin.MockerFixture object at 0x7f04d028b4c0>
@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:277:
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-eeikxooh.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-54/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.14.1/pdm/termui.py", line 200, in logging yield logger File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/cli/actions.py", line 95, in do_lock mapping, dependencies = resolve( File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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.14.1/pdm/resolver/providers.py", line 237, in find_matches yield from super().find_matches(identifier, requirements, incompatibilities) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/resolver/providers.py", line 145, in find_matches candidates = self._find_candidates(reqs[0]) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/resolver/providers.py", line 125, in _find_candidates can.prepare(self.repository.environment).prepare_metadata() File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/models/candidates.py", line 389, in prepare_metadata self._metadata_dir = _get_wheel_metadata_from_wheel( File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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_singlemodule ____
fixture_project = <function fixture_project.
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:500: 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-11nm8h0b-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-85qvf56t.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-71nh33pk.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.14.1/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.14.1/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.14.1/pdm/termui.py", line 200, in logging yield logger File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/cli/actions.py", line 500, in do_build loc = SdistBuilder(project.root, project.environment).build( File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/builders/sdist.py", line 16, in build self.install(self._requires, shared=True) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/builders/base.py", line 277, in install self.subprocess_runner(cmd, isolated=False) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/builders/base.py", line 238, in subprocess_runner return log_subprocessor(cmd, cwd, extra_environ=env) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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-11nm8h0b-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-85qvf56t.txt'] return non-zero status(1). ___ test_build_single_module_with_readme ___
fixture_project = <function fixture_project.
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:500: 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-b6mqyq3m-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-7984bgn7.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-xrm8gs0r.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.14.1/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.14.1/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.14.1/pdm/termui.py", line 200, in logging yield logger File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/cli/actions.py", line 500, in do_build loc = SdistBuilder(project.root, project.environment).build( File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/builders/sdist.py", line 16, in build self.install(self._requires, shared=True) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/builders/base.py", line 277, in install self.subprocess_runner(cmd, isolated=False) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/builders/base.py", line 238, in subprocess_runner return log_subprocessor(cmd, cwd, extra_environ=env) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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-b6mqyq3m-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-7984bgn7.txt'] return non-zero status(1). ____ test_build_package ____
fixture_project = <function fixture_project.
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:500: 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-umiynjz2-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-ruvkdji3.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-kwpxpsbo.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.14.1/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.14.1/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.14.1/pdm/termui.py", line 200, in logging yield logger File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/cli/actions.py", line 500, in do_build loc = SdistBuilder(project.root, project.environment).build( File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/builders/sdist.py", line 16, in build self.install(self._requires, shared=True) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/builders/base.py", line 277, in install self.subprocess_runner(cmd, isolated=False) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/builders/base.py", line 238, in subprocess_runner return log_subprocessor(cmd, cwd, extra_environ=env) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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-umiynjz2-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-ruvkdji3.txt'] return non-zero status(1). __ test_build_src_package __
fixture_project = <function fixture_project.
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:500: 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-3oowq879-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-364ad0gb.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-kaz_3ffn.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.14.1/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.14.1/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.14.1/pdm/termui.py", line 200, in logging yield logger File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/cli/actions.py", line 500, in do_build loc = SdistBuilder(project.root, project.environment).build( File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/builders/sdist.py", line 16, in build self.install(self._requires, shared=True) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/builders/base.py", line 277, in install self.subprocess_runner(cmd, isolated=False) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/builders/base.py", line 238, in subprocess_runner return log_subprocessor(cmd, cwd, extra_environ=env) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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-3oowq879-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-364ad0gb.txt'] return non-zero status(1). ____ test_build_package_include ____
fixture_project = <function fixture_project.
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:500: 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-i59ta5_g-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-6xmalloc.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-cgrcb6oh.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.14.1/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.14.1/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.14.1/pdm/termui.py", line 200, in logging yield logger File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/cli/actions.py", line 500, in do_build loc = SdistBuilder(project.root, project.environment).build( File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/builders/sdist.py", line 16, in build self.install(self._requires, shared=True) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/builders/base.py", line 277, in install self.subprocess_runner(cmd, isolated=False) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/builders/base.py", line 238, in subprocess_runner return log_subprocessor(cmd, cwd, extra_environ=env) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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-i59ta5_g-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-6xmalloc.txt'] return non-zero status(1). ____ test_build_src_package_byinclude ____
fixture_project = <function fixture_project.
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:500: 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-i_oqzm1c-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-ed6x9_ge.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-ei98o1g4.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.14.1/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.14.1/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.14.1/pdm/termui.py", line 200, in logging yield logger File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/cli/actions.py", line 500, in do_build loc = SdistBuilder(project.root, project.environment).build( File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/builders/sdist.py", line 16, in build self.install(self._requires, shared=True) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/builders/base.py", line 277, in install self.subprocess_runner(cmd, isolated=False) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/builders/base.py", line 238, in subprocess_runner return log_subprocessor(cmd, cwd, extra_environ=env) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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-i_oqzm1c-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-ed6x9ge.txt'] return non-zero status(1). ____ test_build_with_config_settings __
fixture_project = <function fixture_project.
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:500: 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-e0o0gs69-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-1zdic4ue.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-zvkbgg6o.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.14.1/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.14.1/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.14.1/pdm/termui.py", line 200, in logging yield logger File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/cli/actions.py", line 500, in do_build loc = SdistBuilder(project.root, project.environment).build( File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/builders/sdist.py", line 16, in build self.install(self._requires, shared=True) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/builders/base.py", line 277, in install self.subprocess_runner(cmd, isolated=False) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/builders/base.py", line 238, in subprocess_runner return log_subprocessor(cmd, cwd, extra_environ=env) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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-e0o0gs69-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-1zdic4ue.txt'] return non-zero status(1). _ test_cli_build_with_config_settings __
fixture_project = <function fixture_project.
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.14.1/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.14.1/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.14.1/pdm/termui.py", line 200, in logging yield logger File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/cli/actions.py", line 500, in do_build loc = SdistBuilder(project.root, project.environment).build( File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/builders/sdist.py", line 16, in build self.install(self._requires, shared=True) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/builders/base.py", line 277, in install self.subprocess_runner(cmd, isolated=False) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/builders/base.py", line 238, in subprocess_runner return log_subprocessor(cmd, cwd, extra_environ=env) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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-j425t618-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-9nr8k11o.txt'] return non-zero status(1). ___ test_build_with_no_isolation[False] ____
fixture_project = <function fixture_project.
@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.14.1/pdm/termui.py", line 200, in logging
yield logger
File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/cli/actions.py", line 95, in do_lock
mapping, dependencies = resolve(
File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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.14.1/pdm/resolver/providers.py", line 172, in get_dependencies
deps, requirespython, = self.repository.get_dependencies(candidate)
File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/models/repositories.py", line 70, in get_dependencies
requirements, requires_python, summary = getter(candidate)
File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/models/repositories.py", line 35, in wrapper
result = func(self, candidate)
File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/models/repositories.py", line 190, in _get_dependencies_from_metadata
deps = prepared.get_dependencies_from_metadata()
File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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.14.1/pdm/models/candidates.py", line 420, in metadata
self._metadata = self.prepare_metadata()
File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/models/candidates.py", line 389, in prepare_metadata
self._metadata_dir = _get_wheel_metadata_from_wheel(
File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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-giem8r38-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
fixture_project = <function fixture_project.
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:500: 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-_huot0e3-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-lrffu0ao.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-4kfe3lze.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.14.1/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.14.1/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.14.1/pdm/termui.py", line 200, in logging yield logger File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/cli/actions.py", line 500, in do_build loc = SdistBuilder(project.root, project.environment).build( File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/builders/sdist.py", line 16, in build self.install(self._requires, shared=True) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/builders/base.py", line 277, in install self.subprocess_runner(cmd, isolated=False) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/builders/base.py", line 238, in subprocess_runner return log_subprocessor(cmd, cwd, extra_environ=env) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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-_huot0e3-shared', '--no-index', '--find-links', '/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/tests/fixtures/artifacts', '-r', '/tmp/pdm-build-reqs-lrffu0ao.txt'] return non-zero status(1). ____ test_hashcache[http://fixtures.test/artifacts/demo-0.0.1.tar.gz-sha256:d57bf5e3b8723e4fc68275159dcc4ca983d86d4c84220a4d715d491401f27db2] ____
project = <Project '/tmp/pytest-of-tkloczko/pytest-54/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/testcache.py:163: AssertionError -------------------------------------------------------------------------- Captured stdout setup --------------------------------------------------------------------------- Using Python interpreter: /usr/bin/python3.8 (3.8) Changes are written to pyproject.toml. test_hashcache[file:///home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/tests/fixtures/artifacts/demo-0.0.1.tar.gz-sha256:d57bf5e3b8723e4fc68275159dcc4ca983d86d4c84220a4d715d491401f27db2]
project = <Project '/tmp/pytest-of-tkloczko/pytest-54/test_hash_cache_file____home_t0'> url = 'file:///home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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/testcache.py:163: AssertionError -------------------------------------------------------------------------- Captured stdout setup --------------------------------------------------------------------------- Using Python interpreter: /usr/bin/python3.8 (3.8) Changes are written to pyproject.toml. test_hashcache[http://fixtures.test/artifacts/demo-0.0.1.tar.gz#md5=5218509812c9fcb4646adde8fd3307e1-sha256:d57bf5e3b8723e4fc68275159dcc4ca983d86d4c84220a4d715d491401f27db2]
project = <Project '/tmp/pytest-of-tkloczko/pytest-54/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-54/test_sync_with_index_change0'> index = {'future-fstrings': b'\n \n
\ndef 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, requirespython, = 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 0x7f04ca73b730>, gots = {'sha256': <sha256 HASH object @ 0x7f04ca72da90>}
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-d3lo8e7a.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.14.1/pdm/termui.py", line 200, in logging yield logger File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/cli/actions.py", line 95, in do_lock mapping, dependencies = resolve( File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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.14.1/pdm/resolver/providers.py", line 172, in get_dependencies deps, requirespython, = self.repository.get_dependencies(candidate) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/models/repositories.py", line 70, in get_dependencies requirements, requires_python, summary = getter(candidate) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/models/repositories.py", line 35, in wrapper result = func(self, candidate) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/models/repositories.py", line 190, in _get_dependencies_from_metadata deps = prepared.get_dependencies_from_metadata() File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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.14.1/pdm/models/candidates.py", line 420, in metadata self._metadata = self.prepare_metadata() File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/models/candidates.py", line 385, in prepare_metadata self.obtain(allow_all=True) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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.
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:260: AssertionError _ test_pep582_launcher_for_python_interpreter __
project = <Project '/tmp/pytest-of-tkloczko/pytest-54/test_pep582_launcher_for_pytho0'>, local_finder = None, invoke = <function invoke.
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-ldolpcdt.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.14.1/pdm/termui.py", line 200, in logging yield logger File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/cli/actions.py", line 95, in do_lock mapping, dependencies = resolve( File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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.14.1/pdm/resolver/providers.py", line 172, in get_dependencies deps, requirespython, = self.repository.get_dependencies(candidate) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/models/repositories.py", line 70, in get_dependencies requirements, requires_python, summary = getter(candidate) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/models/repositories.py", line 35, in wrapper result = func(self, candidate) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/models/repositories.py", line 190, in _get_dependencies_from_metadata deps = prepared.get_dependencies_from_metadata() File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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.14.1/pdm/models/candidates.py", line 420, in metadata self._metadata = self.prepare_metadata() File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/models/candidates.py", line 389, in prepare_metadata self._metadata_dir = _get_wheel_metadata_from_wheel( File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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_dotenvfile ____
project = <Project '/tmp/pytest-of-tkloczko/pytest-54/test_run_script_with_dotenv_fi0'>, invoke = <function invoke.
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-54/test_run_with_another_project_0'>, local_finder = None, invoke = <function invoke.
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
cls = <class 'tarfile.TarFile'>, name = '/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/tests/fixtures/artifacts/demo-0.0.1.tar.gz', mode = 'r' fileobj = <gzip on 0x7f04c978e580>, 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.14.1/tests/fixtures/artifacts/demo-0.0.1.tar.gz', mode = 'r' fileobj = <gzip on 0x7f04c978e580>, 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 0x7f04c978ea90>, name = '/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/tests/fixtures/artifacts/demo-0.0.1.tar.gz', mode = 'r' fileobj = <gzip on 0x7f04c978e580>, 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 0x7f04c978ea90>
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 0x7f04c978ea90>
@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 0x7f04c978e580>, 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 0x7f04c978e790>, b = <memory at 0x7f04ca0d3b80>
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 0x7f04c978e790>, 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 0x7f04c978e790>
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.14.1/tests/fixtures/artifacts/demo-0.0.1.tar.gz' project = <Project '/tmp/pytest-of-tkloczko/pytest-54/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.14.1/tests/fixtures/artifacts/demo-0.0.1.tar.gz', mode = 'r' fileobj = <gzip on 0x7f04c978e580>, 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.14.1/tests/fixtures/artifacts/demo-0.0.1-py2.py3-none-any.whl] __
requirement_line = '/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/tests/fixtures/artifacts/demo-0.0.1-py2.py3-none-any.whl' project = <Project '/tmp/pytest-of-tkloczko/pytest-54/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-54/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-54/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-54/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-54/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:///${PROJECTROOT}/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 0x7f04c93d4670>
@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.14.1/tests/fixtures/artifacts/demo-0.0.1.tar.gz', mode = 'r' fileobj = <gzip on 0x7f04c9683610>, 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.14.1/tests/fixtures/artifacts/demo-0.0.1.tar.gz', mode = 'r' fileobj = <gzip on 0x7f04c9683610>, 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 0x7f04c9683130>, name = '/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/tests/fixtures/artifacts/demo-0.0.1.tar.gz', mode = 'r' fileobj = <gzip on 0x7f04c9683610>, 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 0x7f04c9683130>
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 0x7f04c9683130>
@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 0x7f04c9683610>, 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 0x7f04c9683250>, b = <memory at 0x7f04c9727f40>
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 0x7f04c9683250>, 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 0x7f04c9683250>
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 0x7f04ca07fcd0>
@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.14.1/tests/fixtures/artifacts/demo-0.0.1.tar.gz', mode = 'r' fileobj = <gzip on 0x7f04c9683610>, 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-54/test_sdist_candidate_with_whee0'>, mocker = <pytest_mock.plugin.MockerFixture object at 0x7f04c96d5790>
@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-54/test_sdist_candidate_with_whee0/caches/wheels/54/9f/a3/e01a9658dbd7b6370dd7b7b1522d1f0a6604d3433f461f20c6/demo-0.0.1-py2.py3-none-any.whl ____ test_cache_egg_infosdist ____
cls = <class 'tarfile.TarFile'>, name = '/tmp/pip-unpack-6c266rfi/demo-0.0.1.tar.gz', mode = 'r', fileobj = <gzip on 0x7f04c95c7c10>, 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-6c266rfi/demo-0.0.1.tar.gz', mode = 'r', fileobj = <gzip on 0x7f04c95c7c10>, 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 0x7f04c95c78b0>, name = '/tmp/pip-unpack-6c266rfi/demo-0.0.1.tar.gz', mode = 'r', fileobj = <gzip on 0x7f04c95c7c10>, 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 0x7f04c95c78b0>
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 0x7f04c95c78b0>
@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 0x7f04c95c7c10>, 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 0x7f04c95c7070>, b = <memory at 0x7f04ca0d34c0>
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 0x7f04c95c7070>, 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 0x7f04c95c7070>
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-54/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-6c266rfi/demo-0.0.1.tar.gz', mode = 'r', fileobj = <gzip on 0x7f04c95c7c10>, 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_localartifacts[/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/tests/fixtures/artifacts/demo-0.0.1.tar.gz] ____
cls = <class 'tarfile.TarFile'>, name = '/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/tests/fixtures/artifacts/demo-0.0.1.tar.gz', mode = 'r' fileobj = <gzip on 0x7f04ca687c70>, 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.14.1/tests/fixtures/artifacts/demo-0.0.1.tar.gz', mode = 'r' fileobj = <gzip on 0x7f04ca687c70>, 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 0x7f04ca6873a0>, name = '/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/tests/fixtures/artifacts/demo-0.0.1.tar.gz', mode = 'r' fileobj = <gzip on 0x7f04ca687c70>, 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 0x7f04ca6873a0>
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 0x7f04ca6873a0>
@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 0x7f04ca687c70>, 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 0x7f04ca687a30>, b = <memory at 0x7f04ca0d3d00>
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 0x7f04ca687a30>, 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 0x7f04ca687a30>
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.
@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 resolvefunc 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.14.1/tests/fixtures/artifacts/demo-0.0.1.tar.gz', mode = 'r' fileobj = <gzip on 0x7f04ca687c70>, 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-nqbnbhju.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.14.1/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.14.1/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.14.1/pdm/termui.py", line 200, in logging yield logger File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/tests/resolver/test_resolve.py", line 36, in resolvefunc mapping, * = _resolve( File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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.14.1/pdm/resolver/providers.py", line 145, in find_matches candidates = self._find_candidates(reqs[0]) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/resolver/providers.py", line 125, in _find_candidates can.prepare(self.repository.environment).prepare_metadata() File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/models/candidates.py", line 385, in prepare_metadata self.obtain(allow_all=True) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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 untarfile 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.14.1/tests/fixtures/artifacts/demo-0.0.1-py2.py3-none-any.whl] __
resolve = <function resolve.
@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 resolvefunc 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-umzc_c1h.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.14.1/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.14.1/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.14.1/pdm/termui.py", line 200, in logging yield logger File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/tests/resolver/test_resolve.py", line 36, in resolvefunc mapping, * = _resolve( File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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.14.1/pdm/resolver/providers.py", line 145, in find_matches candidates = self._find_candidates(reqs[0]) File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/resolver/providers.py", line 125, in _find_candidates can.prepare(self.repository.environment).prepare_metadata() File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/pdm/models/candidates.py", line 389, in prepare_metadata self._metadata_dir = _get_wheel_metadata_from_wheel( File "/home/tkloczko/rpmbuild/BUILD/pdm-1.14.1/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-61hp283a.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.14.1/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-ldolpcdt.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.14.1/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.14.1/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.14.1/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.14.1/tests/fixtures/artifacts/demo-0.0.1-py2.py3-none-any.whl] - ... ================================================================ 49 failed, 336 passed in 245.34s (0:04:05) ================================================================
At least some of the fails may be caused by missing some modules in buils env Here is what i have so fa in such env
Package Version
--------------- --------------
attrs 21.4.0
blinker 1.4
Brlapi 0.8.3
build 0.7.0
click 8.1.2
codespell 2.1.0
cycler 0.11.0
distro 1.7.0
extras 1.0.0
findpython 0.1.6
fixtures 4.0.0
fonttools 4.33.3
gpg 1.17.1-unknown
iniconfig 1.1.1
installer 0.5.1
kiwisolver 1.3.2
libcomps 0.1.18
louis 3.21.0
matplotlib 3.5.1
numpy 1.22.3
olefile 0.46
packaging 21.3
pbr 5.8.1
pdm-pep517 0.12.4
pep517 0.12.0
Pillow 9.1.0
pip 22.0.4
platformdirs 2.5.2
pluggy 1.0.0
py 1.11.0
PyGObject 3.42.1
pyparsing 3.0.8
pytest 7.1.2
pytest-mock 3.7.0
python-dateutil 2.8.2
resolvelib 0.8.1
rpm 4.17.0
six 1.16.0
testtools 2.5.0
tomli 2.0.1
tomlkit 0.10.2
wheel 0.37.1
Just tested 0.15.0. pytest result seems is the same
+ 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) ================================================================
Those artifacts are managed by git-LFS and not included in the zipball by default. I don't know how I can improve this because we just can't include those big files in the VCS.
Make sure you run commands with
-v
flag before pasting the output.Steps to reproduce
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
Actual behavior
pep517 build peorduces .whl with
0.0.0
version.Environment Information
List of modules installed in build env