git: de7c5ca4a2d4 - main - devel/py-wheel044: "temporarily" add
Date: Sat, 05 Apr 2025 20:37:12 UTC
The branch main has been updated by vishwin:
URL: https://cgit.FreeBSD.org/ports/commit/?id=de7c5ca4a2d40df82a8ca46b37c8b859a412b89c
commit de7c5ca4a2d40df82a8ca46b37c8b859a412b89c
Author: Charlie Li <vishwin@FreeBSD.org>
AuthorDate: 2025-04-05 20:12:38 +0000
Commit: Charlie Li <vishwin@FreeBSD.org>
CommitDate: 2025-04-05 20:12:38 +0000
devel/py-wheel044: "temporarily" add
The sole purpose of this port is to build setuptools < 70.1.0 under
USE_PYTHON=pep517, as a stopgap to allow newer Python
distributions/interpreters to land while the setuptools update
continues to be worked on. This port will be removed once setuptools
is updated. Nothing else is to declare this as a dependency; continue
to use devel/py-wheel elsewhere.
As of setuptools 70.1.0, bdist_wheel (what setuptools executes as
part of ${PEP517_BUILD_CMD} to build the wheel) has moved from wheel
to setuptools [0], so once setuptools is updated past said version,
consumers should not continue declaring devel/py-wheel in BUILD_DEPENDS
unless the package needs functionality beyond what moved into
setuptools.
[0] https://setuptools.pypa.io/en/latest/history.html#v70-1-0
PR: 271673, 274671
---
devel/Makefile | 1 +
devel/py-wheel044/Makefile | 26 +++++++++
devel/py-wheel044/distinfo | 3 ++
.../files/patch-src_wheel___bdist__wheel.py | 62 ++++++++++++++++++++++
devel/py-wheel044/pkg-descr | 13 +++++
5 files changed, 105 insertions(+)
diff --git a/devel/Makefile b/devel/Makefile
index 0875d061e85d..78d2e25c63ed 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -6146,6 +6146,7 @@
SUBDIR += py-websockets
SUBDIR += py-websockify
SUBDIR += py-wheel
+ SUBDIR += py-wheel044
SUBDIR += py-wheel-filename
SUBDIR += py-whichcraft
SUBDIR += py-whistle
diff --git a/devel/py-wheel044/Makefile b/devel/py-wheel044/Makefile
new file mode 100644
index 000000000000..ae49e5afb87e
--- /dev/null
+++ b/devel/py-wheel044/Makefile
@@ -0,0 +1,26 @@
+PORTNAME= wheel
+PORTVERSION= 0.44.0
+CATEGORIES= devel
+MASTER_SITES= PYPI
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+PKGNAMESUFFIX= 044
+
+MAINTAINER= vishwin@FreeBSD.org
+COMMENT= Built-package format for Python
+WWW= https://github.com/pypa/wheel
+
+LICENSE= MIT
+
+BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}flit-core>=3.8:devel/py-flit-core@${PY_FLAVOR}
+
+USES= python
+USE_PYTHON= allflavors autoplist concurrent pep517
+
+CONFLICTS_INSTALL= ${PYTHON_PKGNAMEPREFIX}wheel
+PORTSCOUT= ignore:1
+
+# see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=268500
+EXTRACT_CMD= ${SETENV} LC_ALL=en_US.UTF-8 /usr/bin/bsdtar
+NO_ARCH= yes
+
+.include <bsd.port.mk>
diff --git a/devel/py-wheel044/distinfo b/devel/py-wheel044/distinfo
new file mode 100644
index 000000000000..4695e435c5bb
--- /dev/null
+++ b/devel/py-wheel044/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1743880828
+SHA256 (wheel-0.44.0.tar.gz) = a29c3f2817e95ab89aa4660681ad547c0e9547f20e75b0562fe7723c9a2a9d49
+SIZE (wheel-0.44.0.tar.gz) = 100733
diff --git a/devel/py-wheel044/files/patch-src_wheel___bdist__wheel.py b/devel/py-wheel044/files/patch-src_wheel___bdist__wheel.py
new file mode 100644
index 000000000000..3cb53ccf7fb4
--- /dev/null
+++ b/devel/py-wheel044/files/patch-src_wheel___bdist__wheel.py
@@ -0,0 +1,62 @@
+--- src/wheel/_bdist_wheel.py.orig 2024-08-04 14:54:33 UTC
++++ src/wheel/_bdist_wheel.py
+@@ -54,8 +54,6 @@ def safe_version(version: str) -> str:
+ return re.sub("[^A-Za-z0-9.]+", "-", version)
+
+
+-setuptools_major_version = int(setuptools.__version__.split(".")[0])
+-
+ PY_LIMITED_API_PATTERN = r"cp3\d"
+
+
+@@ -489,48 +487,8 @@ class bdist_wheel(Command):
+
+ @property
+ def license_paths(self) -> Iterable[str]:
+- if setuptools_major_version >= 57:
+- # Setuptools has resolved any patterns to actual file names
+- return self.distribution.metadata.license_files or ()
+-
+- files: set[str] = set()
+- metadata = self.distribution.get_option_dict("metadata")
+- if setuptools_major_version >= 42:
+- # Setuptools recognizes the license_files option but does not do globbing
+- patterns = cast(Sequence[str], self.distribution.metadata.license_files)
+- else:
+- # Prior to those, wheel is entirely responsible for handling license files
+- if "license_files" in metadata:
+- patterns = metadata["license_files"][1].split()
+- else:
+- patterns = ()
+-
+- if "license_file" in metadata:
+- warnings.warn(
+- 'The "license_file" option is deprecated. Use "license_files" instead.',
+- DeprecationWarning,
+- stacklevel=2,
+- )
+- files.add(metadata["license_file"][1])
+-
+- if not files and not patterns and not isinstance(patterns, list):
+- patterns = ("LICEN[CS]E*", "COPYING*", "NOTICE*", "AUTHORS*")
+-
+- for pattern in patterns:
+- for path in iglob(pattern):
+- if path.endswith("~"):
+- log.debug(
+- f'ignoring license file "{path}" as it looks like a backup'
+- )
+- continue
+-
+- if path not in files and os.path.isfile(path):
+- log.info(
+- f'adding license file "{path}" (matched pattern "{pattern}")'
+- )
+- files.add(path)
+-
+- return files
++ # Setuptools has resolved any patterns to actual file names
++ return self.distribution.metadata.license_files or ()
+
+ def egg2dist(self, egginfo_path: str, distinfo_path: str):
+ """Convert an .egg-info directory into a .dist-info directory"""
diff --git a/devel/py-wheel044/pkg-descr b/devel/py-wheel044/pkg-descr
new file mode 100644
index 000000000000..5e28001c930a
--- /dev/null
+++ b/devel/py-wheel044/pkg-descr
@@ -0,0 +1,13 @@
+A built-package format for Python.
+
+A wheel is a ZIP-format archive with a specially formatted filename and the
+.whl extension. It is designed to contain all the files for a PEP 376
+compatible install in a way that is very close to the on-disk format.
+Many packages will be properly installed with only the "Unpack" step (simply
+extracting the file onto sys.path), and the unpacked archive preserves enough
+information to "Spread" (copy data and scripts to their final locations)
+at any later time.
+
+The wheel project provides a bdist_wheel command for setuptools (requires
+setuptools >= 0.8.0). Wheel files can be installed with a newer pip from
+https://github.com/pypa/pip or with wheel's own command line utility.