summaryrefslogtreecommitdiff
diff options
authorMatthias Klose <doko@debian.org>2021-11-27 09:14:41 +0100
committergit-ubuntu importer <ubuntu-devel-discuss@lists.ubuntu.com>2021-11-27 16:34:46 +0000
commit3b42243e3f6664bf01bcb4104350f3cf3bdfd584 (patch)
treeaba7d42082665317448dedb1fd26e192531483bc
parent5fc4bebb741f5e8193a5827caee9f4af03f94cc8 (diff)
Imported using git-ubuntu import.
Notes
Notes: * New upstream version.
-rw-r--r--.pre-commit-config.yaml6
-rw-r--r--CHANGELOG.rst7
-rw-r--r--PKG-INFO9
-rw-r--r--debian/changelog6
-rw-r--r--docs/tags.rst2
-rw-r--r--packaging.egg-info/PKG-INFO9
-rw-r--r--packaging.egg-info/requires.txt2
-rw-r--r--packaging/__about__.py2
-rw-r--r--packaging/_musllinux.py2
-rw-r--r--packaging/_structures.py6
-rw-r--r--packaging/specifiers.py30
-rw-r--r--packaging/tags.py15
-rw-r--r--setup.py2
-rw-r--r--tests/test_markers.py4
-rw-r--r--tests/test_requirements.py4
-rw-r--r--tests/test_specifiers.py4
-rw-r--r--tests/test_tags.py23
-rw-r--r--tests/test_version.py2
18 files changed, 75 insertions, 60 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index df47a8a..49ae0d4 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -14,6 +14,12 @@ repos:
exclude: '^(docs|tasks|tests)|setup\.py'
args: []
+ - repo: https://github.com/asottile/pyupgrade
+ rev: v2.29.0
+ hooks:
+ - id: pyupgrade
+ args: [--py36-plus]
+
- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 7595e10..f23c303 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,6 +1,13 @@
Changelog
---------
+21.3 - 2021-11-17
+~~~~~~~~~~~~~~~~~
+
+* Add a ``pp3-none-any`` tag (:issue:`311`)
+* Replace the blank pyparsing 3 exclusion with a 3.0.5 exclusion (:issue:`481`, :issue:`486`)
+* Fix a spelling mistake (:issue:`479`)
+
21.2 - 2021-10-29
~~~~~~~~~~~~~~~~~
diff --git a/PKG-INFO b/PKG-INFO
index b59b8ef..66c671b 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: packaging
-Version: 21.2
+Version: 21.3
Summary: Core utilities for Python packages
Home-page: https://github.com/pypa/packaging
Author: Donald Stufft and individual contributors
@@ -104,6 +104,13 @@ recent changes and project history.
Changelog
---------
+21.3 - 2021-11-17
+~~~~~~~~~~~~~~~~~
+
+* Add a ``pp3-none-any`` tag (`#311 <https://github.com/pypa/packaging/issues/311>`__)
+* Replace the blank pyparsing 3 exclusion with a 3.0.5 exclusion (`#481 <https://github.com/pypa/packaging/issues/481>`__, `#486 <https://github.com/pypa/packaging/issues/486>`__)
+* Fix a spelling mistake (`#479 <https://github.com/pypa/packaging/issues/479>`__)
+
21.2 - 2021-10-29
~~~~~~~~~~~~~~~~~
diff --git a/debian/changelog b/debian/changelog
index ed24187..d47e1aa 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+python-packaging (21.3-1) unstable; urgency=medium
+
+ * New upstream version.
+
+ -- Matthias Klose <doko@debian.org> Sat, 27 Nov 2021 09:14:41 +0100
+
python-packaging (21.2-1) unstable; urgency=medium
* New upstream version.
diff --git a/docs/tags.rst b/docs/tags.rst
index bb82728..ecd613b 100644
--- a/docs/tags.rst
+++ b/docs/tags.rst
@@ -190,7 +190,7 @@ to the implementation to provide.
user-provided ABIs via ``abis`` and the ``none`` ABI will be used.
:param Sequence python_version: A one- or two-item sequence representing the
- targetted Python version. Defaults to
+ targeted Python version. Defaults to
``sys.version_info[:2]``.
:param Iterable abis: Iterable of compatible ABIs. Defaults to the ABIs
compatible with the current system.
diff --git a/packaging.egg-info/PKG-INFO b/packaging.egg-info/PKG-INFO
index b59b8ef..66c671b 100644
--- a/packaging.egg-info/PKG-INFO
+++ b/packaging.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: packaging
-Version: 21.2
+Version: 21.3
Summary: Core utilities for Python packages
Home-page: https://github.com/pypa/packaging
Author: Donald Stufft and individual contributors
@@ -104,6 +104,13 @@ recent changes and project history.
Changelog
---------
+21.3 - 2021-11-17
+~~~~~~~~~~~~~~~~~
+
+* Add a ``pp3-none-any`` tag (`#311 <https://github.com/pypa/packaging/issues/311>`__)
+* Replace the blank pyparsing 3 exclusion with a 3.0.5 exclusion (`#481 <https://github.com/pypa/packaging/issues/481>`__, `#486 <https://github.com/pypa/packaging/issues/486>`__)
+* Fix a spelling mistake (`#479 <https://github.com/pypa/packaging/issues/479>`__)
+
21.2 - 2021-10-29
~~~~~~~~~~~~~~~~~
diff --git a/packaging.egg-info/requires.txt b/packaging.egg-info/requires.txt
index 58e7006..f6e4a46 100644
--- a/packaging.egg-info/requires.txt
+++ b/packaging.egg-info/requires.txt
@@ -1 +1 @@
-pyparsing<3,>=2.0.2
+pyparsing!=3.0.5,>=2.0.2
diff --git a/packaging/__about__.py b/packaging/__about__.py
index c359122..3551bc2 100644
--- a/packaging/__about__.py
+++ b/packaging/__about__.py
@@ -17,7 +17,7 @@ __title__ = "packaging"
__summary__ = "Core utilities for Python packages"
__uri__ = "https://github.com/pypa/packaging"
-__version__ = "21.2"
+__version__ = "21.3"
__author__ = "Donald Stufft and individual contributors"
__email__ = "donald@stufft.io"
diff --git a/packaging/_musllinux.py b/packaging/_musllinux.py
index 85450fa..8ac3059 100644
--- a/packaging/_musllinux.py
+++ b/packaging/_musllinux.py
@@ -98,7 +98,7 @@ def _get_musl_version(executable: str) -> Optional[_MuslVersion]:
with contextlib.ExitStack() as stack:
try:
f = stack.enter_context(open(executable, "rb"))
- except IOError:
+ except OSError:
return None
ld = _parse_ld_musl_from_elf(f)
if not ld:
diff --git a/packaging/_structures.py b/packaging/_structures.py
index 9515497..90a6465 100644
--- a/packaging/_structures.py
+++ b/packaging/_structures.py
@@ -19,9 +19,6 @@ class InfinityType:
def __eq__(self, other: object) -> bool:
return isinstance(other, self.__class__)
- def __ne__(self, other: object) -> bool:
- return not isinstance(other, self.__class__)
-
def __gt__(self, other: object) -> bool:
return True
@@ -51,9 +48,6 @@ class NegativeInfinityType:
def __eq__(self, other: object) -> bool:
return isinstance(other, self.__class__)
- def __ne__(self, other: object) -> bool:
- return not isinstance(other, self.__class__)
-
def __gt__(self, other: object) -> bool:
return False
diff --git a/packaging/specifiers.py b/packaging/specifiers.py
index ce66bd4..0e218a6 100644
--- a/packaging/specifiers.py
+++ b/packaging/specifiers.py
@@ -57,13 +57,6 @@ class BaseSpecifier(metaclass=abc.ABCMeta):
objects are equal.
"""
- @abc.abstractmethod
- def __ne__(self, other: object) -> bool:
- """
- Returns a boolean representing whether or not the two Specifier like
- objects are not equal.
- """
-
@abc.abstractproperty
def prereleases(self) -> Optional[bool]:
"""
@@ -119,7 +112,7 @@ class _IndividualSpecifier(BaseSpecifier):
else ""
)
- return "<{}({!r}{})>".format(self.__class__.__name__, str(self), pre)
+ return f"<{self.__class__.__name__}({str(self)!r}{pre})>"
def __str__(self) -> str:
return "{}{}".format(*self._spec)
@@ -142,17 +135,6 @@ class _IndividualSpecifier(BaseSpecifier):
return self._canonical_spec == other._canonical_spec
- def __ne__(self, other: object) -> bool:
- if isinstance(other, str):
- try:
- other = self.__class__(str(other))
- except InvalidSpecifier:
- return NotImplemented
- elif not isinstance(other, self.__class__):
- return NotImplemented
-
- return self._spec != other._spec
-
def _get_operator(self, op: str) -> CallableOperator:
operator_callable: CallableOperator = getattr(
self, f"_compare_{self._operators[op]}"
@@ -667,7 +649,7 @@ class SpecifierSet(BaseSpecifier):
else ""
)
- return "<SpecifierSet({!r}{})>".format(str(self), pre)
+ return f"<SpecifierSet({str(self)!r}{pre})>"
def __str__(self) -> str:
return ",".join(sorted(str(s) for s in self._specs))
@@ -706,14 +688,6 @@ class SpecifierSet(BaseSpecifier):
return self._specs == other._specs
- def __ne__(self, other: object) -> bool:
- if isinstance(other, (str, _IndividualSpecifier)):
- other = SpecifierSet(str(other))
- elif not isinstance(other, SpecifierSet):
- return NotImplemented
-
- return self._specs != other._specs
-
def __len__(self) -> int:
return len(self._specs)
diff --git a/packaging/tags.py b/packaging/tags.py
index e65890a..9a3d25a 100644
--- a/packaging/tags.py
+++ b/packaging/tags.py
@@ -90,7 +90,7 @@ class Tag:
return f"{self._interpreter}-{self._abi}-{self._platform}"
def __repr__(self) -> str:
- return "<{self} @ {self_id}>".format(self=self, self_id=id(self))
+ return f"<{self} @ {id(self)}>"
def parse_tag(tag: str) -> FrozenSet[Tag]:
@@ -192,7 +192,7 @@ def cpython_tags(
if not python_version:
python_version = sys.version_info[:2]
- interpreter = "cp{}".format(_version_nodot(python_version[:2]))
+ interpreter = f"cp{_version_nodot(python_version[:2])}"
if abis is None:
if len(python_version) > 1:
@@ -268,11 +268,11 @@ def _py_interpreter_range(py_version: PythonVersion) -> Iterator[str]:
all previous versions of that major version.
"""
if len(py_version) > 1:
- yield "py{version}".format(version=_version_nodot(py_version[:2]))
- yield "py{major}".format(major=py_version[0])
+ yield f"py{_version_nodot(py_version[:2])}"
+ yield f"py{py_version[0]}"
if len(py_version) > 1:
for minor in range(py_version[1] - 1, -1, -1):
- yield "py{version}".format(version=_version_nodot((py_version[0], minor)))
+ yield f"py{_version_nodot((py_version[0], minor))}"
def compatible_tags(
@@ -481,4 +481,7 @@ def sys_tags(*, warn: bool = False) -> Iterator[Tag]:
else:
yield from generic_tags()
- yield from compatible_tags()
+ if interp_name == "pp":
+ yield from compatible_tags(interpreter="pp3")
+ else:
+ yield from compatible_tags()
diff --git a/setup.py b/setup.py
index c6a1cae..ba1023f 100644
--- a/setup.py
+++ b/setup.py
@@ -48,7 +48,7 @@ setup(
author=about["__author__"],
author_email=about["__email__"],
python_requires=">=3.6",
- install_requires=["pyparsing>=2.0.2,<3"], # Needed to avoid issue #91
+ install_requires=["pyparsing>=2.0.2,!=3.0.5"], # 2.0.2 + needed to avoid issue #91
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
diff --git a/tests/test_markers.py b/tests/test_markers.py
index 64573a9..c2640af 100644
--- a/tests/test_markers.py
+++ b/tests/test_markers.py
@@ -68,7 +68,7 @@ class TestNode:
@pytest.mark.parametrize("value", ["one", "two", None, 3, 5, []])
def test_repr(self, value):
- assert repr(Node(value)) == "<Node({!r})>".format(str(value))
+ assert repr(Node(value)) == f"<Node({str(value)!r})>"
def test_base_class(self):
with pytest.raises(NotImplementedError):
@@ -205,7 +205,7 @@ class TestMarker:
def test_str_and_repr(self, marker_string, expected):
m = Marker(marker_string)
assert str(m) == expected
- assert repr(m) == "<Marker({!r})>".format(str(m))
+ assert repr(m) == f"<Marker({str(m)!r})>"
def test_extra_with_no_extra_in_environment(self):
# We can't evaluate an extra if no extra is passed into the environment
diff --git a/tests/test_requirements.py b/tests/test_requirements.py
index 8cc4568..f2c209c 100644
--- a/tests/test_requirements.py
+++ b/tests/test_requirements.py
@@ -192,4 +192,6 @@ class TestRequirements:
def test_parseexception_error_msg(self):
with pytest.raises(InvalidRequirement) as e:
Requirement("toto 42")
- assert "Expected stringEnd" in str(e.value)
+ assert "Expected stringEnd" in str(e.value) or (
+ "Expected string_end" in str(e.value) # pyparsing>=3.0.0
+ )
diff --git a/tests/test_specifiers.py b/tests/test_specifiers.py
index 0b8e742..ca21fa1 100644
--- a/tests/test_specifiers.py
+++ b/tests/test_specifiers.py
@@ -227,7 +227,7 @@ class TestSpecifier:
spec = Specifier(specifier)
assert str(spec) == expected
- assert repr(spec) == "<Specifier({!r})>".format(expected)
+ assert repr(spec) == f"<Specifier({expected!r})>"
@pytest.mark.parametrize("specifier", SPECIFIERS)
def test_specifiers_hash(self, specifier):
@@ -873,7 +873,7 @@ class TestSpecifierSet:
spec = SpecifierSet(specifier)
assert str(spec) == expected
- assert repr(spec) == "<SpecifierSet({!r})>".format(expected)
+ assert repr(spec) == f"<SpecifierSet({expected!r})>"
@pytest.mark.parametrize("specifier", SPECIFIERS + LEGACY_SPECIFIERS)
def test_specifiers_hash(self, specifier):
diff --git a/tests/test_tags.py b/tests/test_tags.py
index 3b0d317..446dee4 100644
--- a/tests/test_tags.py
+++ b/tests/test_tags.py
@@ -228,12 +228,10 @@ class TestMacOSPlatforms:
platform, "mac_ver", lambda: ("10.14", ("", "", ""), "x86_64")
)
version = platform.mac_ver()[0].split(".")
- if version[0] == "10":
- expected = "macosx_{major}_{minor}".format(
- major=version[0], minor=version[1]
- )
- else:
- expected = "macosx_{major}_{minor}".format(major=version[0], minor=0)
+ major = version[0]
+ minor = version[1] if major == "10" else "0"
+ expected = f"macosx_{major}_{minor}"
+
platforms = list(tags.mac_platforms(arch="x86_64"))
print(platforms, expected)
assert platforms[0].startswith(expected)
@@ -608,7 +606,7 @@ class TestCPythonABI:
def test_pymalloc(self, pymalloc, version, result, monkeypatch):
config = {"Py_DEBUG": 0, "WITH_PYMALLOC": pymalloc, "Py_UNICODE_SIZE": 2}
monkeypatch.setattr(sysconfig, "get_config_var", config.__getitem__)
- base_abi = "cp{}{}".format(version[0], version[1])
+ base_abi = f"cp{version[0]}{version[1]}"
expected = [base_abi + "m" if result else base_abi]
assert tags._cpython_abis(version) == expected
@@ -1180,3 +1178,14 @@ class TestSysTags:
"linux_x86_64",
]
assert platforms == expected
+
+ def test_pypy_first_none_any_tag(self, monkeypatch):
+ # When building the complete list of pypy tags, make sure the first
+ # <interpreter>-none-any one is pp3-none-any
+ monkeypatch.setattr(tags, "interpreter_name", lambda: "pp")
+
+ for tag in tags.sys_tags():
+ if tag.abi == "none" and tag.platform == "any":
+ break
+
+ assert tag == tags.Tag("pp3", "none", "any")
diff --git a/tests/test_version.py b/tests/test_version.py
index 8fe5632..5f2251e 100644
--- a/tests/test_version.py
+++ b/tests/test_version.py
@@ -277,7 +277,7 @@ class TestVersion:
)
def test_version_str_repr(self, version, expected):
assert str(Version(version)) == expected
- assert repr(Version(version)) == "<Version({!r})>".format(expected)
+ assert repr(Version(version)) == f"<Version({expected!r})>"
def test_version_rc_and_c_equals(self):
assert Version("1.0rc1") == Version("1.0c1")