Skip to content

Commit

Permalink
alvistack/v60.1.1
Browse files Browse the repository at this point in the history
    git clean -xdf
    tar zcvf ../python-setuptools_60.1.1.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-setuptools.spec ../python-setuptools_60.1.1-1.spec
    mv ../python-setuptools*60.1.1*.{gz,xz,spec,dsc} /osc/home\:alvistack/pypa-setuptools-60.1.1/
    rm -rf ../python*-setuptools_60.1.1*.* ../python*-pkg-resources_60.1.1*.*

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
  • Loading branch information
hswong3i committed Dec 29, 2021
1 parent 7f79574 commit 52fece0
Show file tree
Hide file tree
Showing 22 changed files with 913 additions and 88 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ setuptools.egg-info
.idea/
.pytest_cache/
.mypy_cache/
.pybuild
136 changes: 136 additions & 0 deletions _distutils_system_mod.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
"""
Apply Debian-specific patches to distutils commands and sysconfig.
Extracts the customized behavior from patches as reported
in pypa/distutils#2 and applies those customizations (except
for scheme definitions) to those commands.
Place this module somewhere in sys.path to take effect.
"""

import os
import sys
import sysconfig

import distutils.sysconfig
import distutils.command.install as orig_install
import distutils.command.install_egg_info as orig_install_egg_info
from distutils.command.install_egg_info import (
to_filename,
safe_name,
safe_version,
)
from distutils.errors import DistutilsOptionError


class install(orig_install.install):
user_options = list(orig_install.install.user_options) + [
('install-layout=', None,
"installation layout to choose (known values: deb, unix)"),
]

def initialize_options(self):
super().initialize_options()
self.prefix_option = None
self.install_layout = None

def finalize_unix(self):
self.prefix_option = self.prefix
super().finalize_unix()
if self.install_layout:
if self.install_layout.lower() in ['deb']:
self.select_scheme("deb_system")
elif self.install_layout.lower() in ['unix']:
self.select_scheme("posix_prefix")
else:
raise DistutilsOptionError(
"unknown value for --install-layout")
elif ((self.prefix_option and
os.path.normpath(self.prefix) != '/usr/local')
or sys.base_prefix != sys.prefix
or 'PYTHONUSERBASE' in os.environ
or 'VIRTUAL_ENV' in os.environ
or 'real_prefix' in sys.__dict__):
self.select_scheme("posix_prefix")
else:
if os.path.normpath(self.prefix) == '/usr/local':
self.prefix = self.exec_prefix = '/usr'
self.install_base = self.install_platbase = '/usr'
self.select_scheme("posix_local")


class install_egg_info(orig_install_egg_info.install_egg_info):
user_options = list(orig_install_egg_info.install_egg_info.user_options) + [
('install-layout', None, "custom installation layout"),
]

def initialize_options(self):
super().initialize_options()
self.prefix_option = None
self.install_layout = None

def finalize_options(self):
self.set_undefined_options('install',('install_layout','install_layout'))
self.set_undefined_options('install',('prefix_option','prefix_option'))
super().finalize_options()

@property
def basename(self):
if self.install_layout:
if not self.install_layout.lower() in ['deb', 'unix']:
raise DistutilsOptionError(
"unknown value for --install-layout")
no_pyver = (self.install_layout.lower() == 'deb')
elif self.prefix_option:
no_pyver = False
else:
no_pyver = True
if no_pyver:
basename = "%s-%s.egg-info" % (
to_filename(safe_name(self.distribution.get_name())),
to_filename(safe_version(self.distribution.get_version()))
)
else:
basename = "%s-%s-py%d.%d.egg-info" % (
to_filename(safe_name(self.distribution.get_name())),
to_filename(safe_version(self.distribution.get_version())),
*sys.version_info[:2]
)
return basename


def _posix_lib(standard_lib, libpython, early_prefix, prefix):
is_default_prefix = not early_prefix or os.path.normpath(early_prefix) in ('/usr', '/usr/local')
if standard_lib:
return libpython
elif (is_default_prefix and
'PYTHONUSERBASE' not in os.environ and
'VIRTUAL_ENV' not in os.environ and
'real_prefix' not in sys.__dict__ and
sys.prefix == sys.base_prefix):
return os.path.join(prefix, "lib", "python3", "dist-packages")
else:
return os.path.join(libpython, "site-packages")


