Skip to content

Commit a51f3b9

Browse files
committed
alvistack/v64.0.2
git clean -xdf tar zcvf ../python-setuptools_64.0.2.orig.tar.gz --exclude=.git . debuild -uc -us cp python-setuptools.spec ../python-setuptools_64.0.2-1.spec mv ../python-setuptools*64.0.2*.{gz,xz,spec,dsc} /osc/home\:alvistack/pypa-setuptools-64.0.2/ rm -rf ../python*-setuptools_64.0.2*.* ../python*-pkg-resources_64.0.2*.* See pypa#3234 (comment) Signed-off-by: Wong Hoi Sing Edison <[email protected]>
1 parent 490d640 commit a51f3b9

23 files changed

+1113
-93
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ setuptools.egg-info
2020
.idea/
2121
.pytest_cache/
2222
.mypy_cache/
23+
.pybuild

_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: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
*.substvars
2+
*debhelper*
3+
.debhelper
4+
files
5+
python3-setuptools
6+
python3-pkg-resources
7+
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:64.0.2-1) UNRELEASED; urgency=medium
2+
3+
* https://github.com/pypa/setuptools/releases/tag/v64.0.2
4+
5+
-- Wong Hoi Sing Edison <[email protected]> Sat, 13 Aug 2022 10:38:03 +0800

debian/control

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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+
16+
Package: python3-pkg-resources
17+
Architecture: all
18+
Description: Package Discovery and Resource Access using pkg_resources
19+
The pkg_resources module provides an API for Python libraries to
20+
access their resource files, and for extensible applications and
21+
frameworks to automatically discover plugins. It also provides
22+
runtime support for using C extensions that are inside zipfile-format
23+
eggs, support for merging packages that have separately-distributed
24+
modules or subpackages, and APIs for managing Python's current
25+
"working set" of active packages.
26+
Depends:
27+
${misc:Depends},
28+
${shlibs:Depends},
29+
${python3:Depends},
30+
31+
Package: python3-setuptools
32+
Architecture: all
33+
Description: Download, build, install, upgrade, and uninstall Python packages
34+
setuptools is a collection of enhancements to the Python distutils that
35+
allow you to build and distribute Python packages, especially ones that
36+
have dependencies on other packages.
37+
Depends:
38+
${misc:Depends},
39+
${shlibs:Depends},
40+
${python3:Depends},
41+
python3,
42+
python3-pkg-resources (= ${source:Version}),

debian/copyright

Whitespace-only changes.

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.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: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/make -f
2+
3+
SHELL := /bin/bash
4+
5+
override_dh_auto_install:
6+
dh_auto_install --destdir=debian/tmp
7+
install -Dpm644 -t debian/tmp/usr/lib/python*/*-packages _distutils_system_mod.py
8+
rm -rf debian/tmp/usr/lib/python*/*-packages/pkg_resources/tests
9+
find debian/tmp/usr/lib/python*/*-packages -type f -name '*.pyc' -exec rm -rf {} \;
10+
fdupes -qnrps debian/tmp/usr/lib/python*/*-packages
11+
12+
override_dh_auto_test:
13+
14+
override_dh_auto_clean:
15+
16+
%:
17+
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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
python-setuptools source: no-debian-changes
2+
python-setuptools source: source-contains-prebuilt-windows-binary
3+
python-setuptools source: source-is-missing
4+
python-setuptools source: source-package-encodes-python-version

pyproject.toml

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)