Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/pypa/setuptools into pkg_re…
Browse files Browse the repository at this point in the history
…sources-adapter-types
  • Loading branch information
Avasam committed May 22, 2024
2 parents 2c2874d + 52d7324 commit 1105948
Show file tree
Hide file tree
Showing 94 changed files with 2,603 additions and 257 deletions.
4 changes: 2 additions & 2 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[bumpversion]
current_version = 69.5.1
current_version = 70.0.0
commit = True
tag = True

[bumpversion:file:setup.cfg]
[bumpversion:file:pyproject.toml]
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ include
lib
distribute.egg-info
setuptools.egg-info
setuptools/tests/bdist_wheel_testdata/*/*.egg-info/
.coverage
.eggs
.tox
Expand Down
56 changes: 56 additions & 0 deletions NEWS.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,59 @@
v70.0.0
=======

Features
--------

- Emit a warning when ``[tools.setuptools]`` is present in ``pyproject.toml`` and will be ignored. -- by :user:`SnoopJ` (#4150)
- Improved `AttributeError` error message if ``pkg_resources.EntryPoint.require`` is called without extras or distribution
Gracefully "do nothing" when trying to activate a ``pkg_resources.Distribution`` with a `None` location, rather than raising a `TypeError`
-- by :user:`Avasam` (#4262)
- Typed the dynamically defined variables from `pkg_resources` -- by :user:`Avasam` (#4267)
- Modernized and refactored VCS handling in package_index. (#4332)


Bugfixes
--------

- In install command, use super to call the superclass methods. Avoids race conditions when monkeypatching from _distutils_system_mod occurs late. (#4136)
- Fix finder template for lenient editable installs of implicit nested namespaces
constructed by using ``package_dir`` to reorganise directory structure. (#4278)
- Fix an error with `UnicodeDecodeError` handling in ``pkg_resources`` when trying to read files in UTF-8 with a fallback -- by :user:`Avasam` (#4348)


Improved Documentation
----------------------

- Uses RST substitution to put badges in 1 line. (#4312)


Deprecations and Removals
-------------------------

- Further adoption of UTF-8 in ``setuptools``.
This change regards mostly files produced and consumed during the build process
(e.g. metadata files, script wrappers, automatically updated config files, etc..)
Although precautions were taken to minimize disruptions, some edge cases might
be subject to backwards incompatibility.

Support for ``"locale"`` encoding is now **deprecated**. (#4309)
- Remove ``setuptools.convert_path`` after long deprecation period.
This function was never defined by ``setuptools`` itself, but rather a
side-effect of an import for internal usage. (#4322)
- Remove fallback for customisations of ``distutils``' ``build.sub_command`` after long
deprecated period.
Users are advised to import ``build`` directly from ``setuptools.command.build``. (#4322)
- Removed ``typing_extensions`` from vendored dependencies -- by :user:`Avasam` (#4324)
- Remove deprecated ``setuptools.dep_util``.
The provided alternative is ``setuptools.modified``. (#4360)


Misc
----

- #4255, #4280, #4282, #4308, #4348


v69.5.1
=======

Expand Down
1 change: 1 addition & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def pytest_configure(config):
'pkg_resources/_vendor',
'setuptools/config/_validate_pyproject',
'setuptools/modified.py',
'setuptools/tests/bdist_wheel_testdata',
]


Expand Down
6 changes: 2 additions & 4 deletions docs/build_meta.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@ being used to package your scripts and install from source). To use it with
build-backend = "setuptools.build_meta"

``build_meta`` implements ``setuptools``' build system support.
The ``setuptools`` package implements the ``build_sdist``
command and the ``wheel`` package implements the ``build_wheel``
command; the latter is a dependency of the former
exposed via :pep:`517` hooks.
The ``setuptools`` package implements the ``build_sdist`` and
``build_wheel`` commands.

Use ``setuptools``' :ref:`declarative config <declarative config>` to
specify the package information in ``setup.cfg``::
Expand Down
6 changes: 3 additions & 3 deletions docs/userguide/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ library will be used to actually do the packaging.

Historically this documentation has unnecessarily listed ``wheel``
in the ``requires`` list, and many projects still do that. This is
not recommended. The backend automatically adds ``wheel`` dependency
when it is required, and listing it explicitly causes it to be
unnecessarily required for source distribution builds.
not recommended, as the backend no longer requires the ``wheel``
package, and listing it explicitly causes it to be unnecessarily
required for source distribution builds.
You should only include ``wheel`` in ``requires`` if you need to explicitly
access it during build time (e.g. if your project needs a ``setup.py``
script that imports ``wheel``).
Expand Down
1 change: 1 addition & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ exclude = (?x)(
| ^.+?/(_vendor|extern)/ # Vendored
| ^setuptools/_distutils/ # Vendored
| ^setuptools/config/_validate_pyproject/ # Auto-generated
| ^setuptools/tests/bdist_wheel_testdata/ # Duplicate module name
)

# Ignoring attr-defined because setuptools wraps a lot of distutils classes, adding new attributes,
Expand Down
1 change: 1 addition & 0 deletions newsfragments/1386.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adopted the ``bdist_wheel`` command from the ``wheel`` project -- by :user:`agronholm`
1 change: 0 additions & 1 deletion newsfragments/4150.feature.rst

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/4255.misc.rst

This file was deleted.

3 changes: 0 additions & 3 deletions newsfragments/4262.feature.rst

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/4267.feature.rst

This file was deleted.

2 changes: 0 additions & 2 deletions newsfragments/4278.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/4280.misc.rst

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/4282.misc.rst

This file was deleted.

2 changes: 0 additions & 2 deletions newsfragments/4308.misc.rst

This file was deleted.

7 changes: 0 additions & 7 deletions newsfragments/4309.removal.rst

This file was deleted.

1 change: 1 addition & 0 deletions newsfragments/4310.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Migrated Setuptools' own config to pyproject.toml
1 change: 0 additions & 1 deletion newsfragments/4312.doc.rst

This file was deleted.

3 changes: 0 additions & 3 deletions newsfragments/4322.removal.1.rst

This file was deleted.

3 changes: 0 additions & 3 deletions newsfragments/4322.removal.2.rst

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/4324.removal.rst

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/4332.feature.rst

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/4348.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/4348.misc.rst

This file was deleted.

3 changes: 2 additions & 1 deletion pkg_resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1683,14 +1683,15 @@ def _validate_resource_path(path):
os.path.pardir in path.split(posixpath.sep)
or posixpath.isabs(path)
or ntpath.isabs(path)
or path.startswith("\\")
)
if not invalid:
return

msg = "Use of .. or absolute path in a resource path is not allowed."

# Aggressively disallow Windows absolute paths
if ntpath.isabs(path) and not posixpath.isabs(path):
if (path.startswith("\\") or ntpath.isabs(path)) and not posixpath.isabs(path):
raise ValueError(msg)

# for compatibility, warn; in future
Expand Down
170 changes: 170 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,174 @@ requires = []
build-backend = "setuptools.build_meta"
backend-path = ["."]

[project]
name = "setuptools"
version = "70.0.0"
authors = [
{ name = "Python Packaging Authority", email = "distutils-sig@python.org" },
]
description = "Easily download, build, install, upgrade, and uninstall Python packages"
readme = "README.rst"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Archiving :: Packaging",
"Topic :: System :: Systems Administration",
"Topic :: Utilities",
]
keywords = ["CPAN PyPI distutils eggs package management"]
requires-python = ">=3.8"
dependencies = []

[project.urls]
Homepage = "https://github.com/pypa/setuptools"
Documentation = "https://setuptools.pypa.io/"
Changelog = "https://setuptools.pypa.io/en/stable/history.html"

[project.optional-dependencies]
testing = [
# upstream
"pytest >= 6, != 8.1.1",
"pytest-checkdocs >= 2.4",
'pytest-cov; python_implementation != "PyPy"', # coverage seems to make PyPy extremely slow
"pytest-mypy",
"pytest-enabler >= 2.2",
# workaround for pypa/setuptools#3921
'pytest-ruff >= 0.2.1; sys_platform != "cygwin"',

# local
"virtualenv>=13.0.0",
"wheel",
"pip>=19.1", # For proper file:// URLs support.
"packaging>=23.2",
"jaraco.envs>=2.2",
"pytest-xdist>=3", # Dropped dependency on pytest-fork and py
"jaraco.path>=3.2.0",
"build[virtualenv]>=1.0.3",
"filelock>=3.4.0",
"ini2toml[lite]>=0.14",
"tomli-w>=1.0.0",
"pytest-timeout",
'pytest-perf; sys_platform != "cygwin"', # workaround for jaraco/inflect#195, pydantic/pydantic-core#773 (see #3986)
# for tools/finalize.py
'jaraco.develop >= 7.21; python_version >= "3.9" and sys_platform != "cygwin"',
"pytest-home >= 0.5",
"mypy==1.10.0", # pin mypy version so a new version doesn't suddenly cause the CI to fail
# No Python 3.11 dependencies require tomli, but needed for type-checking since we import it directly
"tomli",
# No Python 3.12 dependencies require importlib_metadata, but needed for type-checking since we import it directly
"importlib_metadata",
"pytest-subprocess",

# workaround for pypa/setuptools#4333
"pyproject-hooks!=1.1",
]
docs = [
# upstream
"sphinx >= 3.5",
"jaraco.packaging >= 9.3",
"rst.linker >= 1.9",
"furo",
"sphinx-lint",

# tidelift
"jaraco.tidelift >= 1.4",

# local
"pygments-github-lexers==0.0.5",
"sphinx-favicon",
"sphinx-inline-tabs",
"sphinx-reredirects",
"sphinxcontrib-towncrier",
"sphinx-notfound-page >=1,<2",

# workaround for pypa/setuptools#4333
"pyproject-hooks!=1.1",
]
ssl = []
certs = []

[project.entry-points."distutils.commands"]
alias = "setuptools.command.alias:alias"
bdist_egg = "setuptools.command.bdist_egg:bdist_egg"
bdist_rpm = "setuptools.command.bdist_rpm:bdist_rpm"
bdist_wheel = "setuptools.command.bdist_wheel:bdist_wheel"
build = "setuptools.command.build:build"
build_clib = "setuptools.command.build_clib:build_clib"
build_ext = "setuptools.command.build_ext:build_ext"
build_py = "setuptools.command.build_py:build_py"
develop = "setuptools.command.develop:develop"
dist_info = "setuptools.command.dist_info:dist_info"
easy_install = "setuptools.command.easy_install:easy_install"
editable_wheel = "setuptools.command.editable_wheel:editable_wheel"
egg_info = "setuptools.command.egg_info:egg_info"
install = "setuptools.command.install:install"
install_egg_info = "setuptools.command.install_egg_info:install_egg_info"
install_lib = "setuptools.command.install_lib:install_lib"
install_scripts = "setuptools.command.install_scripts:install_scripts"
rotate = "setuptools.command.rotate:rotate"
saveopts = "setuptools.command.saveopts:saveopts"
sdist = "setuptools.command.sdist:sdist"
setopt = "setuptools.command.setopt:setopt"
test = "setuptools.command.test:test"
upload_docs = "setuptools.command.upload_docs:upload_docs"

[project.entry-points."setuptools.finalize_distribution_options"]
parent_finalize = "setuptools.dist:_Distribution.finalize_options"
keywords = "setuptools.dist:Distribution._finalize_setup_keywords"

[project.entry-points."distutils.setup_keywords"]
eager_resources = "setuptools.dist:assert_string_list"
namespace_packages = "setuptools.dist:check_nsp"
extras_require = "setuptools.dist:check_extras"
install_requires = "setuptools.dist:check_requirements"
tests_require = "setuptools.dist:check_requirements"
setup_requires = "setuptools.dist:check_requirements"
python_requires = "setuptools.dist:check_specifier"
entry_points = "setuptools.dist:check_entry_points"
test_suite = "setuptools.dist:check_test_suite"
zip_safe = "setuptools.dist:assert_bool"
package_data = "setuptools.dist:check_package_data"
exclude_package_data = "setuptools.dist:check_package_data"
include_package_data = "setuptools.dist:assert_bool"
packages = "setuptools.dist:check_packages"
dependency_links = "setuptools.dist:assert_string_list"
test_loader = "setuptools.dist:check_importable"
test_runner = "setuptools.dist:check_importable"
use_2to3 = "setuptools.dist:invalid_unless_false"

[project.entry-points."egg_info.writers"]
PKG-INFO = "setuptools.command.egg_info:write_pkg_info"
"requires.txt" = "setuptools.command.egg_info:write_requirements"
"entry_points.txt" = "setuptools.command.egg_info:write_entries"
"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"
"dependency_links.txt" = "setuptools.command.egg_info:overwrite_arg"

[tool.setuptools]
# disabled as it causes tests to be included #2505
# include_package_data = true
include-package-data = false

[tool.setuptools.packages.find]
exclude = [
"*.tests",
"*.tests.*",
"tools*",
"debian*",
"launcher*",
"newsfragments*",
"docs",
"docs.*",
]
namespaces = true

[tool.distutils.sdist]
formats = "zip"

[tool.setuptools_scm]
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ filterwarnings=
# realpython/pytest-mypy#152
ignore:'encoding' argument not specified::pytest_mypy

# TODO: Set encoding when openning/writing tmpdir files with pytest's LocalPath.open
# TODO: Set encoding when opening/writing tmpdir files with pytest's LocalPath.open
# see pypa/setuptools#4326
ignore:'encoding' argument not specified::_pytest

Expand Down
Loading

0 comments on commit 1105948

Please sign in to comment.