Skip to content

Commit 9d855c4

Browse files
committed
alvistack/v74.1.3
git clean -xdf tar zcvf ../python-setuptools_74.1.3.orig.tar.gz --exclude=.git . debuild -uc -us cp python-setuptools.spec ../python-setuptools_74.1.3-1.spec cp ../python-setuptools*74.1.3*.{gz,xz,spec,dsc} /osc/home\:alvistack/pypa-setuptools-74.1.3/ rm -rf ../python*-setuptools*74.1.3*.* ../python*-pkg-resources_74.1.3*.* See pypa#3234 (comment) See https://salsa.debian.org/cpython-team/python3/-/blob/python3.10/debian/patches/distutils-install-layout.diff See https://salsa.debian.org/cpython-team/python3/-/blob/python3.10/debian/patches/sysconfig-debian-schemes.diff Signed-off-by: Wong Hoi Sing Edison <[email protected]>
1 parent 4c27491 commit 9d855c4

18 files changed

+519
-2
lines changed

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# syntax: glob
2+
# See https://blog.jaraco.com/skeleton/#ignoring-artifacts before modifying.
3+
bin
4+
build
5+
dist
6+
docs/build
7+
include
8+
lib
9+
distribute.egg-info
10+
setuptools.egg-info
11+
setuptools/tests/bdist_wheel_testdata/*/*.egg-info/
12+
.coverage
13+
.eggs
14+
.tox
15+
.venv
16+
*.egg
17+
*.py[cod]
18+
*.swp
19+
*~
20+
.hg*
21+
.cache
22+
.pytest_cache/
23+
.mypy_cache/
24+
.pybuild

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ recursive-include tests *.py
33
recursive-include setuptools/tests *.html
44
recursive-include docs *.py *.txt *.rst *.conf *.css *.css_t Makefile indexsidebar.html
55
recursive-include setuptools/_vendor *
6+
recursive-include setuptools/_distutils/_vendor *
67
recursive-include pkg_resources *.py *.txt
78
recursive-include pkg_resources/tests/data *
89
recursive-include tools *

_distutils_system_mod.py

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
"""
2+
Apply Debian-specific patches to distutils commands and sysconfig.
3+
4+
Extracts the customized behavior from patches as reported
5+
in pypa/distutils#2 and applies those customizations (except
6+
for scheme definitions) to those commands.
7+
8+
Place this module somewhere in sys.path to take effect.
9+
"""
10+
11+
import os
12+
import sys
13+
import sysconfig
14+
15+
import distutils.sysconfig
16+
import distutils.command.install as orig_install
17+
import distutils.command.install_egg_info as orig_install_egg_info
18+
from distutils.command.install_egg_info import (
19+
to_filename,
20+
safe_name,
21+
safe_version,
22+
)
23+
from distutils.errors import DistutilsOptionError
24+
25+
26+
class install(orig_install.install):
27+
user_options = list(orig_install.install.user_options) + [
28+
('install-layout=', None,
29+
"installation layout to choose (known values: deb, unix)"),
30+
]
31+
32+
def initialize_options(self):
33+
super().initialize_options()
34+
self.prefix_option = None
35+
self.install_layout = None
36+
37+
def finalize_unix(self):
38+
self.prefix_option = self.prefix
39+
super().finalize_unix()
40+
if self.install_layout:
41+
if self.install_layout.lower() in ['deb']:
42+
self.select_scheme("deb_system")
43+
elif self.install_layout.lower() in ['unix']:
44+
self.select_scheme("posix_prefix")
45+
else:
46+
raise DistutilsOptionError(
47+
"unknown value for --install-layout")
48+
elif ((self.prefix_option and
49+
os.path.normpath(self.prefix) != '/usr/local')
50+
or sys.base_prefix != sys.prefix
51+
or 'PYTHONUSERBASE' in os.environ
52+
or 'VIRTUAL_ENV' in os.environ
53+
or 'real_prefix' in sys.__dict__):
54+
self.select_scheme("posix_prefix")
55+
else:
56+
if os.path.normpath(self.prefix) == '/usr/local':
57+
self.prefix = self.exec_prefix = '/usr'
58+
self.install_base = self.install_platbase = '/usr'
59+
self.select_scheme("posix_local")
60+
61+
62+
class install_egg_info(orig_install_egg_info.install_egg_info):
63+
user_options = list(orig_install_egg_info.install_egg_info.user_options) + [
64+
('install-layout', None, "custom installation layout"),
65+
]
66+
67+
def initialize_options(self):
68+
super().initialize_options()
69+
self.prefix_option = None
70+
self.install_layout = None
71+
72+
def finalize_options(self):
73+
self.set_undefined_options('install',('install_layout','install_layout'))
74+
self.set_undefined_options('install',('prefix_option','prefix_option'))
75+
super().finalize_options()
76+
77+
@property
78+
def basename(self):
79+
if self.install_layout:
80+
if not self.install_layout.lower() in ['deb', 'unix']:
81+
raise DistutilsOptionError(
82+
"unknown value for --install-layout")
83+
no_pyver = (self.install_layout.lower() == 'deb')
84+
elif self.prefix_option:
85+
no_pyver = False
86+
else:
87+
no_pyver = True
88+
if no_pyver:
89+
basename = "%s-%s.egg-info" % (
90+
to_filename(safe_name(self.distribution.get_name())),
91+
to_filename(safe_version(self.distribution.get_version()))
92+
)
93+
else:
94+
basename = "%s-%s-py%d.%d.egg-info" % (
95+
to_filename(safe_name(self.distribution.get_name())),
96+
to_filename(safe_version(self.distribution.get_version())),
97+
*sys.version_info[:2]
98+
)
99+
return basename
100+
101+
102+
def _posix_lib(standard_lib, libpython, early_prefix, prefix):
103+
is_default_prefix = not early_prefix or os.path.normpath(early_prefix) in ('/usr', '/usr/local')
104+
if standard_lib:
105+
return libpython
106+
elif (is_default_prefix and
107+
'PYTHONUSERBASE' not in os.environ and
108+
'VIRTUAL_ENV' not in os.environ and
109+
'real_prefix' not in sys.__dict__ and
110+
sys.prefix == sys.base_prefix):
111+
return os.path.join(prefix, "lib", "python3", "dist-packages")
112+
else:
113+
return os.path.join(libpython, "site-packages")
114+
115+
116+
def extend_schemes():
117+
sysconfig._INSTALL_SCHEMES.setdefault(
118+
'deb_system',
119+
dict(
120+
purelib='{base}/lib/python3/dist-packages',
121+
platlib='{platbase}/lib/python3/dist-packages',
122+
headers='{base}/include/python{py_version_short}/{dist_name}',
123+
scripts='{base}/bin',
124+
data='{base}',
125+
),
126+
)
127+
128+
129+
def apply_customizations():
130+
orig_install.install = install
131+
orig_install_egg_info.install_egg_info = install_egg_info
132+
distutils.sysconfig._posix_lib = _posix_lib
133+
extend_schemes()
134+
135+
136+
apply_customizations()

debian/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*.substvars
2+
*debhelper*
3+
.debhelper
4+
files
5+
python3-pkg-resources
6+
python3-setuptools
7+
python3-setuptools-whl
8+
tmp

debian/changelog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
python-setuptools (100:74.1.3-1) UNRELEASED; urgency=medium
2+
3+
* https://github.com/pypa/setuptools/releases/tag/v74.1.3
4+
5+
-- Wong Hoi Sing Edison <[email protected]> Mon, 16 Sep 2024 07:31:04 +0800

debian/control

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
Source: python-setuptools
2+
Section: python
3+
Priority: optional
4+
Standards-Version: 4.5.0
5+
Maintainer: Wong Hoi Sing Edison <[email protected]>
6+
Homepage: https://github.com/pypa/setuptools/tags
7+
Vcs-Browser: https://github.com/alvistack/pypa-setuptools
8+
Vcs-Git: https://github.com/alvistack/pypa-setuptools.git
9+
Build-Depends:
10+
debhelper,
11+
debhelper-compat (= 10),
12+
dh-python,
13+
fdupes,
14+
python3-dev,
15+
python3-wheel,
16+
17+
Package: python3-pkg-resources
18+
Architecture: all
19+
Description: Package Discovery and Resource Access using pkg_resources
20+
The pkg_resources module provides an API for Python libraries to
21+
access their resource files, and for extensible applications and
22+
frameworks to automatically discover plugins. It also provides
23+
runtime support for using C extensions that are inside zipfile-format
24+
eggs, support for merging packages that have separately-distributed
25+
modules or subpackages, and APIs for managing Python's current
26+
"working set" of active packages.
27+
Depends:
28+
${misc:Depends},
29+
${shlibs:Depends},
30+
${python3:Depends},
31+
32+
Package: python3-setuptools
33+
Architecture: all
34+
Description: Download, build, install, upgrade, and uninstall Python packages
35+
setuptools is a collection of enhancements to the Python distutils that
36+
allow you to build and distribute Python packages, especially ones that
37+
have dependencies on other packages.
38+
Depends:
39+
${misc:Depends},
40+
${shlibs:Depends},
41+
${python3:Depends},
42+
python3,
43+
python3-pkg-resources (= ${source:Version}),
44+
45+
Package: python3-setuptools-whl
46+
Architecture: all
47+
Description: Python Distutils Enhancements (wheel package)
48+
This is the support package for the PEP 427 wheel version of the package,
49+
required for using setuptools inside a virtual environment.
50+
Depends:
51+
${misc:Depends},
52+
${shlibs:Depends},
53+
${python3:Depends},
54+
Breaks:
55+
python-pip-whl (<< 21.3.1+dfsg-2~),
56+
Replaces:
57+
python-pip-whl (<< 21.3.1+dfsg-2~),

debian/copyright

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2+
3+
Files: debian/*
4+
Copyright: 2024 Wong Hoi Sing Edison <[email protected]>
5+
License: Apache-2.0
6+
7+
License: Apache-2.0
8+
Licensed under the Apache License, Version 2.0 (the "License");
9+
you may not use this file except in compliance with the License.
10+
You may obtain a copy of the License at
11+
.
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
.
14+
Unless required by applicable law or agreed to in writing, software
15+
distributed under the License is distributed on an "AS IS" BASIS,
16+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
See the License for the specific language governing permissions and
18+
limitations under the License.
19+
.
20+
The complete text of the Apache version 2.0 license
21+
can be found in "/usr/share/common-licenses/Apache-2.0".

debian/python3-pkg-resources.install

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
usr/lib/python*/*-packages/pkg_resources
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
python3-pkg-resources: copyright-without-copyright-notice
2+
python3-pkg-resources: initial-upload-closes-no-bugs
3+
python3-pkg-resources: zero-byte-file-in-doc-directory