def extend_schemes():
sysconfig._INSTALL_SCHEMES.setdefault(
'deb_system',
dict(
purelib='{base}/lib/python3/dist-packages',
platlib='{platbase}/lib/python3/dist-packages',
headers='{base}/include/python{py_version_short}/{dist_name}',
scripts='{base}/bin',
data='{base}',
),
)


def apply_customizations():
orig_install.install = install
orig_install_egg_info.install_egg_info = install_egg_info
distutils.sysconfig._posix_lib = _posix_lib
extend_schemes()


apply_customizations()
7 changes: 7 additions & 0 deletions debian/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*.substvars
*debhelper*
.debhelper
files
python3-setuptools
python3-pkg-resources
tmp
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
python-setuptools (100:60.1.1-1) UNRELEASED; urgency=medium

* https://github.com/pypa/setuptools/releases/tag/v60.1.1

-- Wong Hoi Sing Edison <[email protected]> Wed, 29 Dec 2021 17:23:26 +0800
43 changes: 43 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Source: python-setuptools
Section: python
Priority: optional
Standards-Version: 4.5.0
Maintainer: Wong Hoi Sing Edison <[email protected]>
Homepage: https://github.com/pypa/setuptools/tags
Vcs-Browser: https://github.com/alvistack/pypa-setuptools
Vcs-Git: https://github.com/alvistack/pypa-setuptools.git
Build-Depends:
debhelper,
debhelper-compat (= 10),
dh-python,
fdupes,
python3-all,
python3-dev,

Package: python3-pkg-resources
Architecture: all
Description: Package Discovery and Resource Access using pkg_resources
The pkg_resources module provides an API for Python libraries to
access their resource files, and for extensible applications and
frameworks to automatically discover plugins. It also provides
runtime support for using C extensions that are inside zipfile-format
eggs, support for merging packages that have separately-distributed
modules or subpackages, and APIs for managing Python's current
"working set" of active packages.
Depends:
${misc:Depends},
${shlibs:Depends},
${python3:Depends},

Package: python3-setuptools
Architecture: all
Description: Download, build, install, upgrade, and uninstall Python packages
setuptools is a collection of enhancements to the Python distutils that
allow you to build and distribute Python packages, especially ones that
have dependencies on other packages.
Depends:
${misc:Depends},
${shlibs:Depends},
${python3:Depends},
python3,
python3-pkg-resources (= ${source:Version}),
Empty file added debian/copyright
Empty file.
1 change: 1 addition & 0 deletions debian/python3-pkg-resources.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
usr/lib/python*/*-packages/pkg_resources
3 changes: 3 additions & 0 deletions debian/python3-pkg-resources.lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
python3-pkg-resources: copyright-without-copyright-notice
python3-pkg-resources: initial-upload-closes-no-bugs
python3-pkg-resources: zero-byte-file-in-doc-directory
4 changes: 4 additions & 0 deletions debian/python3-setuptools.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
usr/lib/python*/*-packages/_distutils_hack
usr/lib/python*/*-packages/_distutils_system_mod.py
usr/lib/python*/*-packages/distutils-precedence.pth
usr/lib/python*/*-packages/setuptools*
4 changes: 4 additions & 0 deletions debian/python3-setuptools.lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
python3-setuptools: copyright-without-copyright-notice
python3-setuptools: initial-upload-closes-no-bugs
python3-setuptools: no-manual-page
python3-setuptools: zero-byte-file-in-doc-directory
17 changes: 17 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/make -f

SHELL := /bin/bash

override_dh_auto_install:
dh_auto_install
install -Dpm644 -t debian/tmp/usr/lib/python*/*-packages _distutils_system_mod.py
rm -rf debian/tmp/usr/lib/python*/*-packages/pkg_resources/tests
find debian/tmp/usr/lib/python*/*-packages -type f -name '*.pyc' -exec rm -rf {} \;
fdupes -s debian/tmp/usr/lib/python*/*-packages

override_dh_auto_test:

override_dh_auto_clean:

%:
dh $@ --buildsystem=pybuild --with python3
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)
4 changes: 4 additions & 0 deletions debian/source/lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
python-setuptools source: no-debian-changes
python-setuptools source: source-contains-prebuilt-windows-binary
python-setuptools source: source-is-missing
python-setuptools source: source-package-encodes-python-version
59 changes: 0 additions & 59 deletions pyproject.toml

This file was deleted.

Loading

0 comments on commit 52fece0

Please sign in to comment.