SHA256
1
0
forked from pool/python-pdm

- update to 2.3.3:

* Allow relative paths in `build-system.requires`, since `build` and
    `hatch` both support it. Be aware it is not allowed in the standard.
  * Strip the local part when building a specifier for comparison with the
    package version. This is not permitted by PEP 508 as implemented by
    `packaging 22.0`.
  * Update the version for check_update after self update
  * Fix the matching problem of packages in the lockfile.
  * Exclude `package==22.0` from the dependencies to avoid some breakages to
    the end users. #1568
  * Fix an installation failure when the RECORD file contains commas in the
    file path. #1010
  * Fallback to `pdm.pep517` as the metadata transformer for unknown custom
    build backends. #1546
  * Fix a bug that Ctrl + C kills the python interactive session instead of
    clearing the current line. #1547
  * Fix a bug with egg segment for local dependency #1552
  * Update `installer` to `0.6.0`. #1550
  * Update minimum version of `unearth` to `0.6.3` and test against
    `packaging==22.0`. #1555
  * Fix a resolution loop issue when the current project depends on itself
    and it uses the dynamic version from SCM. #1541
  * Don't give duplicate results when specifying a relative path for `pdm
    use`. #1542
  * Beautify the error message of build errors. Default to showing the last
    10 lines of the build output. #1491
  * Rename the `tool.pdm.overrides` table to
    `tool.pdm.resolution.overrides`. The old name is deprecated at the same
    time. #1503
  * Add backend selection and `--backend` option to `pdm init` command,

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pdm?expand=0&rev=24
This commit is contained in:
Dirk Mueller 2022-12-19 11:50:00 +00:00 committed by Git OBS Bridge
parent aeb3cb44c9
commit 550eb71fcf
5 changed files with 61 additions and 110 deletions

View File

@ -1,100 +0,0 @@
From f8ec8b7bda1b88e60b554b5713ca615c9bf94367 Mon Sep 17 00:00:00 2001
From: Frost Ming <mianghong@gmail.com>
Date: Wed, 16 Nov 2022 09:25:21 +0800
Subject: [PATCH] fix: test against the latest findpython
---
news/1516.bugfix.md | 1 +
src/pdm/cli/actions.py | 16 +++++-----------
src/pdm/models/python.py | 11 +++++++----
tests/cli/test_use.py | 4 ++--
4 files changed, 15 insertions(+), 17 deletions(-)
create mode 100644 news/1516.bugfix.md
--- /dev/null
+++ b/news/1516.bugfix.md
@@ -0,0 +1 @@
+Fix the test failure with the latest `findpython` installed.
--- a/src/pdm/cli/actions.py
+++ b/src/pdm/cli/actions.py
@@ -31,12 +31,7 @@ from pdm.cli.utils import (
set_env_in_reg,
translate_groups,
)
-from pdm.exceptions import (
- InvalidPyVersion,
- NoPythonVersion,
- PdmUsageError,
- ProjectError,
-)
+from pdm.exceptions import NoPythonVersion, PdmUsageError, ProjectError
from pdm.formats import FORMATS
from pdm.formats.base import array_of_inline_tables, make_array, make_inline_table
from pdm.models.caches import JSONFileCache
@@ -584,8 +579,10 @@ def do_use(
python = python.strip()
def version_matcher(py_version: PythonInfo) -> bool:
- return ignore_requires_python or project.python_requires.contains(
- str(py_version.version), True
+ return (
+ ignore_requires_python
+ or py_version.valid
+ and project.python_requires.contains(str(py_version.version), True)
)
if not project.cache_dir.exists():
@@ -647,9 +644,6 @@ def do_use(
if python:
use_cache.set(python, selected_python.path.as_posix())
- if not selected_python.valid:
- path = str(selected_python.path)
- raise InvalidPyVersion(f"Invalid Python interpreter: {path}")
if not save:
return selected_python
old_python = (
--- a/src/pdm/models/python.py
+++ b/src/pdm/models/python.py
@@ -5,7 +5,7 @@ from pathlib import Path
from typing import Any
from findpython import PythonVersion
-from packaging.version import Version
+from packaging.version import InvalidVersion, Version
from pdm.utils import cached_property
@@ -72,6 +72,9 @@ class PythonInfo:
@property
def identifier(self) -> str:
- if os.name == "nt" and self.is_32bit:
- return f"{self.major}.{self.minor}-32"
- return f"{self.major}.{self.minor}"
+ try:
+ if os.name == "nt" and self.is_32bit:
+ return f"{self.major}.{self.minor}-32"
+ return f"{self.major}.{self.minor}"
+ except InvalidVersion:
+ return "unknown"
--- a/tests/cli/test_use.py
+++ b/tests/cli/test_use.py
@@ -6,7 +6,7 @@ from pathlib import Path
import pytest
from pdm.cli import actions
-from pdm.exceptions import InvalidPyVersion
+from pdm.exceptions import NoPythonVersion
from pdm.models.caches import JSONFileCache
@@ -56,7 +56,7 @@ echo hello
shim_path = project.root.joinpath("python_shim.sh")
shim_path.write_text(wrapper_script)
shim_path.chmod(0o755)
- with pytest.raises(InvalidPyVersion):
+ with pytest.raises(NoPythonVersion):
actions.do_use(project, shim_path.as_posix())

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a861d47d57bc6ef9e99edb09abd620955a37b2835019b6a8918beea3b089a3b7
size 2770967

3
pdm-2.3.3.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2897996453bbc834841ab0160f9d90d47744f8c585ee814fa2ee91d3c7840921
size 2877675

View File

@ -1,3 +1,58 @@
-------------------------------------------------------------------
Mon Dec 19 11:43:13 UTC 2022 - Dirk Müller <dmueller@suse.com>
- update to 2.3.3:
* Allow relative paths in `build-system.requires`, since `build` and
`hatch` both support it. Be aware it is not allowed in the standard.
* Strip the local part when building a specifier for comparison with the
package version. This is not permitted by PEP 508 as implemented by
`packaging 22.0`.
* Update the version for check_update after self update
* Fix the matching problem of packages in the lockfile.
* Exclude `package==22.0` from the dependencies to avoid some breakages to
the end users. #1568
* Fix an installation failure when the RECORD file contains commas in the
file path. #1010
* Fallback to `pdm.pep517` as the metadata transformer for unknown custom
build backends. #1546
* Fix a bug that Ctrl + C kills the python interactive session instead of
clearing the current line. #1547
* Fix a bug with egg segment for local dependency #1552
* Update `installer` to `0.6.0`. #1550
* Update minimum version of `unearth` to `0.6.3` and test against
`packaging==22.0`. #1555
* Fix a resolution loop issue when the current project depends on itself
and it uses the dynamic version from SCM. #1541
* Don't give duplicate results when specifying a relative path for `pdm
use`. #1542
* Beautify the error message of build errors. Default to showing the last
10 lines of the build output. #1491
* Rename the `tool.pdm.overrides` table to
`tool.pdm.resolution.overrides`. The old name is deprecated at the same
time. #1503
* Add backend selection and `--backend` option to `pdm init` command,
users can choose a favorite backend from `setuptools`, `flit`,
`hatchling` and `pdm-pep517`(default), since they all support PEP 621
standards. #1504
* Allows specifying the insertion position of user provided arguments in
scripts with the `{args[:default]}` placeholder. #1507
* The local package is now treated specially during installation and
locking. This means it will no longer be included in the lockfile, and
should never be installed twice even when using nested extras. This will
ensure the lockdown stays relevant when the version changes. #1481
* Fix the version diff algorithm of installed packages to consider local
versions as compatible. #1497
* Fix the confusing message when detecting a Python interpreter under
`python.use_venv=False` #1508
* Fix the test failure with the latest `findpython` installed. #1516
* Fix the module missing error of pywin32 in a virtualenv with
`install.cache` set to `true` and caching method is `pth`. #863
* Drop the dependency `pdm-pep517`. #1504
* Replace `pep517` with `pyproject-hooks` because of the rename. #1528
* Remove the support for exporting the project file to a `setup.py`
format, users are encouraged to migrate to the PEP 621 metadata. #1504
- drop findpython-022.patch (upstream)
-------------------------------------------------------------------
Wed Nov 16 08:58:23 UTC 2022 - Matej Cepl <mcepl@suse.com>

View File

@ -26,15 +26,12 @@
%bcond_with test
%endif
Name: python-pdm%{psuffix}
Version: 2.2.1
Version: 2.3.3
Release: 0
Summary: Python Development Master
License: MIT
URL: https://github.com/pdm-project/pdm/
Source0: https://files.pythonhosted.org/packages/source/p/pdm/pdm-%{version}.tar.gz
# PATCH-FIX-UPSTREAM findpython-022.patch gh#pdm-project/pdm#1516 mcepl@suse.com
# Makes the module work with findpython 0.2.2
Patch0: findpython-022.patch
BuildRequires: %{python_module base >= 3.7}
BuildRequires: %{python_module pdm-pep517 >= 1.0}
BuildRequires: %{python_module pip}
@ -51,10 +48,9 @@ Requires: python-python-dotenv >= 0.15
Requires: python-requests-toolbelt
Requires: python-rich >= 12.3.0
Requires: python-shellingham >= 1.3.2
Requires: python-unearth >= 0.6.0
Requires: python-unearth >= 0.6.3
Requires: python-virtualenv >= 20
Requires: (python-installer >= 0.5.1 with python-installer < 0.6)
Requires: (python-pdm-pep517 >= 1.0.0 with python-pdm-pep517 < 2.0.0)
Requires: (python-installer >= 0.6 with python-installer < 0.7)
Requires: (python-resolvelib >= 0.8 with python-resolvelib < 0.9)
Requires: (python-tomlkit >= 0.8.0 with python-tomlkit < 1)
# from python-cachecontrol[filecache]