Skip to content

Commit

Permalink
Merge branch 'main' into pytest-mypy-log-filename
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam authored Sep 12, 2024
2 parents dbae4e9 + 56fc311 commit 0605f01
Show file tree
Hide file tree
Showing 101 changed files with 2,140 additions and 7,743 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 73.0.1
current_version = 74.1.2
commit = True
tag = True

Expand Down
3 changes: 3 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ omit =
*/_vendor/*
*/tools/*
*/setuptools/_distutils/*
# See #4588 for integration tests coverage
*/setuptools/tests/integration/*
*/setuptools/tests/test_integration.py

disable_warnings =
couldnt-parse
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
matrix:
python:
- "3.8"
- "3.12"
- "3.13"
platform:
- ubuntu-latest
- macos-latest
Expand All @@ -55,6 +55,10 @@ jobs:
platform: ubuntu-latest
- python: "3.11"
platform: ubuntu-latest
- python: "3.12"
platform: ubuntu-latest
- python: "3.14"
platform: ubuntu-latest
- python: pypy3.10
platform: ubuntu-latest
distutils: stdlib
Expand All @@ -68,7 +72,7 @@ jobs:
exclude:
- {python: "3.8", platform: "macos-latest"}
runs-on: ${{ matrix.platform }}
continue-on-error: ${{ matrix.python == '3.13' }}
continue-on-error: ${{ matrix.python == '3.14' }}
env:
SETUPTOOLS_USE_DISTUTILS: ${{ matrix.distutils || 'local' }}
timeout-minutes: 75
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/pyright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- gh-readonly-queue/**
tags:
# required if branches-ignore is supplied (jaraco/skeleton#103)
- '**'
- "**"
pull_request:
workflow_dispatch:

Expand All @@ -24,15 +24,17 @@ env:
# pin pyright version so a new version doesn't suddenly cause the CI to fail,
# until types-setuptools is removed from typeshed.
# For help with static-typing issues, or pyright update, ping @Avasam
#
# An exact version from https://github.com/microsoft/pyright/releases or "latest"
PYRIGHT_VERSION: "1.1.377"

# Environment variable to support color support (jaraco/skeleton#66)
FORCE_COLOR: 1

# Suppress noisy pip warnings
PIP_DISABLE_PIP_VERSION_CHECK: 'true'
PIP_NO_PYTHON_VERSION_WARNING: 'true'
PIP_NO_WARN_SCRIPT_LOCATION: 'true'
PIP_DISABLE_PIP_VERSION_CHECK: "true"
PIP_NO_PYTHON_VERSION_WARNING: "true"
PIP_NO_WARN_SCRIPT_LOCATION: "true"

jobs:
pyright:
Expand Down Expand Up @@ -65,7 +67,7 @@ jobs:
else
echo '> pip install pyright==${{ env.PYRIGHT_VERSION }}'
fi
echo 'pyright --threads'
echo '> pyright --threads'
shell: bash
- name: Run pyright
uses: jakebailey/pyright-action@v2
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ include tox.ini
include setuptools/tests/config/setupcfg_examples.txt
include setuptools/config/*.schema.json
global-exclude *.py[cod] __pycache__
prune .tox
63 changes: 63 additions & 0 deletions NEWS.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,66 @@
v74.1.2
=======

Bugfixes
--------

- Fixed TypeError in sdist filelist processing by adding support for pathlib Paths for the build_base. (#4615)
- Removed degraded and deprecated ``test_integration`` (easy_install) from the test suite. (#4632)


v74.1.1
=======

Bugfixes
--------

- Fixed TypeError in ``msvc.EnvironmentInfo.return_env`` when no runtime redistributables are installed. (#1902)


v74.1.0
=======

Features
--------

- Added support for defining ``ext-modules`` via ``pyproject.toml``
(**EXPERIMENTAL**, may change in future releases). (#4568)


Bugfixes
--------

- Merge with pypa/distutils@3dcdf8567, removing the duplicate vendored copy of packaging. (#4622)
- Restored ``setuptools.msvc.Environmentinfo`` as it is used externally. (#4625)


v74.0.0
=======

Features
--------

- Changed the type of error raised by ``setuptools.command.easy_install.CommandSpec.from_param`` on unsupported argument from `AttributeError` to `TypeError` -- by :user:`Avasam` (#4548)
- Added detection of ARM64 variant of MSVC -- by :user:`saschanaz` (#4553)
- Made ``setuptools.package_index.Credential`` a `typing.NamedTuple` -- by :user:`Avasam` (#4585)
- Reraise error from ``setuptools.command.easy_install.auto_chmod`` instead of nonsensical ``TypeError: 'Exception' object is not subscriptable`` -- by :user:`Avasam` (#4593)
- Fully typed all collection attributes in ``pkg_resources`` -- by :user:`Avasam` (#4598)
- Automatically exclude ``.tox|.nox|.venv`` directories from ``sdist``. (#4603)


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

- Removed the monkeypatching of distutils._msvccompiler. Now all compiler logic is consolidated in distutils. (#4600)
- Synced with pypa/distutils@58fe058e4, including consolidating Visual Studio 2017 support (#4600, pypa/distutils#289), removal of deprecated legacy MSVC compiler modules (pypa/distutils#287), suppressing of errors when the home directory is missing (pypa/distutils#278), removal of wininst binaries (pypa/distutils#282). (#4606)


Misc
----

- #4592


v73.0.1
=======

Expand Down
7 changes: 7 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import os
import platform
import sys

import pytest
Expand Down Expand Up @@ -82,3 +83,9 @@ def conditional_skip(request):
pytest.skip("running integration tests only")
if not running_integration_tests and is_integration_test:
pytest.skip("skipping integration tests")


@pytest.fixture
def windows_only():
if platform.system() != 'Windows':
pytest.skip("Windows only")
42 changes: 21 additions & 21 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

extensions = [
'sphinx.ext.autodoc',
'jaraco.packaging.sphinx',
Expand Down Expand Up @@ -93,6 +95,7 @@

# Be strict about any broken references
nitpicky = True
nitpick_ignore: list[tuple[str, str]] = []

# Include Python intersphinx mapping to prevent failures
# jaraco/skeleton#51
Expand All @@ -104,32 +107,17 @@
# Preserve authored syntax for defaults
autodoc_preserve_defaults = True

intersphinx_mapping.update({
'pip': ('https://pip.pypa.io/en/latest', None),
'build': ('https://build.pypa.io/en/latest', None),
'PyPUG': ('https://packaging.python.org/en/latest/', None),
'packaging': ('https://packaging.pypa.io/en/latest/', None),
'twine': ('https://twine.readthedocs.io/en/stable/', None),
'importlib-resources': (
'https://importlib-resources.readthedocs.io/en/latest',
None,
),
})

# Add support for linking usernames
github_url = 'https://github.com'
github_repo_org = 'pypa'
github_repo_name = 'setuptools'
github_repo_slug = f'{github_repo_org}/{github_repo_name}'
github_repo_url = f'{github_url}/{github_repo_slug}'
github_sponsors_url = f'{github_url}/sponsors'
# Add support for linking usernames, PyPI projects, Wikipedia pages
github_url = 'https://github.com/'
extlinks = {
'user': (f'{github_sponsors_url}/%s', '@%s'),
'user': (f'{github_url}%s', '@%s'),
'pypi': ('https://pypi.org/project/%s', '%s'),
'wiki': ('https://wikipedia.org/wiki/%s', '%s'),
}
extensions += ['sphinx.ext.extlinks']

# local

# Ref: https://github.com/python-attrs/attrs/pull/571/files\
# #diff-85987f48f1258d9ee486e3191495582dR82
default_role = 'any'
Expand Down Expand Up @@ -163,7 +151,7 @@
# Support for distutils

# Ref: https://stackoverflow.com/a/30624034/595220
nitpick_ignore = [
nitpick_ignore += [
('c:func', 'SHGetSpecialFolderPath'), # ref to MS docs
('envvar', 'DIST_EXTRA_CONFIG'), # undocumented
('envvar', 'DISTUTILS_DEBUG'), # undocumented
Expand Down Expand Up @@ -245,3 +233,15 @@
},
# rel="apple-touch-icon" does not support SVG yet
]

intersphinx_mapping.update({
'pip': ('https://pip.pypa.io/en/latest', None),
'build': ('https://build.pypa.io/en/latest', None),
'PyPUG': ('https://packaging.python.org/en/latest/', None),
'packaging': ('https://packaging.pypa.io/en/latest/', None),
'twine': ('https://twine.readthedocs.io/en/stable/', None),
'importlib-resources': (
'https://importlib-resources.readthedocs.io/en/latest',
None,
),
})
23 changes: 23 additions & 0 deletions docs/development/developer-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,29 @@ To refresh the dependencies, run the following command::

$ tox -e vendor


------------------------------------
Code conventions and other practices
------------------------------------

Setuptools utilizes the `skeleton <https://github.com/jaraco/skeleton>`_
framework as a foundation for sharing re-usable maintenance tasks
across different projects in the ecosystem.

This also means that the project adheres to the same coding conventions
and other practices described in the `skeleton documentation
<https://blog.jaraco.com/skeleton/>`_.

Moreover, changes in the code base should be kept as compatible as possible
to ``skeleton`` to avoid merge conflicts, or accidental regressions on
periodical merges.

Finally, the ``setuptools/_distutils`` directory should not be modified
directly when contributing to the ``setuptools`` project.
Instead, this directory is maintained as a separated project in
https://github.com/pypa/distutils, and periodically merged into ``setuptools``.


----------------
Type annotations
----------------
Expand Down
53 changes: 41 additions & 12 deletions docs/userguide/ext_modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,41 @@ and all project metadata configuration in the ``pyproject.toml`` file:
version = "0.42"
To instruct setuptools to compile the ``foo.c`` file into the extension module
``mylib.foo``, we need to add a ``setup.py`` file similar to the following:
``mylib.foo``, we need to define an appropriate configuration in either
``pyproject.toml`` [#pyproject.toml]_ or ``setup.py`` file ,
similar to the following:

.. code-block:: python
.. tab:: pyproject.toml

from setuptools import Extension, setup
.. code-block:: toml
setup(
ext_modules=[
Extension(
name="mylib.foo", # as it would be imported
# may include packages/namespaces separated by `.`
sources=["foo.c"], # all sources are compiled into a single binary file
),
[tool.setuptools]
ext-modules = [
{name = "mylib.foo", sources = ["foo.c"]}
]
)
.. tab:: setup.py

.. code-block:: python
from setuptools import Extension, setup
setup(
ext_modules=[
Extension(
name="mylib.foo",
sources=["foo.c"],
),
]
)
The ``name`` value corresponds to how the extension module would be
imported and may include packages/namespaces separated by ``.``.
The ``sources`` value is a list of all source files that are compiled
into a single binary file.
Optionally any other parameter of :class:`setuptools.Extension` can be defined
in the configuration file (but in the case of ``pyproject.toml`` they must be
written using :wiki:`kebab-case` convention).

.. seealso::
You can find more information on the `Python docs about C/C++ extensions`_.
Expand Down Expand Up @@ -168,6 +187,16 @@ Extension API Reference
.. autoclass:: setuptools.Extension


----

.. rubric:: Notes

.. [#pyproject.toml]
Declarative configuration of extension modules via ``pyproject.toml`` was
introduced recently and is still considered experimental.
Therefore it might change in future versions of ``setuptools``.
.. _Python docs about C/C++ extensions: https://docs.python.org/3/extending/extending.html
.. _Cython: https://cython.readthedocs.io/en/stable/index.html
.. _directory options: https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html
Expand Down
3 changes: 3 additions & 0 deletions docs/userguide/pyproject_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ file, and can be set via the ``tool.setuptools`` table:
Key Value Type (TOML) Notes
========================= =========================== =========================
``py-modules`` array See tip below.
``ext-modules`` array of **Experimental** - Each item corresponds to a
tables/inline-tables :class:`setuptools.Extension` object and may define
the associated parameters in :wiki:`kebab-case`.
``packages`` array or ``find`` directive See tip below.
``package-dir`` table/inline-table Used when explicitly/manually listing ``packages``.
------------------------- --------------------------- -------------------------
Expand Down
7 changes: 5 additions & 2 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ warn_unused_ignores = True
warn_redundant_casts = True
# required to support namespace packages: https://github.com/python/mypy/issues/14057
explicit_package_bases = True

disable_error_code =
# Disable due to many false positives
overload-overlap,

exclude = (?x)(
# Avoid scanning Python files in generated folders
^build/
Expand All @@ -19,8 +24,6 @@ exclude = (?x)(
# Duplicate module name
| ^pkg_resources/tests/data/my-test-package-source/setup.py$
)
# Too many false-positives
disable_error_code = overload-overlap

# DistributionMetadata.license_files and DistributionMetadata.license_file
# are dynamically patched in setuptools/_core_metadata.py
Expand Down
1 change: 1 addition & 0 deletions newsfragments/+1ac90f4a.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Declare also the dependencies used by distutils (adds jaraco.collections).
1 change: 1 addition & 0 deletions newsfragments/2971.removal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Removed upload_docs command.
1 change: 0 additions & 1 deletion newsfragments/4553.feature.rst

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

Loading

0 comments on commit 0605f01

Please sign in to comment.