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 2022-03-20 20:54:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-poetry-core (Old) and /work/SRC/openSUSE:Factory/.python-poetry-core.new.25692 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-poetry-core" Sun Mar 20 20:54:40 2022 rev:6 rq:962657 version:1.0.8 Changes: -------- --- /work/SRC/openSUSE:Factory/python-poetry-core/python-poetry-core.changes 2021-12-09 19:45:16.977123830 +0100 +++ /work/SRC/openSUSE:Factory/.python-poetry-core.new.25692/python-poetry-core.changes 2022-03-20 20:54:51.994467583 +0100 @@ -1,0 +2,6 @@ +Fri Mar 18 11:05:18 UTC 2022 - Ben Greiner <[email protected]> + +- Update to 1.0.8 + * Add hooks according to PEP-660 for editable installs (#257). + +------------------------------------------------------------------- Old: ---- poetry-core-1.0.7-gh.tar.gz New: ---- poetry-core-1.0.8-gh.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-poetry-core.spec ++++++ --- /var/tmp/diff_new_pack.70zR87/_old 2022-03-20 20:54:52.698468596 +0100 +++ /var/tmp/diff_new_pack.70zR87/_new 2022-03-20 20:54:52.706468608 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-poetry-core # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,7 @@ %define skip_python2 1 %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-poetry-core -Version: 1.0.7 +Version: 1.0.8 Release: 0 Summary: Python poetry core utilities License: MIT ++++++ poetry-core-1.0.7-gh.tar.gz -> poetry-core-1.0.8-gh.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poetry-core-1.0.7/CHANGELOG.md new/poetry-core-1.0.8/CHANGELOG.md --- old/poetry-core-1.0.7/CHANGELOG.md 2021-10-04 18:56:23.000000000 +0200 +++ new/poetry-core-1.0.8/CHANGELOG.md 2022-02-28 05:15:29.000000000 +0100 @@ -1,5 +1,12 @@ # Change Log +## [1.0.8] - 2022-02-27 + +### Added + +- Add hooks according to PEP-660 for editable installs ([#257](https://github.com/python-poetry/poetry-core/pull/257)). + + ## [1.0.7] - 2021-10-04 ### Fixed @@ -179,7 +186,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.0.7...1.0 +[Unreleased]: https://github.com/python-poetry/poetry-core/compare/1.0.8...1.0 +[1.0.8]: https://github.com/python-poetry/poetry-core/releases/tag/1.0.8 [1.0.7]: https://github.com/python-poetry/poetry-core/releases/tag/1.0.7 [1.0.6]: https://github.com/python-poetry/poetry-core/releases/tag/1.0.6 [1.0.5]: https://github.com/python-poetry/poetry-core/releases/tag/1.0.5 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poetry-core-1.0.7/poetry/core/__init__.py new/poetry-core-1.0.8/poetry/core/__init__.py --- old/poetry-core-1.0.7/poetry/core/__init__.py 2021-10-04 18:56:23.000000000 +0200 +++ new/poetry-core-1.0.8/poetry/core/__init__.py 2022-02-28 05:15:29.000000000 +0100 @@ -7,7 +7,7 @@ # noinspection PyUnresolvedReferences from pathlib2 import Path -__version__ = "1.0.7" +__version__ = "1.0.8" __vendor_site__ = (Path(__file__).parent / "_vendor").as_posix() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poetry-core-1.0.7/poetry/core/masonry/api.py new/poetry-core-1.0.8/poetry/core/masonry/api.py --- old/poetry-core-1.0.7/poetry/core/masonry/api.py 2021-10-04 18:56:23.000000000 +0200 +++ new/poetry-core-1.0.8/poetry/core/masonry/api.py 2022-02-28 05:15:29.000000000 +0100 @@ -77,3 +77,15 @@ path = SdistBuilder(poetry).build(Path(sdist_directory)) return unicode(path.name) + + +def build_editable( + wheel_directory, config_settings=None, metadata_directory=None, +): # type: (str, Optional[Dict[str, Any]], Optional[str]) -> str + poetry = Factory().create_poetry(Path(".").resolve(), with_dev=False) + + return unicode(WheelBuilder.make_in(poetry, Path(wheel_directory), editable=True)) + + +get_requires_for_build_editable = get_requires_for_build_wheel +prepare_metadata_for_build_editable = prepare_metadata_for_build_wheel diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poetry-core-1.0.7/poetry/core/masonry/builders/wheel.py new/poetry-core-1.0.8/poetry/core/masonry/builders/wheel.py --- old/poetry-core-1.0.7/poetry/core/masonry/builders/wheel.py 2021-10-04 18:56:23.000000000 +0200 +++ new/poetry-core-1.0.8/poetry/core/masonry/builders/wheel.py 2022-02-28 05:15:29.000000000 +0100 @@ -31,6 +31,7 @@ from ..utils.helpers import escape_name from ..utils.helpers import escape_version from ..utils.helpers import normalize_file_permissions +from ..utils.package_include import PackageInclude from .builder import Builder from .sdist import SdistBuilder @@ -52,8 +53,8 @@ format = "wheel" def __init__( - self, poetry, target_dir=None, original=None, executable=None - ): # type: ("Poetry", Optional[Path], Optional[Path], Optional[str]) -> None + self, poetry, target_dir=None, original=None, executable=None, editable=False, + ): # type: ("Poetry", Optional[Path], Optional[Path], Optional[str], bool) -> None super(WheelBuilder, self).__init__(poetry, executable=executable) self._records = [] @@ -61,13 +62,18 @@ self._target_dir = target_dir or (self._poetry.file.parent / "dist") if original: self._original_path = original.file.parent + self._editable = editable @classmethod def make_in( - cls, poetry, directory=None, original=None, executable=None - ): # type: ("Poetry", Path, Path, str) -> str + cls, poetry, directory=None, original=None, executable=None, editable=False, + ): # type: ("Poetry", Optional[Path], Optional[Path], Optional[str], bool) -> str wb = WheelBuilder( - poetry, target_dir=directory, original=original, executable=executable + poetry, + target_dir=directory, + original=original, + executable=executable, + editable=editable, ) wb.build() @@ -95,12 +101,16 @@ with zipfile.ZipFile( fd_file, mode="w", compression=zipfile.ZIP_DEFLATED ) as zip_file: - if not self._poetry.package.build_should_generate_setup(): - self._build(zip_file) - self._copy_module(zip_file) + if not self._editable: + if not self._poetry.package.build_should_generate_setup(): + self._build(zip_file) + self._copy_module(zip_file) + else: + self._copy_module(zip_file) + self._build(zip_file) else: - self._copy_module(zip_file) self._build(zip_file) + self._add_pth(zip_file) self._write_metadata(zip_file) self._write_record(zip_file) @@ -112,6 +122,23 @@ logger.info("Built {}".format(self.wheel_filename)) + def _add_pth(self, wheel): # type: (zipfile.ZipFile) -> None + paths = set() + for include in self._module.includes: + if isinstance(include, PackageInclude) and ( + include.is_module() or include.is_package() + ): + paths.add(include.base.resolve().as_posix()) + + content = "" + for path in paths: + content += path + os.linesep + + pth_file = Path(self._module.name).with_suffix(".pth") + + with self._write_to_zip(wheel, str(pth_file)) as f: + f.write(content) + def _build(self, wheel): # type: (zipfile.ZipFile) -> None if self._package.build_script: if not self._poetry.package.build_should_generate_setup(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poetry-core-1.0.7/pyproject.toml new/poetry-core-1.0.8/pyproject.toml --- old/poetry-core-1.0.7/pyproject.toml 2021-10-04 18:56:23.000000000 +0200 +++ new/poetry-core-1.0.8/pyproject.toml 2022-02-28 05:15:29.000000000 +0100 @@ -1,6 +1,6 @@ [tool.poetry] name = "poetry-core" -version = "1.0.7" +version = "1.0.8" description = "Poetry PEP 517 Build Backend" authors = ["S??bastien Eustace <[email protected]>"] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poetry-core-1.0.7/tests/masonry/test_api.py new/poetry-core-1.0.8/tests/masonry/test_api.py --- old/poetry-core-1.0.7/tests/masonry/test_api.py 2021-10-04 18:56:23.000000000 +0200 +++ new/poetry-core-1.0.8/tests/masonry/test_api.py 2022-02-28 05:15:29.000000000 +0100 @@ -4,6 +4,7 @@ import os import platform import sys +import zipfile from contextlib import contextmanager @@ -216,3 +217,22 @@ ): api.prepare_metadata_for_build_wheel(tmp_dir) assert "does not exist" in str(err.value) + + +def test_build_editable_wheel(): + pkg_dir = Path(fixtures) / "complete" + + with temporary_directory() as tmp_dir, cwd(pkg_dir): + filename = api.build_editable(tmp_dir) + wheel_pth = Path(tmp_dir) / filename + + validate_wheel_contents( + name="my_package", version="1.2.3", path=str(wheel_pth), + ) + + with zipfile.ZipFile(str(wheel_pth)) as z: + namelist = z.namelist() + + assert "my_package.pth" in namelist + assert pkg_dir.as_posix() == z.read("my_package.pth").decode().strip() + assert not any(file for file in namelist if file.startswith("my_package/"))
