Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-poetry-core for openSUSE:Factory checked in at 2023-05-30 22:01:41 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-poetry-core (Old) and /work/SRC/openSUSE:Factory/.python-poetry-core.new.1533 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-poetry-core" Tue May 30 22:01:41 2023 rev:17 rq:1089623 version:1.6.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-poetry-core/python-poetry-core.changes 2023-05-23 14:53:51.502239949 +0200 +++ /work/SRC/openSUSE:Factory/.python-poetry-core.new.1533/python-poetry-core.changes 2023-05-30 22:01:41.798746578 +0200 @@ -1,0 +2,10 @@ +Mon May 29 17:00:46 UTC 2023 - Ben Greiner <c...@bnavigator.de> + +- Update to 1.6.1 + * Fix an endless recursion in marker handling (#593). + * Fix an issue where the wheel tag was not built correctly under + certain circumstances (#591). + * Fix an issue where the tests included in the sdist failed due + to missing files (#589). + +------------------------------------------------------------------- Old: ---- poetry-core-1.6.0-gh.tar.gz New: ---- poetry-core-1.6.1-gh.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-poetry-core.spec ++++++ --- /var/tmp/diff_new_pack.5o9EX7/_old 2023-05-30 22:01:42.490750657 +0200 +++ /var/tmp/diff_new_pack.5o9EX7/_new 2023-05-30 22:01:42.494750681 +0200 @@ -18,7 +18,7 @@ %{?sle15_python_module_pythons} Name: python-poetry-core -Version: 1.6.0 +Version: 1.6.1 Release: 0 Summary: Poetry PEP 517 Build Backend License: Apache-2.0 AND BSD-2-Clause AND MIT AND Python-2.0 ++++++ poetry-core-1.6.0-gh.tar.gz -> poetry-core-1.6.1-gh.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poetry-core-1.6.0/.github/workflows/downstream.yml new/poetry-core-1.6.1/.github/workflows/downstream.yml --- old/poetry-core-1.6.0/.github/workflows/downstream.yml 2023-05-14 14:58:06.000000000 +0200 +++ new/poetry-core-1.6.1/.github/workflows/downstream.yml 2023-05-29 09:59:54.000000000 +0200 @@ -11,7 +11,7 @@ runs-on: ubuntu-latest strategy: matrix: - ref: ["master"] + ref: ["master", "1.5"] fail-fast: false defaults: run: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poetry-core-1.6.0/CHANGELOG.md new/poetry-core-1.6.1/CHANGELOG.md --- old/poetry-core-1.6.0/CHANGELOG.md 2023-05-14 14:58:06.000000000 +0200 +++ new/poetry-core-1.6.1/CHANGELOG.md 2023-05-29 09:59:54.000000000 +0200 @@ -1,6 +1,15 @@ # Change Log +## [1.6.1] - 2023-05-29 + +### Fixed + +- Fix an endless recursion in marker handling ([#593](https://github.com/python-poetry/poetry-core/pull/593)). +- Fix an issue where the wheel tag was not built correctly under certain circumstances ([#591](https://github.com/python-poetry/poetry-core/pull/591)). +- Fix an issue where the tests included in the sdist failed due to missing files ([#589](https://github.com/python-poetry/poetry-core/pull/589)). + + ## [1.6.0] - 2023-05-14 ### Added @@ -531,7 +540,8 @@ - Fixed support for stub-only packages ([#28](https://github.com/python-poetry/core/pull/28)). -[Unreleased]: https://github.com/python-poetry/poetry-core/compare/1.6.0...main +[Unreleased]: https://github.com/python-poetry/poetry-core/compare/1.6.1...main +[1.6.1]: https://github.com/python-poetry/poetry-core/releases/tag/1.6.1 [1.6.0]: https://github.com/python-poetry/poetry-core/releases/tag/1.6.0 [1.5.2]: https://github.com/python-poetry/poetry-core/releases/tag/1.5.2 [1.5.1]: https://github.com/python-poetry/poetry-core/releases/tag/1.5.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poetry-core-1.6.0/poetry.lock new/poetry-core-1.6.1/poetry.lock --- old/poetry-core-1.6.0/poetry.lock 2023-05-14 14:58:06.000000000 +0200 +++ new/poetry-core-1.6.1/poetry.lock 2023-05-29 09:59:54.000000000 +0200 @@ -1085,4 +1085,4 @@ [metadata] lock-version = "2.0" python-versions = "^3.7" -content-hash = "e639d315256558561a1c31a5e554a36e14470200885b3d2c44f503dece17212a" +content-hash = "a35979d7ec4637241aaa45fac3373d4669e112f6e79958bd930160c2f0e0da22" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poetry-core-1.6.0/pyproject.toml new/poetry-core-1.6.1/pyproject.toml --- old/poetry-core-1.6.0/pyproject.toml 2023-05-14 14:58:06.000000000 +0200 +++ new/poetry-core-1.6.1/pyproject.toml 2023-05-29 09:59:54.000000000 +0200 @@ -1,36 +1,23 @@ [tool.poetry] name = "poetry-core" -version = "1.6.0" +version = "1.6.1" description = "Poetry PEP 517 Build Backend" authors = ["Sébastien Eustace <sebast...@eustace.io>"] - license = "MIT" - readme = "README.md" - homepage = "https://github.com/python-poetry/poetry-core" repository = "https://github.com/python-poetry/poetry-core" - keywords = ["packaging", "dependency", "poetry"] - classifiers = [ "Topic :: Software Development :: Build Tools", "Topic :: Software Development :: Libraries :: Python Modules" ] - packages = [ { include = "poetry", from = "src" }, ] include = [ { path = "tests", format = "sdist" }, ] -exclude = [ - "**/*.pyc", - "**/*.pyi", -] - -[tool.poetry.build] -generate-setup-file = false [tool.poetry.urls] "Bug Tracker" = "https://github.com/python-poetry/poetry/issues" @@ -41,18 +28,21 @@ # required for compatibility importlib-metadata = {version = ">=1.7.0", python = "<3.8"} -[tool.poetry.dev-dependencies] +[tool.poetry.group.dev.dependencies] pre-commit = ">=2.15.0" -pyrsistent = ">=0.18.0" -pytest = ">=7.1.2" -pytest-cov = ">=3.0.0" -pytest-mock = ">=3.5" tox = ">=3.0" vendoring = {version = ">=1.0", python = "^3.8"} + +[tool.poetry.group.test.dependencies] +pytest = ">=7.1.2" +pytest-cov = ">=3.0.0" +pytest-mock = ">=3.10" build = ">=0.10.0" -mypy = ">=1.0" setuptools = ">=60" tomli-w = "^1.0.0" + +[tool.poetry.group.typing.dependencies] +mypy = ">=1.0" types-jsonschema = ">=4.4.4" types-setuptools = ">=57.4.14" @@ -102,9 +92,7 @@ [tool.black] -line-length = 88 preview = true -include = '\.pyi?$' extend-exclude = "src/poetry/core/_vendor/*" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poetry-core-1.6.0/src/poetry/core/__init__.py new/poetry-core-1.6.1/src/poetry/core/__init__.py --- old/poetry-core-1.6.0/src/poetry/core/__init__.py 2023-05-14 14:58:06.000000000 +0200 +++ new/poetry-core-1.6.1/src/poetry/core/__init__.py 2023-05-29 09:59:54.000000000 +0200 @@ -7,7 +7,7 @@ # this cannot presently be replaced with importlib.metadata.version as when building # itself, poetry-core is not available as an installed distribution. -__version__ = "1.6.0" +__version__ = "1.6.1" __vendor_site__ = (Path(__file__).parent / "_vendor").as_posix() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poetry-core-1.6.0/src/poetry/core/constraints/generic/multi_constraint.py new/poetry-core-1.6.1/src/poetry/core/constraints/generic/multi_constraint.py --- old/poetry-core-1.6.0/src/poetry/core/constraints/generic/multi_constraint.py 2023-05-14 14:58:06.000000000 +0200 +++ new/poetry-core-1.6.1/src/poetry/core/constraints/generic/multi_constraint.py 2023-05-29 09:59:54.000000000 +0200 @@ -74,6 +74,13 @@ return UnionConstraint(*(c.invert() for c in self._constraints)) def intersect(self, other: BaseConstraint) -> BaseConstraint: + if isinstance(other, MultiConstraint): + ours = set(self.constraints) + union = list(self.constraints) + [ + c for c in other.constraints if c not in ours + ] + return MultiConstraint(*union) + if not isinstance(other, Constraint): return other.intersect(self) @@ -90,6 +97,11 @@ return MultiConstraint(*self._constraints, other) def union(self, other: BaseConstraint) -> BaseConstraint: + if isinstance(other, MultiConstraint): + theirs = set(other.constraints) + common = [c for c in self.constraints if c in theirs] + return MultiConstraint(*common) + if not isinstance(other, Constraint): return other.union(self) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poetry-core-1.6.0/src/poetry/core/masonry/builders/wheel.py new/poetry-core-1.6.1/src/poetry/core/masonry/builders/wheel.py --- old/poetry-core-1.6.0/src/poetry/core/masonry/builders/wheel.py 2023-05-14 14:58:06.000000000 +0200 +++ new/poetry-core-1.6.1/src/poetry/core/masonry/builders/wheel.py 2023-05-29 09:59:54.000000000 +0200 @@ -8,6 +8,7 @@ import shutil import stat import subprocess +import sys import tempfile import zipfile @@ -17,7 +18,7 @@ from typing import TYPE_CHECKING from typing import TextIO -from packaging.tags import sys_tags +import packaging.tags from poetry.core import __version__ from poetry.core.constraints.version import parse_constraint @@ -26,6 +27,7 @@ from poetry.core.masonry.utils.helpers import distribution_name from poetry.core.masonry.utils.helpers import normalize_file_permissions from poetry.core.masonry.utils.package_include import PackageInclude +from poetry.core.utils.helpers import decode from poetry.core.utils.helpers import temporary_directory @@ -327,16 +329,59 @@ escaped_name = distribution_name(name) return f"{escaped_name}-{version}.dist-info" + def _get_sys_tags(self) -> list[str]: + """Get sys_tags via subprocess. + Required if poetry-core is not run inside the build environment. + """ + try: + output = subprocess.check_output( + [ + self.executable.as_posix(), + "-c", + f""" +import importlib.util +import sys + +from pathlib import Path + +spec = importlib.util.spec_from_file_location( + "packaging", Path(r"{packaging.__file__}") +) + +packaging = importlib.util.module_from_spec(spec) +sys.modules[spec.name] = packaging + +spec = importlib.util.spec_from_file_location( + "packaging.tags", Path(r"{packaging.tags.__file__}") +) +packaging_tags = importlib.util.module_from_spec(spec) +spec.loader.exec_module(packaging_tags) +for t in packaging_tags.sys_tags(): + print(t.interpreter, t.abi, t.platform, sep="-") +""", + ], + stderr=subprocess.STDOUT, + ) + except subprocess.CalledProcessError as e: + raise RuntimeError( + "Failed to get sys_tags for python interpreter" + f" '{self.executable.as_posix()}':\n{decode(e.output)}" + ) + return decode(output).strip().splitlines() + @property def tag(self) -> str: if self._package.build_script: - sys_tag = next(sys_tags()) + if self.executable != Path(sys.executable): + # poetry-core is not run in the build environment + # -> this is probably not a PEP 517 build but a poetry build + return self._get_sys_tags()[0] + sys_tag = next(packaging.tags.sys_tags()) tag = (sys_tag.interpreter, sys_tag.abi, sys_tag.platform) else: platform = "any" impl = "py2.py3" if self.supports_python2() else "py3" tag = (impl, "none", platform) - return "-".join(tag) def _add_file( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poetry-core-1.6.0/src/poetry/core/utils/helpers.py new/poetry-core-1.6.1/src/poetry/core/utils/helpers.py --- old/poetry-core-1.6.0/src/poetry/core/utils/helpers.py 2023-05-14 14:58:06.000000000 +0200 +++ new/poetry-core-1.6.1/src/poetry/core/utils/helpers.py 2023-05-29 09:59:54.000000000 +0200 @@ -10,6 +10,7 @@ import warnings from contextlib import contextmanager +from contextlib import suppress from pathlib import Path from typing import TYPE_CHECKING from typing import Any @@ -27,6 +28,19 @@ return unicodedata.normalize("NFC", string) +def decode(string: bytes | str, encodings: list[str] | None = None) -> str: + if not isinstance(string, bytes): + return string + + encodings = encodings or ["utf-8", "latin1", "ascii"] + + for encoding in encodings: + with suppress(UnicodeEncodeError, UnicodeDecodeError): + return string.decode(encoding) + + return string.decode(encodings[0], errors="ignore") + + def module_name(name: str) -> str: return canonicalize_name(name).replace("-", "_") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poetry-core-1.6.0/tests/constraints/generic/test_constraint.py new/poetry-core-1.6.1/tests/constraints/generic/test_constraint.py --- old/poetry-core-1.6.0/tests/constraints/generic/test_constraint.py 2023-05-14 14:58:06.000000000 +0200 +++ new/poetry-core-1.6.1/tests/constraints/generic/test_constraint.py 2023-05-29 09:59:54.000000000 +0200 @@ -219,6 +219,15 @@ MultiConstraint(Constraint("win32", "!="), Constraint("linux", "!=")), EmptyConstraint(), ), + ( + MultiConstraint(Constraint("win32", "!="), Constraint("linux", "!=")), + MultiConstraint(Constraint("win32", "!="), Constraint("darwin", "!=")), + MultiConstraint( + Constraint("win32", "!="), + Constraint("linux", "!="), + Constraint("darwin", "!="), + ), + ), ], ) def test_intersect( @@ -393,6 +402,11 @@ MultiConstraint(Constraint("win32", "!="), Constraint("linux", "!=")), ), ), + ( + MultiConstraint(Constraint("win32", "!="), Constraint("linux", "!=")), + MultiConstraint(Constraint("win32", "!="), Constraint("darwin", "!=")), + MultiConstraint(Constraint("win32", "!=")), + ), ], ) def test_union( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poetry-core-1.6.0/tests/masonry/builders/test_wheel.py new/poetry-core-1.6.1/tests/masonry/builders/test_wheel.py --- old/poetry-core-1.6.0/tests/masonry/builders/test_wheel.py 2023-05-14 14:58:06.000000000 +0200 +++ new/poetry-core-1.6.1/tests/masonry/builders/test_wheel.py 2023-05-29 09:59:54.000000000 +0200 @@ -1,6 +1,7 @@ from __future__ import annotations import os +import re import shutil import zipfile @@ -350,3 +351,22 @@ assert fd_file[0] is not None assert fd_file[0].closed + + +@pytest.mark.parametrize("in_venv_build", [True, False]) +def test_tag(in_venv_build: bool, mocker: MockerFixture) -> None: + """Tests that tag returns a valid tag if a build script is used, + no matter if poetry-core lives inside the build environment or not. + """ + root = fixtures_dir / "extended" + builder = WheelBuilder(Factory().create_poetry(root)) + + get_sys_tags_spy = mocker.spy(builder, "_get_sys_tags") + if not in_venv_build: + mocker.patch("sys.executable", "other/python") + + assert re.match("^cp[23]_?\\d+-cp[23]_?\\d+m?u?-.+$", builder.tag) + if in_venv_build: + get_sys_tags_spy.assert_not_called() + else: + get_sys_tags_spy.assert_called()