Accepting request 1134566 from devel:languages:python
- Add patch allow-only-direct-compilation.patch: * Allow forcing direct compilation. - update to 69.0.2: * Added missing estimated date for removing ``setuptools.dep_util`` (deprecated in v69.0.0). * Fixed imports of ``setuptools.dep_util.newer_group``. * A deprecation warning is issued instead of a hard failure. * Include type information (``py.typed``, ``*.pyi``) by default (#3136) -- by :user:`Danie-1`, * Exported ``distutils.dep_util`` and ``setuptools.dep_util`` through ``setuptools.modified`` * Merged with pypa/distutils@7a04cbda0f. * Replaced hardcoded numeric values with :obj:`dis.opmap`, fixing problem with 3.13.0a1. (#4094) * Configuring project ``version`` and ``egg_info.tag_*`` in such a way that results in invalid version strings (according to :pep:`440`) is no longer permitted. (#4066) * Removed deprecated ``egg_base`` option from ``dist_info``. * The parsing of the deprecated ``metadata.license_file`` and ``metadata.requires`` fields in ``setup.cfg`` is no longer supported. * Users are expected to move to ``metadata.license_files`` and ``options.install_requires`` (respectively). (#4066) * Passing ``config_settings`` to ``setuptools.build_meta`` with deprecated values for ``--global-option`` is no longer allowed. (#4066) * Removed deprecated ``namespace-packages`` from ``pyproject.toml``. * Added strict enforcement for ``project.dynamic`` in OBS-URL: https://build.opensuse.org/request/show/1134566 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-setuptools?expand=0&rev=80
This commit is contained in:
commit
cf46c362db
33
allow-only-direct-compilation.patch
Normal file
33
allow-only-direct-compilation.patch
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
Index: setuptools-69.0.2/setuptools/_distutils/command/install_lib.py
|
||||||
|
===================================================================
|
||||||
|
--- setuptools-69.0.2.orig/setuptools/_distutils/command/install_lib.py
|
||||||
|
+++ setuptools-69.0.2/setuptools/_distutils/command/install_lib.py
|
||||||
|
@@ -133,6 +133,12 @@ class install_lib(Command):
|
||||||
|
# should at least generate usable bytecode in RPM distributions.
|
||||||
|
install_root = self.get_finalized_command('install').root
|
||||||
|
|
||||||
|
+ # UGLY HACK WARNING. Indirect compilation requires distutils, which
|
||||||
|
+ # means Python 3.11 or less. If and only if an environment variable
|
||||||
|
+ # is set, do we force direct compilation.
|
||||||
|
+ # See also https://github.com/pypa/setuptools/issues/4164
|
||||||
|
+ direct = os.environ.get('SETUPTOOLS_FORCE_DIRECT', None)
|
||||||
|
+
|
||||||
|
if self.compile:
|
||||||
|
byte_compile(
|
||||||
|
files,
|
||||||
|
@@ -140,6 +146,7 @@ class install_lib(Command):
|
||||||
|
force=self.force,
|
||||||
|
prefix=install_root,
|
||||||
|
dry_run=self.dry_run,
|
||||||
|
+ direct=direct,
|
||||||
|
)
|
||||||
|
if self.optimize > 0:
|
||||||
|
byte_compile(
|
||||||
|
@@ -149,6 +156,7 @@ class install_lib(Command):
|
||||||
|
prefix=install_root,
|
||||||
|
verbose=self.verbose,
|
||||||
|
dry_run=self.dry_run,
|
||||||
|
+ direct=direct,
|
||||||
|
)
|
||||||
|
|
||||||
|
# -- Utility methods -----------------------------------------------
|
@ -1,3 +1,68 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Dec 22 04:10:44 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
|
||||||
|
|
||||||
|
- Add patch allow-only-direct-compilation.patch:
|
||||||
|
* Allow forcing direct compilation.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Dec 18 08:01:21 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
||||||
|
|
||||||
|
- update to 69.0.2:
|
||||||
|
* Added missing estimated date for removing
|
||||||
|
``setuptools.dep_util`` (deprecated in v69.0.0).
|
||||||
|
* Fixed imports of ``setuptools.dep_util.newer_group``.
|
||||||
|
* A deprecation warning is issued instead of a hard failure.
|
||||||
|
* Include type information (``py.typed``, ``*.pyi``) by default
|
||||||
|
(#3136) -- by :user:`Danie-1`,
|
||||||
|
* Exported ``distutils.dep_util`` and ``setuptools.dep_util``
|
||||||
|
through ``setuptools.modified``
|
||||||
|
* Merged with pypa/distutils@7a04cbda0fc714.
|
||||||
|
* Replaced hardcoded numeric values with :obj:`dis.opmap`,
|
||||||
|
fixing problem with 3.13.0a1. (#4094)
|
||||||
|
* Configuring project ``version`` and ``egg_info.tag_*`` in
|
||||||
|
such a way that results in invalid version strings
|
||||||
|
(according to :pep:`440`) is no longer permitted. (#4066)
|
||||||
|
* Removed deprecated ``egg_base`` option from ``dist_info``.
|
||||||
|
* The parsing of the deprecated ``metadata.license_file`` and
|
||||||
|
``metadata.requires`` fields in ``setup.cfg`` is no longer
|
||||||
|
supported.
|
||||||
|
* Users are expected to move to ``metadata.license_files`` and
|
||||||
|
``options.install_requires`` (respectively). (#4066)
|
||||||
|
* Passing ``config_settings`` to ``setuptools.build_meta`` with
|
||||||
|
deprecated values for ``--global-option`` is no longer
|
||||||
|
allowed. (#4066)
|
||||||
|
* Removed deprecated ``namespace-packages`` from
|
||||||
|
``pyproject.toml``.
|
||||||
|
* Added strict enforcement for ``project.dynamic`` in
|
||||||
|
``pyproject.toml``.
|
||||||
|
This removes the transitional ability of users configuring
|
||||||
|
certain parameters via ``setup.py`` without making the
|
||||||
|
necessary changes to ``pyproject.toml``
|
||||||
|
* Removed handling of ``--config-settings["--build-option"]``
|
||||||
|
in ``setuptools.build_meta`` from build-backend API hooks
|
||||||
|
*other than* ``build_wheel``.
|
||||||
|
* Improve backwards compatibility with deprecated CLI
|
||||||
|
practices. (#4048)
|
||||||
|
* Avoid using caching attributes in ``Distribution.metadata``
|
||||||
|
for requirements. This is done for backwards compatibility
|
||||||
|
with customizations that attempt to modify ``install_requires``
|
||||||
|
or ``extras_require`` at a late point (still not recommended).
|
||||||
|
* Rework how ``setuptools`` internally handles
|
||||||
|
``dependencies/install_requires`` and
|
||||||
|
``optional-dependencies/extras_require``. (#3903)
|
||||||
|
* Improve the generated ``PKG-INFO`` files, by adding
|
||||||
|
``Requires-Dist`` fields.
|
||||||
|
* Previously, these fields would be omitted in favour of a non-
|
||||||
|
standard ``*.egg-info/requires.txt`` file (which is still
|
||||||
|
generated for the time being). (#3904)
|
||||||
|
* Improve atomicity when writing ``PKG-INFO`` files to avoid
|
||||||
|
race conditions with ``importlib.metadata``. (#3904)
|
||||||
|
* Fix the name given to the ``*-nspkg.pth`` files in editable
|
||||||
|
installs, ensuring they are unique per distribution. (#4041)
|
||||||
|
* Workaround some limitations on ``pkg_resources``-style legacy
|
||||||
|
namespaces in the meta path finder for editable installations.
|
||||||
|
- drop sphinx72.patch (upstream)
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Oct 16 12:03:15 UTC 2023 - Daniel Garcia Moreno <daniel.garcia@suse.com>
|
Mon Oct 16 12:03:15 UTC 2023 - Daniel Garcia Moreno <daniel.garcia@suse.com>
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
%define mypython python
|
%define mypython python
|
||||||
%{?sle15_python_module_pythons}
|
%{?sle15_python_module_pythons}
|
||||||
Name: python-setuptools%{psuffix}
|
Name: python-setuptools%{psuffix}
|
||||||
Version: 68.1.2
|
Version: 69.0.2
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Download, build, install, upgrade, and uninstall Python packages
|
Summary: Download, build, install, upgrade, and uninstall Python packages
|
||||||
License: Apache-2.0 AND MIT AND BSD-2-Clause AND Python-2.0
|
License: Apache-2.0 AND MIT AND BSD-2-Clause AND Python-2.0
|
||||||
@ -47,8 +47,8 @@ Source: https://files.pythonhosted.org/packages/source/s/setuptools/setu
|
|||||||
Patch0: sort-for-reproducibility.patch
|
Patch0: sort-for-reproducibility.patch
|
||||||
# PATCH-FIX-OPENSUSE fix-get-python-lib-python38.patch bsc#1204395
|
# PATCH-FIX-OPENSUSE fix-get-python-lib-python38.patch bsc#1204395
|
||||||
Patch2: fix-get-python-lib-python38.patch
|
Patch2: fix-get-python-lib-python38.patch
|
||||||
# PATCH-FIX-UPSTREAM https://github.com/pypa/setuptools/pull/4023 Address circular imports complaints by Sphinx 7.2+
|
# PATCH-FIX-OPENSUSE Allow forcing direct compilation, see gh#pypa/setuptools#4164
|
||||||
Patch3: sphinx72.patch
|
Patch3: allow-only-direct-compilation.patch
|
||||||
BuildRequires: %{python_module base >= 3.7}
|
BuildRequires: %{python_module base >= 3.7}
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
@ -105,6 +105,7 @@ rm -f setuptools/*.exe
|
|||||||
|
|
||||||
%install
|
%install
|
||||||
%if !%{with test} && !%{with wheel}
|
%if !%{with test} && !%{with wheel}
|
||||||
|
export SETUPTOOLS_FORCE_DIRECT=True
|
||||||
%python_install
|
%python_install
|
||||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||||
%endif
|
%endif
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:3d4dfa6d95f1b101d695a6160a7626e15583af71a5f52176efa5d39a054d475d
|
|
||||||
size 2198001
|
|
BIN
setuptools-69.0.2.tar.gz
(Stored with Git LFS)
Normal file
BIN
setuptools-69.0.2.tar.gz
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -6,10 +6,10 @@
|
|||||||
setuptools/tests/test_wheel.py | 8 ++++----
|
setuptools/tests/test_wheel.py | 8 ++++----
|
||||||
5 files changed, 8 insertions(+), 8 deletions(-)
|
5 files changed, 8 insertions(+), 8 deletions(-)
|
||||||
|
|
||||||
Index: setuptools-68.1.0/setuptools/command/easy_install.py
|
Index: setuptools-69.0.2/setuptools/command/easy_install.py
|
||||||
===================================================================
|
===================================================================
|
||||||
--- setuptools-68.1.0.orig/setuptools/command/easy_install.py
|
--- setuptools-69.0.2.orig/setuptools/command/easy_install.py
|
||||||
+++ setuptools-68.1.0/setuptools/command/easy_install.py
|
+++ setuptools-69.0.2/setuptools/command/easy_install.py
|
||||||
@@ -441,7 +441,7 @@ class easy_install(Command):
|
@@ -441,7 +441,7 @@ class easy_install(Command):
|
||||||
for spec in self.args:
|
for spec in self.args:
|
||||||
self.easy_install(spec, not self.no_deps)
|
self.easy_install(spec, not self.no_deps)
|
||||||
@ -19,50 +19,10 @@ Index: setuptools-68.1.0/setuptools/command/easy_install.py
|
|||||||
if self.root: # strip any package prefix
|
if self.root: # strip any package prefix
|
||||||
root_len = len(self.root)
|
root_len = len(self.root)
|
||||||
for counter in range(len(outputs)):
|
for counter in range(len(outputs)):
|
||||||
Index: setuptools-68.1.0/setuptools/command/egg_info.py
|
Index: setuptools-69.0.2/setuptools/tests/test_wheel.py
|
||||||
===================================================================
|
===================================================================
|
||||||
--- setuptools-68.1.0.orig/setuptools/command/egg_info.py
|
--- setuptools-69.0.2.orig/setuptools/tests/test_wheel.py
|
||||||
+++ setuptools-68.1.0/setuptools/command/egg_info.py
|
+++ setuptools-69.0.2/setuptools/tests/test_wheel.py
|
||||||
@@ -698,7 +698,7 @@ def _write_requirements(stream, reqs):
|
|
||||||
def append_cr(line):
|
|
||||||
return line + '\n'
|
|
||||||
|
|
||||||
- lines = map(append_cr, lines)
|
|
||||||
+ lines = map(append_cr, sorted(lines))
|
|
||||||
stream.writelines(lines)
|
|
||||||
|
|
||||||
|
|
||||||
Index: setuptools-68.1.0/setuptools/dist.py
|
|
||||||
===================================================================
|
|
||||||
--- setuptools-68.1.0.orig/setuptools/dist.py
|
|
||||||
+++ setuptools-68.1.0/setuptools/dist.py
|
|
||||||
@@ -215,7 +215,7 @@ def write_pkg_file(self, file): # noqa:
|
|
||||||
if self.long_description_content_type:
|
|
||||||
write_field('Description-Content-Type', self.long_description_content_type)
|
|
||||||
if self.provides_extras:
|
|
||||||
- for extra in self.provides_extras:
|
|
||||||
+ for extra in sorted(self.provides_extras):
|
|
||||||
write_field('Provides-Extra', extra)
|
|
||||||
|
|
||||||
self._write_list(file, 'License-File', self.license_files or [])
|
|
||||||
Index: setuptools-68.1.0/setuptools/tests/test_egg_info.py
|
|
||||||
===================================================================
|
|
||||||
--- setuptools-68.1.0.orig/setuptools/tests/test_egg_info.py
|
|
||||||
+++ setuptools-68.1.0/setuptools/tests/test_egg_info.py
|
|
||||||
@@ -353,8 +353,8 @@ class TestEggInfo:
|
|
||||||
wheel>=0.5
|
|
||||||
pytest
|
|
||||||
|
|
||||||
- wheel>=0.5
|
|
||||||
pytest
|
|
||||||
+ wheel>=0.5
|
|
||||||
''',
|
|
||||||
'''
|
|
||||||
install_requires_ordered
|
|
||||||
Index: setuptools-68.1.0/setuptools/tests/test_wheel.py
|
|
||||||
===================================================================
|
|
||||||
--- setuptools-68.1.0.orig/setuptools/tests/test_wheel.py
|
|
||||||
+++ setuptools-68.1.0/setuptools/tests/test_wheel.py
|
|
||||||
@@ -424,30 +424,30 @@ WHEEL_INSTALL_TESTS = (
|
@@ -424,30 +424,30 @@ WHEEL_INSTALL_TESTS = (
|
||||||
dict(
|
dict(
|
||||||
id='requires_ensure_order',
|
id='requires_ensure_order',
|
||||||
|
418
sphinx72.patch
418
sphinx72.patch
@ -1,418 +0,0 @@
|
|||||||
From c0985fee154e4a97ca2fd6355b40786841339dde Mon Sep 17 00:00:00 2001
|
|
||||||
From: Anderson Bravalheri <andersonbravalheri@gmail.com>
|
|
||||||
Date: Fri, 18 Aug 2023 10:47:21 +0100
|
|
||||||
Subject: [PATCH 1/5] Avoid circular imports between setuptools/__init__ and
|
|
||||||
monkey
|
|
||||||
|
|
||||||
---
|
|
||||||
setuptools/__init__.py | 18 +++++++-----------
|
|
||||||
setuptools/monkey.py | 16 ++++++++++------
|
|
||||||
2 files changed, 17 insertions(+), 17 deletions(-)
|
|
||||||
|
|
||||||
Index: setuptools-68.1.2/setuptools/__init__.py
|
|
||||||
===================================================================
|
|
||||||
--- setuptools-68.1.2.orig/setuptools/__init__.py
|
|
||||||
+++ setuptools-68.1.2/setuptools/__init__.py
|
|
||||||
@@ -5,22 +5,18 @@ import os
|
|
||||||
import re
|
|
||||||
|
|
||||||
import _distutils_hack.override # noqa: F401
|
|
||||||
-
|
|
||||||
import distutils.core
|
|
||||||
from distutils.errors import DistutilsOptionError
|
|
||||||
from distutils.util import convert_path as _convert_path
|
|
||||||
|
|
||||||
+from . import logging, monkey
|
|
||||||
+from . import version as _version_module
|
|
||||||
+from .depends import Require
|
|
||||||
+from .discovery import PackageFinder, PEP420PackageFinder
|
|
||||||
+from .dist import Distribution
|
|
||||||
+from .extension import Extension
|
|
||||||
from .warnings import SetuptoolsDeprecationWarning
|
|
||||||
|
|
||||||
-import setuptools.version
|
|
||||||
-from setuptools.extension import Extension
|
|
||||||
-from setuptools.dist import Distribution
|
|
||||||
-from setuptools.depends import Require
|
|
||||||
-from setuptools.discovery import PackageFinder, PEP420PackageFinder
|
|
||||||
-from . import monkey
|
|
||||||
-from . import logging
|
|
||||||
-
|
|
||||||
-
|
|
||||||
__all__ = [
|
|
||||||
'setup',
|
|
||||||
'Distribution',
|
|
||||||
@@ -32,7 +28,7 @@ __all__ = [
|
|
||||||
'find_namespace_packages',
|
|
||||||
]
|
|
||||||
|
|
||||||
-__version__ = setuptools.version.__version__
|
|
||||||
+__version__ = _version_module.__version__
|
|
||||||
|
|
||||||
bootstrap_install_from = None
|
|
||||||
|
|
||||||
Index: setuptools-68.1.2/setuptools/monkey.py
|
|
||||||
===================================================================
|
|
||||||
--- setuptools-68.1.2.orig/setuptools/monkey.py
|
|
||||||
+++ setuptools-68.1.2/setuptools/monkey.py
|
|
||||||
@@ -2,15 +2,15 @@
|
|
||||||
Monkey patching of distutils.
|
|
||||||
"""
|
|
||||||
|
|
||||||
-import sys
|
|
||||||
-import distutils.filelist
|
|
||||||
+import functools
|
|
||||||
+import inspect
|
|
||||||
import platform
|
|
||||||
+import sys
|
|
||||||
import types
|
|
||||||
-import functools
|
|
||||||
from importlib import import_module
|
|
||||||
-import inspect
|
|
||||||
|
|
||||||
-import setuptools
|
|
||||||
+import distutils.filelist
|
|
||||||
+
|
|
||||||
|
|
||||||
__all__ = []
|
|
||||||
"""
|
|
||||||
@@ -61,6 +61,8 @@ def get_unpatched_class(cls):
|
|
||||||
|
|
||||||
|
|
||||||
def patch_all():
|
|
||||||
+ import setuptools
|
|
||||||
+
|
|
||||||
# we can't patch distutils.cmd, alas
|
|
||||||
distutils.core.Command = setuptools.Command
|
|
||||||
|
|
||||||
@@ -97,9 +99,11 @@ def patch_all():
|
|
||||||
|
|
||||||
|
|
||||||
def _patch_distribution_metadata():
|
|
||||||
+ from . import dist
|
|
||||||
+
|
|
||||||
"""Patch write_pkg_file and read_pkg_file for higher metadata standards"""
|
|
||||||
for attr in ('write_pkg_file', 'read_pkg_file', 'get_metadata_version'):
|
|
||||||
- new_val = getattr(setuptools.dist, attr)
|
|
||||||
+ new_val = getattr(dist, attr)
|
|
||||||
setattr(distutils.dist.DistributionMetadata, attr, new_val)
|
|
||||||
|
|
||||||
|
|
||||||
Index: setuptools-68.1.2/setup.cfg
|
|
||||||
===================================================================
|
|
||||||
--- setuptools-68.1.2.orig/setup.cfg
|
|
||||||
+++ setuptools-68.1.2/setup.cfg
|
|
||||||
@@ -79,7 +79,7 @@ testing-integration =
|
|
||||||
build[virtualenv]
|
|
||||||
filelock>=3.4.0
|
|
||||||
docs =
|
|
||||||
- sphinx >= 3.5,<=7.1.2 # workaround, see comments in pypa/setuptools#4020
|
|
||||||
+ sphinx >= 3.5
|
|
||||||
jaraco.packaging >= 9.3
|
|
||||||
rst.linker >= 1.9
|
|
||||||
furo
|
|
||||||
Index: setuptools-68.1.2/setuptools/dist.py
|
|
||||||
===================================================================
|
|
||||||
--- setuptools-68.1.2.orig/setuptools/dist.py
|
|
||||||
+++ setuptools-68.1.2/setuptools/dist.py
|
|
||||||
@@ -1,60 +1,56 @@
|
|
||||||
__all__ = ['Distribution']
|
|
||||||
|
|
||||||
+
|
|
||||||
import io
|
|
||||||
-import sys
|
|
||||||
-import re
|
|
||||||
-import os
|
|
||||||
-import numbers
|
|
||||||
-import distutils.log
|
|
||||||
-import distutils.core
|
|
||||||
-import distutils.cmd
|
|
||||||
-import distutils.dist
|
|
||||||
-import distutils.command
|
|
||||||
-from distutils.util import strtobool
|
|
||||||
-from distutils.debug import DEBUG
|
|
||||||
-from distutils.fancy_getopt import translate_longopt
|
|
||||||
-from glob import iglob
|
|
||||||
import itertools
|
|
||||||
+import numbers
|
|
||||||
+import os
|
|
||||||
+import re
|
|
||||||
+import sys
|
|
||||||
import textwrap
|
|
||||||
-from contextlib import suppress
|
|
||||||
-from typing import List, Optional, Set, TYPE_CHECKING
|
|
||||||
-from pathlib import Path
|
|
||||||
-
|
|
||||||
from collections import defaultdict
|
|
||||||
+from contextlib import suppress
|
|
||||||
from email import message_from_file
|
|
||||||
+from glob import iglob
|
|
||||||
+from pathlib import Path
|
|
||||||
+from typing import TYPE_CHECKING, List, Optional, Set
|
|
||||||
|
|
||||||
+import distutils.cmd
|
|
||||||
+import distutils.command
|
|
||||||
+import distutils.core
|
|
||||||
+import distutils.dist
|
|
||||||
+import distutils.log
|
|
||||||
+from distutils.debug import DEBUG
|
|
||||||
from distutils.errors import DistutilsOptionError, DistutilsSetupError
|
|
||||||
+from distutils.fancy_getopt import translate_longopt
|
|
||||||
from distutils.util import rfc822_escape
|
|
||||||
+from distutils.util import strtobool
|
|
||||||
|
|
||||||
-from setuptools.extern import packaging
|
|
||||||
-from setuptools.extern import ordered_set
|
|
||||||
-from setuptools.extern.more_itertools import unique_everseen, partition
|
|
||||||
-
|
|
||||||
-import setuptools
|
|
||||||
-import setuptools.command
|
|
||||||
-from setuptools import windows_support
|
|
||||||
-from setuptools.monkey import get_unpatched
|
|
||||||
-from setuptools.config import setupcfg, pyprojecttoml
|
|
||||||
-from setuptools.discovery import ConfigDiscovery
|
|
||||||
+from .extern.more_itertools import partition, unique_everseen
|
|
||||||
+from .extern.ordered_set import OrderedSet
|
|
||||||
+from .extern.packaging.markers import InvalidMarker, Marker
|
|
||||||
+from .extern.packaging.specifiers import InvalidSpecifier, SpecifierSet
|
|
||||||
+from .extern.packaging.version import InvalidVersion, Version
|
|
||||||
|
|
||||||
-from setuptools.extern.packaging import version
|
|
||||||
-from . import _reqs
|
|
||||||
from . import _entry_points
|
|
||||||
from . import _normalization
|
|
||||||
+from . import _reqs
|
|
||||||
+from . import command as _ # noqa -- imported for side-effects
|
|
||||||
from ._importlib import metadata
|
|
||||||
+from .config import setupcfg, pyprojecttoml
|
|
||||||
+from .discovery import ConfigDiscovery
|
|
||||||
+from .monkey import get_unpatched
|
|
||||||
from .warnings import InformationOnly, SetuptoolsDeprecationWarning
|
|
||||||
|
|
||||||
+
|
|
||||||
if TYPE_CHECKING:
|
|
||||||
from email.message import Message
|
|
||||||
|
|
||||||
-__import__('setuptools.extern.packaging.specifiers')
|
|
||||||
-__import__('setuptools.extern.packaging.version')
|
|
||||||
-
|
|
||||||
|
|
||||||
def get_metadata_version(self):
|
|
||||||
mv = getattr(self, 'metadata_version', None)
|
|
||||||
if mv is None:
|
|
||||||
- mv = version.Version('2.1')
|
|
||||||
+ mv = Version('2.1')
|
|
||||||
self.metadata_version = mv
|
|
||||||
return mv
|
|
||||||
|
|
||||||
@@ -102,7 +98,7 @@ def read_pkg_file(self, file):
|
|
||||||
"""Reads the metadata values from a file object."""
|
|
||||||
msg = message_from_file(file)
|
|
||||||
|
|
||||||
- self.metadata_version = version.Version(msg['metadata-version'])
|
|
||||||
+ self.metadata_version = Version(msg['metadata-version'])
|
|
||||||
self.name = _read_field_from_msg(msg, 'name')
|
|
||||||
self.version = _read_field_from_msg(msg, 'version')
|
|
||||||
self.description = _read_field_from_msg(msg, 'summary')
|
|
||||||
@@ -116,9 +112,7 @@ def read_pkg_file(self, file):
|
|
||||||
self.license = _read_field_unescaped_from_msg(msg, 'license')
|
|
||||||
|
|
||||||
self.long_description = _read_field_unescaped_from_msg(msg, 'description')
|
|
||||||
- if self.long_description is None and self.metadata_version >= version.Version(
|
|
||||||
- '2.1'
|
|
||||||
- ):
|
|
||||||
+ if self.long_description is None and self.metadata_version >= Version('2.1'):
|
|
||||||
self.long_description = _read_payload_from_msg(msg)
|
|
||||||
self.description = _read_field_from_msg(msg, 'summary')
|
|
||||||
|
|
||||||
@@ -129,7 +123,7 @@ def read_pkg_file(self, file):
|
|
||||||
self.classifiers = _read_list_from_msg(msg, 'classifier')
|
|
||||||
|
|
||||||
# PEP 314 - these fields only exist in 1.1
|
|
||||||
- if self.metadata_version == version.Version('1.1'):
|
|
||||||
+ if self.metadata_version == Version('1.1'):
|
|
||||||
self.requires = _read_list_from_msg(msg, 'requires')
|
|
||||||
self.provides = _read_list_from_msg(msg, 'provides')
|
|
||||||
self.obsoletes = _read_list_from_msg(msg, 'obsoletes')
|
|
||||||
@@ -299,7 +293,7 @@ def _check_extra(extra, reqs):
|
|
||||||
name, sep, marker = extra.partition(':')
|
|
||||||
try:
|
|
||||||
_check_marker(marker)
|
|
||||||
- except packaging.markers.InvalidMarker:
|
|
||||||
+ except InvalidMarker:
|
|
||||||
msg = f"Invalid environment marker: {marker} ({extra!r})"
|
|
||||||
raise DistutilsSetupError(msg) from None
|
|
||||||
list(_reqs.parse(reqs))
|
|
||||||
@@ -308,7 +302,7 @@ def _check_extra(extra, reqs):
|
|
||||||
def _check_marker(marker):
|
|
||||||
if not marker:
|
|
||||||
return
|
|
||||||
- m = packaging.markers.Marker(marker)
|
|
||||||
+ m = Marker(marker)
|
|
||||||
m.evaluate()
|
|
||||||
|
|
||||||
|
|
||||||
@@ -344,8 +338,8 @@ def check_requirements(dist, attr, value
|
|
||||||
def check_specifier(dist, attr, value):
|
|
||||||
"""Verify that value is a valid version specifier"""
|
|
||||||
try:
|
|
||||||
- packaging.specifiers.SpecifierSet(value)
|
|
||||||
- except (packaging.specifiers.InvalidSpecifier, AttributeError) as error:
|
|
||||||
+ SpecifierSet(value)
|
|
||||||
+ except (InvalidSpecifier, AttributeError) as error:
|
|
||||||
tmpl = (
|
|
||||||
"{attr!r} must be a string " "containing valid version specifiers; {error}"
|
|
||||||
)
|
|
||||||
@@ -448,7 +442,7 @@ class Distribution(_Distribution):
|
|
||||||
_DISTUTILS_UNSUPPORTED_METADATA = {
|
|
||||||
'long_description_content_type': lambda: None,
|
|
||||||
'project_urls': dict,
|
|
||||||
- 'provides_extras': ordered_set.OrderedSet,
|
|
||||||
+ 'provides_extras': OrderedSet,
|
|
||||||
'license_file': lambda: None,
|
|
||||||
'license_files': lambda: None,
|
|
||||||
}
|
|
||||||
@@ -499,7 +493,7 @@ class Distribution(_Distribution):
|
|
||||||
# Save the original dependencies before they are processed into the egg format
|
|
||||||
self._orig_extras_require = {}
|
|
||||||
self._orig_install_requires = []
|
|
||||||
- self._tmp_extras_require = defaultdict(ordered_set.OrderedSet)
|
|
||||||
+ self._tmp_extras_require = defaultdict(OrderedSet)
|
|
||||||
|
|
||||||
self.set_defaults = ConfigDiscovery(self)
|
|
||||||
|
|
||||||
@@ -535,10 +529,12 @@ class Distribution(_Distribution):
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def _normalize_version(version):
|
|
||||||
- if isinstance(version, setuptools.sic) or version is None:
|
|
||||||
+ from . import sic
|
|
||||||
+
|
|
||||||
+ if isinstance(version, sic) or version is None:
|
|
||||||
return version
|
|
||||||
|
|
||||||
- normalized = str(packaging.version.Version(version))
|
|
||||||
+ normalized = str(Version(version))
|
|
||||||
if version != normalized:
|
|
||||||
InformationOnly.emit(f"Normalizing '{version}' to '{normalized}'")
|
|
||||||
return normalized
|
|
||||||
@@ -552,8 +548,10 @@ class Distribution(_Distribution):
|
|
||||||
|
|
||||||
if version is not None:
|
|
||||||
try:
|
|
||||||
- packaging.version.Version(version)
|
|
||||||
- except (packaging.version.InvalidVersion, TypeError):
|
|
||||||
+ Version(version)
|
|
||||||
+ except (InvalidVersion, TypeError):
|
|
||||||
+ from . import sic
|
|
||||||
+
|
|
||||||
SetuptoolsDeprecationWarning.emit(
|
|
||||||
f"Invalid version: {version!r}.",
|
|
||||||
"""
|
|
||||||
@@ -566,7 +564,7 @@ class Distribution(_Distribution):
|
|
||||||
# Warning initially introduced in 26 Sept 2014
|
|
||||||
# pypa/packaging already removed legacy versions.
|
|
||||||
)
|
|
||||||
- return setuptools.sic(version)
|
|
||||||
+ return sic(version)
|
|
||||||
return version
|
|
||||||
|
|
||||||
def _finalize_requires(self):
|
|
||||||
@@ -602,7 +600,7 @@ class Distribution(_Distribution):
|
|
||||||
`"extra:{marker}": ["barbazquux"]`.
|
|
||||||
"""
|
|
||||||
spec_ext_reqs = getattr(self, 'extras_require', None) or {}
|
|
||||||
- tmp = defaultdict(ordered_set.OrderedSet)
|
|
||||||
+ tmp = defaultdict(OrderedSet)
|
|
||||||
self._tmp_extras_require = getattr(self, '_tmp_extras_require', tmp)
|
|
||||||
for section, v in spec_ext_reqs.items():
|
|
||||||
# Do not strip empty sections.
|
|
||||||
@@ -903,7 +901,7 @@ class Distribution(_Distribution):
|
|
||||||
|
|
||||||
def fetch_build_eggs(self, requires):
|
|
||||||
"""Resolve pre-setup requirements"""
|
|
||||||
- from setuptools.installer import _fetch_build_eggs
|
|
||||||
+ from .installer import _fetch_build_eggs
|
|
||||||
|
|
||||||
return _fetch_build_eggs(self, requires)
|
|
||||||
|
|
||||||
@@ -946,6 +944,8 @@ class Distribution(_Distribution):
|
|
||||||
ep.load()(self, ep.name, value)
|
|
||||||
|
|
||||||
def get_egg_cache_dir(self):
|
|
||||||
+ from . import windows_support
|
|
||||||
+
|
|
||||||
egg_cache_dir = os.path.join(os.curdir, '.eggs')
|
|
||||||
if not os.path.exists(egg_cache_dir):
|
|
||||||
os.mkdir(egg_cache_dir)
|
|
||||||
@@ -966,7 +966,7 @@ class Distribution(_Distribution):
|
|
||||||
|
|
||||||
def fetch_build_egg(self, req):
|
|
||||||
"""Fetch an egg needed for building"""
|
|
||||||
- from setuptools.installer import fetch_build_egg
|
|
||||||
+ from .installer import fetch_build_egg
|
|
||||||
|
|
||||||
return fetch_build_egg(self, req)
|
|
||||||
|
|
||||||
Index: setuptools-68.1.2/setuptools/depends.py
|
|
||||||
===================================================================
|
|
||||||
--- setuptools-68.1.2.orig/setuptools/depends.py
|
|
||||||
+++ setuptools-68.1.2/setuptools/depends.py
|
|
||||||
@@ -3,10 +3,10 @@ import marshal
|
|
||||||
import contextlib
|
|
||||||
import dis
|
|
||||||
|
|
||||||
-from setuptools.extern.packaging import version
|
|
||||||
|
|
||||||
-from ._imp import find_module, PY_COMPILED, PY_FROZEN, PY_SOURCE
|
|
||||||
from . import _imp
|
|
||||||
+from ._imp import find_module, PY_COMPILED, PY_FROZEN, PY_SOURCE
|
|
||||||
+from .extern.packaging.version import Version
|
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['Require', 'find_module', 'get_module_constant', 'extract_constant']
|
|
||||||
@@ -19,7 +19,7 @@ class Require:
|
|
||||||
self, name, requested_version, module, homepage='', attribute=None, format=None
|
|
||||||
):
|
|
||||||
if format is None and requested_version is not None:
|
|
||||||
- format = version.Version
|
|
||||||
+ format = Version
|
|
||||||
|
|
||||||
if format is not None:
|
|
||||||
requested_version = format(requested_version)
|
|
||||||
Index: setuptools-68.1.2/setuptools/tests/test_setuptools.py
|
|
||||||
===================================================================
|
|
||||||
--- setuptools-68.1.2.orig/setuptools/tests/test_setuptools.py
|
|
||||||
+++ setuptools-68.1.2/setuptools/tests/test_setuptools.py
|
|
||||||
@@ -11,13 +11,13 @@ from zipfile import ZipFile
|
|
||||||
|
|
||||||
import pytest
|
|
||||||
|
|
||||||
-from setuptools.extern.packaging import version
|
|
||||||
-
|
|
||||||
import setuptools
|
|
||||||
import setuptools.dist
|
|
||||||
import setuptools.depends as dep
|
|
||||||
from setuptools.depends import Require
|
|
||||||
|
|
||||||
+from setuptools.extern.packaging.version import Version
|
|
||||||
+
|
|
||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
|
||||||
def isolated_dir(tmpdir_cwd):
|
|
||||||
@@ -94,7 +94,7 @@ class TestDepends:
|
|
||||||
|
|
||||||
assert req.name == 'Json'
|
|
||||||
assert req.module == 'json'
|
|
||||||
- assert req.requested_version == version.Version('1.0.3')
|
|
||||||
+ assert req.requested_version == Version('1.0.3')
|
|
||||||
assert req.attribute == '__version__'
|
|
||||||
assert req.full_name() == 'Json-1.0.3'
|
|
||||||
|
|
||||||
Index: setuptools-68.1.2/newsfragments/4023.misc.rst
|
|
||||||
===================================================================
|
|
||||||
--- /dev/null
|
|
||||||
+++ setuptools-68.1.2/newsfragments/4023.misc.rst
|
|
||||||
@@ -0,0 +1,2 @@
|
|
||||||
+Avoid circular imports (particularly between ``setuptools/{__init__,dist,monkey}.py``),
|
|
||||||
+or at least delay them, so tools like ``sphinx`` don't have problems analysing the codebase.
|
|
Loading…
Reference in New Issue
Block a user