- 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
    ``pyproject.toml``.
    This removes the transitional ability of users configuring
    certain parameters via ``setup.py`` without making the

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-setuptools?expand=0&rev=255
This commit is contained in:
Dirk Mueller 2023-12-18 12:04:07 +00:00 committed by Git OBS Bridge
parent 2f1f6ef704
commit cfe933cfe4
6 changed files with 100 additions and 485 deletions

View File

@ -1,3 +1,62 @@
-------------------------------------------------------------------
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>
@ -7,22 +66,22 @@ Mon Oct 16 12:03:15 UTC 2023 - Daniel Garcia Moreno <daniel.garcia@suse.com>
Tue Aug 22 13:02:46 UTC 2023 - Markéta Machová <mmachova@suse.com>
- update to 68.1.2
* Fix editable install finder handling of nested packages, by only
handling 1 level of nesting and relying on importlib.machinery
to find the remaining modules based on the parent package path.
* Fix editable install finder handling of nested packages, by only
handling 1 level of nesting and relying on importlib.machinery
to find the remaining modules based on the parent package path.
- add sphinx72.patch: address circular imports in sphinx 7.2+
-------------------------------------------------------------------
Wed Aug 16 07:53:31 UTC 2023 - Markéta Machová <mmachova@suse.com>
- update to 68.1.0
* Removed code referencing bdist_wininst in install_scripts.
* Removed code referencing bdist_wininst in install_scripts.
* Promote pyproject.tomls [tool.setuptools] out of beta.
* Automatically add files listed in Extension.depends to sdists,
as long as they are contained in the project directory
* Automatically add files listed in Extension.depends to sdists,
as long as they are contained in the project directory
* Require Python 3.8 or later.
* Use default encoding to create .pth files with editable_wheel.
* Detects (and complain about) scripts and gui-scripts set via
* Detects (and complain about) scripts and gui-scripts set via
setup.py when pyproject.toml does not include them in dynamic.
-------------------------------------------------------------------
@ -81,7 +140,7 @@ Wed May 3 02:23:58 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
dont raise error
* #3849: Overhaul warning system for better visibility.
* #3884: Add a stacklevel parameter to warnings.warn() to provide more
information to the user.
information to the user.
- Add patch use-tarfile-extraction_filter.patch:
* Set an extraction_filter to avoid a warning.
@ -847,7 +906,7 @@ Wed Jul 13 09:01:18 UTC 2022 - Ben Greiner <code@bnavigator.de>
-------------------------------------------------------------------
Fri Mar 25 01:13:50 UTC 2022 - Steve Kowalik <steven.kowalik@suse.com>
- Refresh remove_mock.patch to add a missing file to it.
- Refresh remove_mock.patch to add a missing file to it.
-------------------------------------------------------------------
Mon Feb 7 10:59:43 UTC 2022 - Dirk Müller <dmueller@suse.com>
@ -995,7 +1054,7 @@ Thu Aug 13 11:03:41 UTC 2020 - Ondřej Súkup <mimi.vx@gmail.com>
Tue Jun 23 15:41:14 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
- use local source dir for pytest imports
gh#openSUSE/python-rpm-macros#48
gh#openSUSE/python-rpm-macros#48
-------------------------------------------------------------------
Mon Apr 6 17:14:11 UTC 2020 - Matej Cepl <mcepl@suse.com>
@ -1076,10 +1135,10 @@ Wed Oct 16 11:55:57 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
Fri Oct 11 09:29:35 UTC 2019 - Marketa Calabkova <mcalabkova@suse.com>
- Update to 41.4.0
* In declarative config, now traps errors when invalid python_requires
* In declarative config, now traps errors when invalid python_requires
values are supplied.
* When storing extras, rely on OrderedSet to retain order of extras
as indicated by the packager, which will also be deterministic
* When storing extras, rely on OrderedSet to retain order of extras
as indicated by the packager, which will also be deterministic
on Python 2.7 (with PYTHONHASHSEED unset) and Python 3.6+.
* Fixed failing integration test triggered by 'long_description_content_type' in packaging.
@ -1688,7 +1747,7 @@ Thu Feb 16 15:58:12 UTC 2017 - jmatejek@suse.com
-------------------------------------------------------------------
Mon Dec 12 12:57:12 UTC 2016 - hpj@urpla.net
- make sure, that setuptools-certpath.patch is applied
- make sure, that setuptools-certpath.patch is applied
unconditionally (fixes traceback in setuptools/ssl_support.py)
-------------------------------------------------------------------
@ -2127,7 +2186,7 @@ Mon Feb 1 10:57:28 UTC 2016 - toddrme2178@gmail.com
Thu Oct 22 13:50:42 UTC 2015 - toddrme2178@gmail.com
- Update to 18.4
* Test command now always invokes unittest,
* Test command now always invokes unittest,
even if no test suite is supplied.
-------------------------------------------------------------------
@ -2453,7 +2512,7 @@ Fri Mar 27 14:30:44 UTC 2015 - tbechtold@suse.com
-------------------------------------------------------------------
Thu Jan 15 17:48:35 CET 2015 - lchiquitto@suse.de
- Add package to SLE 12 SDK (FATE#318137, bnc#913229)
- Add package to SLE 12 SDK (FATE#318137, bnc#913229)
-------------------------------------------------------------------
Wed Jul 23 08:54:56 UTC 2014 - sleep_walker@suse.cz
@ -2522,24 +2581,24 @@ Thu May 8 11:25:32 UTC 2014 - toddrme2178@gmail.com
Thu Apr 17 11:57:05 UTC 2014 - toddrme2178@gmail.com
- Update to version 3.4.4
* Issue #184: Correct failure where find_package over-matched
* Issue #184: Correct failure where find_package over-matched
packages when directory traversal isn't short-circuited.
- Update to version 3.4.3
* Issue #183: Really fix test command with Python 3.1.
- Update to version 3.4.2
* Issue #183: Fix additional regression in test command on
* Issue #183: Fix additional regression in test command on
Python 3.1.
- Update to version 3.4.1
* Issue #180: Fix regression in test command not caught
* Issue #180: Fix regression in test command not caught
by py.test-run tests.
- Update to version 3.4
* Issue #176: Add parameter to the test command to support a
* Issue #176: Add parameter to the test command to support a
custom test runner: --test-runner or -r.
* Issue #177: Now assume most common invocation to install
command on platforms/environments without stack support
(issuing a warning). Setuptools now installs naturally on
* Issue #177: Now assume most common invocation to install
command on platforms/environments without stack support
(issuing a warning). Setuptools now installs naturally on
IronPython. Behavior on CPython should be unchanged.
- Remove %check, which now depends on pytest and thus introduces
- Remove %check, which now depends on pytest and thus introduces
a dependency loop (setuptools->pytest->py->setuptools)
-------------------------------------------------------------------
@ -2623,7 +2682,7 @@ Fri Nov 8 13:29:36 UTC 2013 - aj@ajaissle.de
- New upstream version
* Fixed behavior of NameError handling in 'script template (dev).py' (script launcher for 'develop' installs).
* ez_setup.py now ensures partial downloads are cleaned up following a failed download.
* Distribute #363 and Issue #55: Skip an sdist test that fails on locales other than UTF-8.
* Distribute #363 and Issue #55: Skip an sdist test that fails on locales other than UTF-8.
-------------------------------------------------------------------
Fri Oct 11 08:40:08 UTC 2013 - speilicke@suse.com
@ -2682,7 +2741,7 @@ Fri Oct 11 08:40:08 UTC 2013 - speilicke@suse.com
-------------------------------------------------------------------
Sun Aug 18 13:12:32 UTC 2013 - toddrme2178@gmail.com
- Re-add Requires: python. Not needed for recent releases, but a
- Re-add Requires: python. Not needed for recent releases, but a
lot of SLE packages fail without it.
-------------------------------------------------------------------

View File

@ -38,7 +38,7 @@
%define mypython python
%{?sle15_python_module_pythons}
Name: python-setuptools%{psuffix}
Version: 68.1.2
Version: 69.0.2
Release: 0
Summary: Download, build, install, upgrade, and uninstall Python packages
License: Apache-2.0 AND MIT AND BSD-2-Clause AND Python-2.0
@ -47,8 +47,6 @@ Source: https://files.pythonhosted.org/packages/source/s/setuptools/setu
Patch0: sort-for-reproducibility.patch
# PATCH-FIX-OPENSUSE fix-get-python-lib-python38.patch bsc#1204395
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+
Patch3: sphinx72.patch
BuildRequires: %{python_module base >= 3.7}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
@ -105,6 +103,8 @@ rm -f setuptools/*.exe
%install
%if !%{with test} && !%{with wheel}
# workaround python 3.12 distutils import
export PYTHONDONTWRITEBYTECODE=1
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif

View File

@ -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

Binary file not shown.

View File

@ -6,10 +6,10 @@
setuptools/tests/test_wheel.py | 8 ++++----
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-68.1.0/setuptools/command/easy_install.py
--- setuptools-69.0.2.orig/setuptools/command/easy_install.py
+++ setuptools-69.0.2/setuptools/command/easy_install.py
@@ -441,7 +441,7 @@ class easy_install(Command):
for spec in self.args:
self.easy_install(spec, not self.no_deps)
@ -19,36 +19,10 @@ Index: setuptools-68.1.0/setuptools/command/easy_install.py
if self.root: # strip any package prefix
root_len = len(self.root)
for counter in range(len(outputs)):
Index: setuptools-68.1.0/setuptools/command/egg_info.py
Index: setuptools-69.0.2/setuptools/tests/test_egg_info.py
===================================================================
--- setuptools-68.1.0.orig/setuptools/command/egg_info.py
+++ setuptools-68.1.0/setuptools/command/egg_info.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
--- setuptools-69.0.2.orig/setuptools/tests/test_egg_info.py
+++ setuptools-69.0.2/setuptools/tests/test_egg_info.py
@@ -353,8 +353,8 @@ class TestEggInfo:
wheel>=0.5
pytest
@ -59,10 +33,10 @@ Index: setuptools-68.1.0/setuptools/tests/test_egg_info.py
''',
'''
install_requires_ordered
Index: setuptools-68.1.0/setuptools/tests/test_wheel.py
Index: setuptools-69.0.2/setuptools/tests/test_wheel.py
===================================================================
--- setuptools-68.1.0.orig/setuptools/tests/test_wheel.py
+++ setuptools-68.1.0/setuptools/tests/test_wheel.py
--- setuptools-69.0.2.orig/setuptools/tests/test_wheel.py
+++ setuptools-69.0.2/setuptools/tests/test_wheel.py
@@ -424,30 +424,30 @@ WHEEL_INSTALL_TESTS = (
dict(
id='requires_ensure_order',

View File

@ -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.