From 06cca8c2c18dbd0f85c2b372883fe4a66ff4c63b Mon Sep 17 00:00:00 2001 From: Anderson Bravalheri Date: Mon, 12 Jun 2023 10:23:44 +0100 Subject: [PATCH 01/10] Remove deprecated setuptools.dist._get_unpatched --- setuptools/dist.py | 10 ---------- setuptools/tests/test_dist.py | 6 ------ 2 files changed, 16 deletions(-) diff --git a/setuptools/dist.py b/setuptools/dist.py index e5a7b8ed9e..4458a58033 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -51,16 +51,6 @@ __import__('setuptools.extern.packaging.version') -def _get_unpatched(cls): - DistDeprecationWarning.emit( - "Private function", - "Do not call this function", - due_date=(2023, 6, 1), - # Warning initially introduced in 2016 - ) - return get_unpatched(cls) - - def get_metadata_version(self): mv = getattr(self, 'metadata_version', None) if mv is None: diff --git a/setuptools/tests/test_dist.py b/setuptools/tests/test_dist.py index e7d2f5ca25..e4e9b07ba8 100644 --- a/setuptools/tests/test_dist.py +++ b/setuptools/tests/test_dist.py @@ -7,9 +7,7 @@ import urllib.parse from distutils.errors import DistutilsSetupError from setuptools.dist import ( - _get_unpatched, check_package_data, - DistDeprecationWarning, check_specifier, rfc822_escape, rfc822_unescape, @@ -67,10 +65,6 @@ def sdist_with_index(distname, version): assert [dist.key for dist in resolved_dists if dist] == reqs -def test_dist__get_unpatched_deprecated(): - pytest.warns(DistDeprecationWarning, _get_unpatched, [""]) - - EXAMPLE_BASE_INFO = dict( name="package", version="0.0.1", From 62b68970f55c071c67f1b84b196285a4f1eddbb1 Mon Sep 17 00:00:00 2001 From: Anderson Bravalheri Date: Mon, 12 Jun 2023 10:24:14 +0100 Subject: [PATCH 02/10] Remove deprecated autofixing of broken egg-info folder (using '-') --- setuptools/command/develop.py | 6 +----- setuptools/command/egg_info.py | 22 ---------------------- 2 files changed, 1 insertion(+), 27 deletions(-) diff --git a/setuptools/command/develop.py b/setuptools/command/develop.py index 5630ca4cdc..20e3e1711b 100644 --- a/setuptools/command/develop.py +++ b/setuptools/command/develop.py @@ -1,6 +1,6 @@ from distutils.util import convert_path from distutils import log -from distutils.errors import DistutilsError, DistutilsOptionError +from distutils.errors import DistutilsOptionError import os import glob import io @@ -45,10 +45,6 @@ def finalize_options(self): import pkg_resources ei = self.get_finalized_command("egg_info") - if ei.broken_egg_info: - template = "Please rename %r to %r before using 'develop'" - args = ei.egg_info, ei.broken_egg_info - raise DistutilsError(template % args) self.args = [ei.egg_name] easy_install.finalize_options(self) diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index f5163ae7b5..9272e28b0a 100644 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -181,7 +181,6 @@ def initialize_options(self): self.egg_name = None self.egg_info = None self.egg_version = None - self.broken_egg_info = False self.ignore_egg_info_in_manifest = False #################################### @@ -236,8 +235,6 @@ def finalize_options(self): self.egg_info = _normalization.filename_component(self.egg_name) + '.egg-info' if self.egg_base != os.curdir: self.egg_info = os.path.join(self.egg_base, self.egg_info) - if '-' in self.egg_name: - self.check_broken_egg_info() # Set package version for the benefit of dumber commands # (e.g. sdist, bdist_wininst, etc.) @@ -325,25 +322,6 @@ def find_sources(self): mm.run() self.filelist = mm.filelist - def check_broken_egg_info(self): - bei = self.egg_name + '.egg-info' - if self.egg_base != os.curdir: - bei = os.path.join(self.egg_base, bei) - if os.path.exists(bei): - EggInfoDeprecationWarning.emit( - "Invalid egg-info directory name.", - f""" - Your current .egg-info directory has a '-' in its name; - this will not work correctly with setuptools commands. - - Please rename {bei!r} to {self.egg_info!r} to correct this problem. - """, - due_date=(2023, 6, 1), - # Old warning, introduced in 2005, might be safe to remove soon - ) - self.broken_egg_info = self.egg_info - self.egg_info = bei # make it work for now - class FileList(_FileList): # Implementations of the various MANIFEST.in commands From e96f6a3ee3b0df47b4731a200695bd6151f64111 Mon Sep 17 00:00:00 2001 From: Anderson Bravalheri Date: Mon, 12 Jun 2023 10:39:01 +0100 Subject: [PATCH 03/10] Remove deprecated APIs in easy_install --- setuptools/command/easy_install.py | 37 --------------------------- setuptools/tests/test_easy_install.py | 23 +---------------- 2 files changed, 1 insertion(+), 59 deletions(-) diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 8585da92ab..0b8d115988 100644 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -2115,24 +2115,6 @@ def importlib_load_entry_point(spec, group, name): command_spec_class = CommandSpec - @classmethod - def get_script_args(cls, dist, executable=None, wininst=False): - # for backward compatibility - EasyInstallDeprecationWarning.emit("Use get_args", due_date=(2023, 6, 1)) - # This is a direct API call, it should be safe to remove soon. - writer = (WindowsScriptWriter if wininst else ScriptWriter).best() - header = cls.get_script_header("", executable, wininst) - return writer.get_args(dist, header) - - @classmethod - def get_script_header(cls, script_text, executable=None, wininst=False): - # for backward compatibility - EasyInstallDeprecationWarning.emit("Use get_header", due_date=(2023, 6, 1)) - # This is a direct API call, it should be safe to remove soon. - if wininst: - executable = "python.exe" - return cls.get_header(script_text, executable) - @classmethod def get_args(cls, dist, header=None): """ @@ -2160,13 +2142,6 @@ def _ensure_safe_name(name): if has_path_sep: raise ValueError("Path separators not allowed in script names") - @classmethod - def get_writer(cls, force_windows): - # for backward compatibility - EasyInstallDeprecationWarning.emit("Use best", due_date=(2023, 6, 1)) - # This is a direct API call, it should be safe to remove soon. - return WindowsScriptWriter.best() if force_windows else cls.best() - @classmethod def best(cls): """ @@ -2193,13 +2168,6 @@ def get_header(cls, script_text="", executable=None): class WindowsScriptWriter(ScriptWriter): command_spec_class = WindowsCommandSpec - @classmethod - def get_writer(cls): - # for backward compatibility - EasyInstallDeprecationWarning.emit("Use best", due_date=(2023, 6, 1)) - # This is a direct API call, it should be safe to remove soon. - return cls.best() - @classmethod def best(cls): """ @@ -2287,11 +2255,6 @@ def _get_script_args(cls, type_, name, header, script_text): yield (m_name, load_launcher_manifest(name), 't') -# for backward-compatibility -get_script_args = ScriptWriter.get_script_args -get_script_header = ScriptWriter.get_script_header - - def get_win_launcher(type): """ Load the Windows launcher (executable) suitable for launching a script. diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py index 709964b3ac..56b4aa0b78 100644 --- a/setuptools/tests/test_easy_install.py +++ b/setuptools/tests/test_easy_install.py @@ -27,12 +27,7 @@ from setuptools import sandbox from setuptools.sandbox import run_setup import setuptools.command.easy_install as ei -from setuptools.command.easy_install import ( - EasyInstallDeprecationWarning, - ScriptWriter, - PthDistributions, - WindowsScriptWriter, -) +from setuptools.command.easy_install import PthDistributions from setuptools.dist import Distribution from pkg_resources import normalize_path, working_set from pkg_resources import Distribution as PRDistribution @@ -295,22 +290,6 @@ def test_script_install(self, sdist_script, tmpdir, monkeypatch): cmd.easy_install(sdist_script) assert (target / 'mypkg_script').exists() - def test_dist_get_script_args_deprecated(self): - with pytest.warns(EasyInstallDeprecationWarning): - ScriptWriter.get_script_args(None, None) - - def test_dist_get_script_header_deprecated(self): - with pytest.warns(EasyInstallDeprecationWarning): - ScriptWriter.get_script_header("") - - def test_dist_get_writer_deprecated(self): - with pytest.warns(EasyInstallDeprecationWarning): - ScriptWriter.get_writer(None) - - def test_dist_WindowsScriptWriter_get_writer_deprecated(self): - with pytest.warns(EasyInstallDeprecationWarning): - WindowsScriptWriter.get_writer() - @pytest.mark.filterwarnings('ignore:Unbuilt egg') class TestPTHFileWriter: From cb552d6d8b3646fea5ec81e4783e6da30395dc7e Mon Sep 17 00:00:00 2001 From: Anderson Bravalheri Date: Mon, 12 Jun 2023 10:40:25 +0100 Subject: [PATCH 04/10] Remove deprecated egg_info.get_pkg_info_revision --- setuptools/command/egg_info.py | 20 -------------------- setuptools/tests/test_egg_info.py | 4 ---- 2 files changed, 24 deletions(-) diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 9272e28b0a..a4e7947d9b 100644 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -751,26 +751,6 @@ def write_entries(cmd, basename, filename): cmd.write_or_delete_file('entry points', filename, defn, True) -def get_pkg_info_revision(): - """ - Get a -r### off of PKG-INFO Version in case this is an sdist of - a subversion revision. - """ - EggInfoDeprecationWarning.emit( - "Deprecated API call", - "get_pkg_info_revision is deprecated.", - due_date=(2023, 6, 1), - # Warning introduced in 11 Dec 2015, should be safe to remove - ) - if os.path.exists('PKG-INFO'): - with io.open('PKG-INFO') as f: - for line in f: - match = re.match(r"Version:.*-r(\d+)\s*$", line) - if match: - return int(match.group(1)) - return 0 - - def _egg_basename(egg_name, egg_version, py_version=None, platform=None): """Compute filename of the output egg. Private API.""" name = _normalization.filename_component(egg_name) diff --git a/setuptools/tests/test_egg_info.py b/setuptools/tests/test_egg_info.py index 6a2a989308..a990bdd710 100644 --- a/setuptools/tests/test_egg_info.py +++ b/setuptools/tests/test_egg_info.py @@ -16,7 +16,6 @@ from setuptools.command.egg_info import ( EggInfoDeprecationWarning, egg_info, - get_pkg_info_revision, manifest_maker, write_entries, ) @@ -1105,9 +1104,6 @@ def test_egg_info_tag_only_once(self, tmpdir_cwd, env): pkg_info_lines = pkginfo_file.read().split('\n') assert 'Version: 0.0.0.dev0' in pkg_info_lines - def test_get_pkg_info_revision_deprecated(self): - pytest.warns(EggInfoDeprecationWarning, get_pkg_info_revision) - class TestWriteEntries: From e4ca949fc88e7eb4006374f09851a13976d7b76f Mon Sep 17 00:00:00 2001 From: Anderson Bravalheri Date: Mon, 12 Jun 2023 10:43:11 +0100 Subject: [PATCH 05/10] Remove reminiscent depends.txt chech (depends.txt is deprecated) --- setup.cfg | 1 - setuptools/command/egg_info.py | 14 -------------- setuptools/tests/test_egg_info.py | 1 - 3 files changed, 16 deletions(-) diff --git a/setup.cfg b/setup.cfg index 07cb6aa9c5..d5efb7224e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -161,7 +161,6 @@ egg_info.writers = eager_resources.txt = setuptools.command.egg_info:overwrite_arg namespace_packages.txt = setuptools.command.egg_info:overwrite_arg top_level.txt = setuptools.command.egg_info:write_toplevel_names - depends.txt = setuptools.command.egg_info:warn_depends_obsolete dependency_links.txt = setuptools.command.egg_info:overwrite_arg [egg_info] diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index a4e7947d9b..7ca7b80eac 100644 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -683,20 +683,6 @@ def write_pkg_info(cmd, basename, filename): bdist_egg.write_safety_flag(cmd.egg_info, safe) -def warn_depends_obsolete(cmd, basename, filename): - if os.path.exists(filename): - EggInfoDeprecationWarning.emit( - "Deprecated config.", - """ - 'depends.txt' is not used by setuptools >= 0.6! - Configure your dependencies via `setup.cfg` or `pyproject.toml` instead. - """, - see_docs="userguide/declarative_config.html", - due_date=(2023, 6, 1), - # Old warning, introduced in 2005, it might be safe to remove soon. - ) - - def _write_requirements(stream, reqs): lines = yield_lines(reqs or ()) diff --git a/setuptools/tests/test_egg_info.py b/setuptools/tests/test_egg_info.py index a990bdd710..9db5b08b98 100644 --- a/setuptools/tests/test_egg_info.py +++ b/setuptools/tests/test_egg_info.py @@ -14,7 +14,6 @@ from setuptools import errors from setuptools.command.egg_info import ( - EggInfoDeprecationWarning, egg_info, manifest_maker, write_entries, From cc8580b1cd3f22852f76f0a9242243071773f6bb Mon Sep 17 00:00:00 2001 From: Anderson Bravalheri Date: Mon, 12 Jun 2023 10:48:28 +0100 Subject: [PATCH 06/10] Stop ignoring invalid pyproject.toml --- setuptools/config/pyprojecttoml.py | 61 +------------------ setuptools/tests/config/test_pyprojecttoml.py | 35 ----------- 2 files changed, 1 insertion(+), 95 deletions(-) diff --git a/setuptools/config/pyprojecttoml.py b/setuptools/config/pyprojecttoml.py index 8d1dcaed54..ceb2dbe3e4 100644 --- a/setuptools/config/pyprojecttoml.py +++ b/setuptools/config/pyprojecttoml.py @@ -114,7 +114,6 @@ def read_configuration( # the default would be an improvement. # `ini2toml` backfills include_package_data=False when nothing is explicitly given, # therefore setting a default here is backwards compatible. - orig_setuptools_table = setuptools_table.copy() if dist and getattr(dist, "include_package_data", None) is not None: setuptools_table.setdefault("include-package-data", dist.include_package_data) else: @@ -123,20 +122,10 @@ def read_configuration( asdict["tool"] = tool_table tool_table["setuptools"] = setuptools_table - try: + with _ignore_errors(ignore_option_errors): # Don't complain about unrelated errors (e.g. tools not using the "tool" table) subset = {"project": project_table, "tool": {"setuptools": setuptools_table}} validate(subset, filepath) - except Exception as ex: - # TODO: Remove the following once the feature stabilizes: - if _skip_bad_config(project_table, orig_setuptools_table, dist): - return {} - # TODO: After the previous statement is removed the try/except can be replaced - # by the _ignore_errors context manager. - if ignore_option_errors: - _logger.debug(f"ignored error: {ex.__class__.__name__} - {ex}") - else: - raise # re-raise exception if expand: root_dir = os.path.dirname(filepath) @@ -145,36 +134,6 @@ def read_configuration( return asdict -def _skip_bad_config( - project_cfg: dict, setuptools_cfg: dict, dist: Optional["Distribution"] -) -> bool: - """Be temporarily forgiving with invalid ``pyproject.toml``""" - # See pypa/setuptools#3199 and pypa/cibuildwheel#1064 - - if dist is None or ( - dist.metadata.name is None - and dist.metadata.version is None - and dist.install_requires is None - ): - # It seems that the build is not getting any configuration from other places - return False - - if setuptools_cfg: - # If `[tool.setuptools]` is set, then `pyproject.toml` config is intentional - return False - - given_config = set(project_cfg.keys()) - popular_subset = {"name", "version", "python_requires", "requires-python"} - if given_config <= popular_subset: - # It seems that the docs in cibuildtool has been inadvertently encouraging users - # to create `pyproject.toml` files that are not compliant with the standards. - # Let's be forgiving for the time being. - _InvalidFile.emit() - return True - - return False - - def expand_configuration( config: dict, root_dir: Optional[_Path] = None, @@ -476,21 +435,3 @@ def __exit__(self, exc_type, exc_value, traceback): class _BetaConfiguration(SetuptoolsWarning): _SUMMARY = "Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*." - - -class _InvalidFile(SetuptoolsWarning): - _SUMMARY = "The given `pyproject.toml` file is invalid and would be ignored." - _DETAILS = """ - ############################ - # Invalid `pyproject.toml` # - ############################ - - Any configurations in `pyproject.toml` will be ignored. - Please note that future releases of setuptools will halt the build process - if an invalid file is given. - - To prevent setuptools from considering `pyproject.toml` please - DO NOT include both `[project]` or `[tool.setuptools]` tables in your file. - """ - _DUE_DATE = (2023, 6, 1) # warning introduced in 2022-03-26 - _SEE_DOCS = "userguide/pyproject_config.html" diff --git a/setuptools/tests/config/test_pyprojecttoml.py b/setuptools/tests/config/test_pyprojecttoml.py index 811328f52b..81ec949a42 100644 --- a/setuptools/tests/config/test_pyprojecttoml.py +++ b/setuptools/tests/config/test_pyprojecttoml.py @@ -12,7 +12,6 @@ expand_configuration, apply_configuration, validate, - _InvalidFile, ) from setuptools.dist import Distribution from setuptools.errors import OptionError @@ -366,37 +365,3 @@ def test_include_package_data_in_setuppy(tmp_path): assert dist.get_name() == "myproj" assert dist.get_version() == "42" assert dist.include_package_data is False - - -class TestSkipBadConfig: - @pytest.mark.parametrize( - "setup_attrs", - [ - {"name": "myproj"}, - {"install_requires": ["does-not-exist"]}, - ], - ) - @pytest.mark.parametrize( - "pyproject_content", - [ - "[project]\nrequires-python = '>=3.7'\n", - "[project]\nversion = '42'\nrequires-python = '>=3.7'\n", - "[project]\nname='othername'\nrequires-python = '>=3.7'\n", - ], - ) - def test_popular_config(self, tmp_path, pyproject_content, setup_attrs): - # See pypa/setuptools#3199 and pypa/cibuildwheel#1064 - pyproject = tmp_path / "pyproject.toml" - pyproject.write_text(pyproject_content) - dist = Distribution(attrs=setup_attrs) - - prev_name = dist.get_name() - prev_deps = dist.install_requires - - with pytest.warns(_InvalidFile, match=r"DO NOT include.*\[project\].* table"): - dist = apply_configuration(dist, pyproject) - - assert dist.get_name() != "othername" - assert dist.get_name() == prev_name - assert dist.python_requires is None - assert set(dist.install_requires) == set(prev_deps) From 2a3201830b3dac776a2ad6718c84e835b9de994e Mon Sep 17 00:00:00 2001 From: Anderson Bravalheri Date: Mon, 12 Jun 2023 11:05:20 +0100 Subject: [PATCH 07/10] Remove deprecated SVN support for package_index --- setuptools/package_index.py | 45 +++------------------------ setuptools/tests/test_packageindex.py | 14 ++------- 2 files changed, 8 insertions(+), 51 deletions(-) diff --git a/setuptools/package_index.py b/setuptools/package_index.py index b992048c0d..3130acef2c 100644 --- a/setuptools/package_index.py +++ b/setuptools/package_index.py @@ -39,7 +39,6 @@ from fnmatch import translate from setuptools.wheel import Wheel from setuptools.extern.more_itertools import unique_everseen -from setuptools.warnings import SetuptoolsDeprecationWarning EGG_FRAGMENT = re.compile(r'^egg=([-A-Za-z0-9_.+!]+)$') @@ -849,50 +848,16 @@ def scan_url(self, url): def _attempt_download(self, url, filename): headers = self._download_to(url, filename) if 'html' in headers.get('content-type', '').lower(): - return self._download_html(url, headers, filename) + return self._invalid_download_html(url, headers, filename) else: return filename - def _download_html(self, url, headers, filename): - file = open(filename) - for line in file: - if line.strip(): - # Check for a subversion index page - if re.search(r'([^- ]+ - )?Revision \d+:', line): - # it's a subversion index page: - file.close() - os.unlink(filename) - return self._download_svn(url, filename) - break # not an index page - file.close() + def _invalid_download_html(self, url, headers, filename): os.unlink(filename) - raise DistutilsError("Unexpected HTML page found at " + url) + raise DistutilsError(f"Unexpected HTML page found at {url}") - def _download_svn(self, url, filename): - SetuptoolsDeprecationWarning.emit( - "Invalid config", - f"SVN download support is deprecated: {url}", - due_date=(2023, 6, 1), # Initially introduced in 23 Sept 2018 - ) - url = url.split('#', 1)[0] # remove any fragment for svn's sake - creds = '' - if url.lower().startswith('svn:') and '@' in url: - scheme, netloc, path, p, q, f = urllib.parse.urlparse(url) - if not netloc and path.startswith('//') and '/' in path[2:]: - netloc, path = path[2:].split('/', 1) - auth, host = _splituser(netloc) - if auth: - if ':' in auth: - user, pw = auth.split(':', 1) - creds = " --username=%s --password=%s" % (user, pw) - else: - creds = " --username=" + auth - netloc = host - parts = scheme, netloc, url, p, q, f - url = urllib.parse.urlunparse(parts) - self.info("Doing subversion checkout from %s to %s", url, filename) - os.system("svn checkout%s -q %s %s" % (creds, url, filename)) - return filename + def _download_svn(self, url, _filename): + raise DistutilsError(f"Invalid config, SVN download is not supported: {url}") @staticmethod def _vcs_split_rev_from_url(url, pop_prefix=False): diff --git a/setuptools/tests/test_packageindex.py b/setuptools/tests/test_packageindex.py index 8b5356dc8e..f1fa745b66 100644 --- a/setuptools/tests/test_packageindex.py +++ b/setuptools/tests/test_packageindex.py @@ -226,17 +226,9 @@ def test_download_svn(self, tmpdir): url = 'svn+https://svn.example/project#egg=foo' index = setuptools.package_index.PackageIndex() - with pytest.warns(UserWarning): - with mock.patch("os.system") as os_system_mock: - result = index.download(url, str(tmpdir)) - - os_system_mock.assert_called() - - expected_dir = str(tmpdir / 'project') - expected = ( - 'svn checkout -q ' 'svn+https://svn.example/project {expected_dir}' - ).format(**locals()) - os_system_mock.assert_called_once_with(expected) + msg = r".*SVN download is not supported.*" + with pytest.raises(distutils.errors.DistutilsError, match=msg): + index.download(url, str(tmpdir)) class TestContentCheckers: From 48d36366040138a42bbecf6a995dc2bfb97ca435 Mon Sep 17 00:00:00 2001 From: Anderson Bravalheri <andersonbravalheri@gmail.com> Date: Mon, 12 Jun 2023 12:31:27 +0100 Subject: [PATCH 08/10] Add news fragment --- changelog.d/3948.breaking.1.rst | 1 + changelog.d/3948.breaking.2.rst | 4 ++++ changelog.d/3948.breaking.3.rst | 4 ++++ changelog.d/3948.breaking.4.rst | 1 + changelog.d/3948.breaking.5.rst | 1 + changelog.d/3948.breaking.6.rst | 1 + changelog.d/3948.breaking.7.rst | 4 ++++ 7 files changed, 16 insertions(+) create mode 100644 changelog.d/3948.breaking.1.rst create mode 100644 changelog.d/3948.breaking.2.rst create mode 100644 changelog.d/3948.breaking.3.rst create mode 100644 changelog.d/3948.breaking.4.rst create mode 100644 changelog.d/3948.breaking.5.rst create mode 100644 changelog.d/3948.breaking.6.rst create mode 100644 changelog.d/3948.breaking.7.rst diff --git a/changelog.d/3948.breaking.1.rst b/changelog.d/3948.breaking.1.rst new file mode 100644 index 0000000000..074afb1a24 --- /dev/null +++ b/changelog.d/3948.breaking.1.rst @@ -0,0 +1 @@ +Removed verification for existing ``depends.txt`` file (deprecated since v0.5a4). diff --git a/changelog.d/3948.breaking.2.rst b/changelog.d/3948.breaking.2.rst new file mode 100644 index 0000000000..e1f72fd35d --- /dev/null +++ b/changelog.d/3948.breaking.2.rst @@ -0,0 +1,4 @@ +Remove autofixing of broken ``.egg-info`` directories containing the ``-`` +character in their base name (without suffix). +They should no longer be produced by sufficiently new versions of ``setuptools`` +(warning introduced in 2005). diff --git a/changelog.d/3948.breaking.3.rst b/changelog.d/3948.breaking.3.rst new file mode 100644 index 0000000000..735eb6762b --- /dev/null +++ b/changelog.d/3948.breaking.3.rst @@ -0,0 +1,4 @@ +Remove deprecated APIs in ``easy_install``: ``get_script_args``, +``get_script_header`` and ``get_writer``. +The direct usage of ``easy_install`` has been deprecated since v58.3.0, +and the warnings regarding these APIs predate that version. diff --git a/changelog.d/3948.breaking.4.rst b/changelog.d/3948.breaking.4.rst new file mode 100644 index 0000000000..6551706e0d --- /dev/null +++ b/changelog.d/3948.breaking.4.rst @@ -0,0 +1 @@ +Removed ``egg_info.get_pkg_info_revision`` (deprecated since 2015). diff --git a/changelog.d/3948.breaking.5.rst b/changelog.d/3948.breaking.5.rst new file mode 100644 index 0000000000..beb68523ca --- /dev/null +++ b/changelog.d/3948.breaking.5.rst @@ -0,0 +1 @@ +Removed ``setuptools.dist._get_unpatched`` (deprecated since 2016) diff --git a/changelog.d/3948.breaking.6.rst b/changelog.d/3948.breaking.6.rst new file mode 100644 index 0000000000..67d918ebce --- /dev/null +++ b/changelog.d/3948.breaking.6.rst @@ -0,0 +1 @@ +Removed support for SVN in ``setuptools.package_index`` (deprecated since 2018). diff --git a/changelog.d/3948.breaking.7.rst b/changelog.d/3948.breaking.7.rst new file mode 100644 index 0000000000..397649495a --- /dev/null +++ b/changelog.d/3948.breaking.7.rst @@ -0,0 +1,4 @@ +Removed support for invalid ``pyproject.toml`` files. +During the implementation of PEP 621, it was identified that some users were +producing invalid files. As a transitional measure, the validation was relaxed +for a few use cases. The grace period, however, came to an end. From 92382deb2a957ff29840a28d4f527f00fc6c84a5 Mon Sep 17 00:00:00 2001 From: Anderson Bravalheri <andersonbravalheri@gmail.com> Date: Tue, 13 Jun 2023 12:39:26 +0100 Subject: [PATCH 09/10] Re-enable SETUPTOOLS_ENFORCE_DEPRECATION This is done so in the future we are reminded to remove the deprecated code. --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 19bc120bce..2a5217339d 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,7 @@ deps = # Ideally all the dependencies should be set as "extras" setenv = PYTHONWARNDEFAULTENCODING = 1 - SETUPTOOLS_ENFORCE_DEPRECATION = 0 # temporarily disable + SETUPTOOLS_ENFORCE_DEPRECATION = 1 commands = pytest {posargs} usedevelop = True From 6ef81fef5e73cb07f1856fffd06299cf86ada302 Mon Sep 17 00:00:00 2001 From: Anderson Bravalheri <andersonbravalheri@gmail.com> Date: Mon, 19 Jun 2023 12:19:06 +0100 Subject: [PATCH 10/10] Leave an empty 'egg_info.warn_depends_obsolete' to avoid erros when updating from source --- setuptools/command/egg_info.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 7ca7b80eac..66228f9bee 100644 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -683,6 +683,16 @@ def write_pkg_info(cmd, basename, filename): bdist_egg.write_safety_flag(cmd.egg_info, safe) +def warn_depends_obsolete(cmd, basename, filename): + """ + Unused: left to avoid errors when updating (from source) from <= 67.8. + Old installations have a .dist-info directory with the entry-point + ``depends.txt = setuptools.command.egg_info:warn_depends_obsolete``. + This may trigger errors when running the first egg_info in build_meta. + TODO: Remove this function in a version sufficiently > 68. + """ + + def _write_requirements(stream, reqs): lines = yield_lines(reqs or ())