git: 7e5fc001eec1 - main - devel/py-bitstring: Fix PEP 517 installation

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Sun, 04 Aug 2024 17:24:30 UTC
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7e5fc001eec1420963996911a0296c25e84ac8d2

commit 7e5fc001eec1420963996911a0296c25e84ac8d2
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2024-08-04 17:11:31 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2024-08-04 17:14:32 +0000

    devel/py-bitstring: Fix PEP 517 installation
    
    - Bump PORTREVISION for package change
    
    When you build a port with USE_PYTHON=pep517, make sure to have CORRECT dependency. Otherwise the dependent port would fail to build.
    bitstring requires "bitarray == 2.8.0" while py-bitarray is 2.8.1 now.
    Relax the version to fix the build of dependent ports.
    
    from py311-angr-9.0.5405_2.log [1]:
    /usr/local/lib/python3.11/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
      warnings.warn(
    WARNING: The wheel package is not available.
    /usr/local/bin/python3.11: No module named pip
    Traceback (most recent call last):
      File "/usr/local/lib/python3.11/site-packages/setuptools/installer.py", line 82, in fetch_build_egg
        subprocess.check_call(cmd)
      File "/usr/local/lib/python3.11/subprocess.py", line 413, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['/usr/local/bin/python3.11', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpcfx2plmc', '--quiet', 'bitarray==2.8.0']' returned non-zero exit status 1.
    
    The above exception was the direct cause of the following exception:
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "setup.py", line 135, in <module>
        setup(
      File "/usr/local/lib/python3.11/site-packages/setuptools/__init__.py", line 86, in setup
        _install_setup_requires(attrs)
      File "/usr/local/lib/python3.11/site-packages/setuptools/__init__.py", line 80, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "/usr/local/lib/python3.11/site-packages/setuptools/dist.py", line 875, in fetch_build_eggs
        resolved_dists = pkg_resources.working_set.resolve(
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/pkg_resources/__init__.py", line 789, in resolve
        dist = best[req.key] = env.best_match(
                               ^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/pkg_resources/__init__.py", line 1075, in best_match
        return self.obtain(req, installer)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/pkg_resources/__init__.py", line 1087, in obtain
        return installer(requirement)
               ^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/setuptools/dist.py", line 945, in fetch_build_egg
        return fetch_build_egg(self, req)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/setuptools/installer.py", line 84, in fetch_build_egg
        raise DistutilsError(str(e)) from e
    distutils.errors.DistutilsError: Command '['/usr/local/bin/python3.11', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpcfx2plmc', '--quiet', 'bitarray==2.8.0']' returned non-zero exit status 1.
    *** Error code 1
    
    Reference:      https://pkg-status.freebsd.org/beefy22/data/140amd64-default/38b61988cd6e/logs/py311-angr-9.0.5405_2.log [1]
    Approved by:    portmgr (blanket)
    With hat:       python
---
 devel/py-bitstring/Makefile                   |  3 ++-
 devel/py-bitstring/files/patch-pyproject.toml | 11 +++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/devel/py-bitstring/Makefile b/devel/py-bitstring/Makefile
index 7d540e84f69a..46ef2a022647 100644
--- a/devel/py-bitstring/Makefile
+++ b/devel/py-bitstring/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	bitstring
 PORTVERSION=	4.1.0
+PORTREVISION=	1
 CATEGORIES=	devel python
 MASTER_SITES=	PYPI
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
@@ -19,7 +20,7 @@ PORTDOCS=	PKG-INFO README.md release_notes.txt
 
 BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}setuptools>=0:devel/py-setuptools@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR}
-RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}bitarray>=0:devel/py-bitarray@${PY_FLAVOR}
+RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}bitarray>=2.8.0:devel/py-bitarray@${PY_FLAVOR}
 
 OPTIONS_DEFINE=	DOCS
 NO_ARCH=	yes
diff --git a/devel/py-bitstring/files/patch-pyproject.toml b/devel/py-bitstring/files/patch-pyproject.toml
new file mode 100644
index 000000000000..60439715b8c9
--- /dev/null
+++ b/devel/py-bitstring/files/patch-pyproject.toml
@@ -0,0 +1,11 @@
+--- pyproject.toml.orig	2023-08-17 13:50:39 UTC
++++ pyproject.toml
+@@ -26,7 +26,7 @@ dependencies = [
+ ]
+ keywords = ["binary", "bitarray", "bitvector"]
+ dependencies = [
+-  "bitarray == 2.8.0",
++  "bitarray >= 2.8.0",
+ ]
+ 
+ [project.urls]