debian/python3-setuptools-whl.install

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
usr/share/python-wheels/*.whl

debian/python3-setuptools.install

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
usr/lib/python*/*-packages/_distutils_hack
2+
usr/lib/python*/*-packages/_distutils_system_mod.py
3+
usr/lib/python*/*-packages/distutils-precedence.pth
4+
usr/lib/python*/*-packages/setuptools*
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
python3-setuptools: copyright-without-copyright-notice
2+
python3-setuptools: initial-upload-closes-no-bugs
3+
python3-setuptools: no-manual-page
4+
python3-setuptools: zero-byte-file-in-doc-directory

debian/rules

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/make -f
2+
3+
SHELL := /bin/bash
4+
5+
override_dh_auto_build:
6+
dh_auto_build
7+
mkdir -p build/$(shell python3 -c "import sys; print('scripts-%d.%d' % sys.version_info[:2])")
8+
python3 setup.py bdist_wheel
9+
10+
override_dh_auto_install:
11+
ln -s setuptools/_distutils distutils
12+
PYTHONPATH=. dh_auto_install --destdir=debian/tmp
13+
unlink distutils
14+
install -Dpm644 -t debian/tmp/usr/lib/python*/*-packages _distutils_system_mod.py
15+
install -Dpm755 -d debian/tmp/usr/share/python-wheels
16+
install -Dpm644 -t debian/tmp/usr/share/python-wheels dist/*.whl
17+
rm -rf debian/tmp/usr/lib/python*/*-packages/pkg_resources/tests
18+
find debian/tmp/usr/lib/python*/*-packages -type f -name '*.pyc' -exec rm -rf {} \;
19+
find debian/tmp/usr/lib/python*/*-packages -type f -name requires.txt -exec rm -rf {} \;
20+
fdupes -qnrps debian/tmp/usr/lib/python*/*-packages
21+
22+
override_dh_auto_test:
23+
24+
override_dh_auto_clean:
25+
26+
%:
27+
dh $@ --buildsystem=pybuild --with python3

debian/source/format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.0 (quilt)

debian/source/lintian-overrides

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
python-setuptools source: file-without-copyright-information
2+
python-setuptools source: no-debian-changes
3+
python-setuptools source: source-contains-prebuilt-windows-binary
4+
python-setuptools source: source-is-missing
5+
python-setuptools source: source-package-encodes-python-version

0 commit comments

Comments
 (0)