summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/main.yml40
-rw-r--r--README.rst2
-rw-r--r--docs/build_meta.rst4
-rw-r--r--docs/conf.py3
-rw-r--r--docs/deprecated/distutils-legacy.rst4
-rw-r--r--pytest.ini3
-rw-r--r--setup.cfg7
-rw-r--r--setuptools/tests/test_editable_install.py2
-rw-r--r--setuptools/tests/test_virtualenv.py57
-rw-r--r--tox.ini1
10 files changed, 92 insertions, 31 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 7413fa7d..c1bebc48 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -14,8 +14,10 @@ env:
# Request colored output from CLI tools supporting it. Different tools
# interpret the value differently. For some, just being set is sufficient.
# For others, it must be a non-zero integer. For yet others, being set
- # to a non-empty value is sufficient.
- FORCE_COLOR: -106
+ # to a non-empty value is sufficient. For tox, it must be one of
+ # <blank>, 0, 1, false, no, off, on, true, yes. The only enabling value
+ # in common is "1".
+ FORCE_COLOR: 1
# MyPy's color enforcement (must be a non-zero number)
MYPY_FORCE_COLOR: -42
# Recognized by the `py` package, dependency of `pytest` (must be "1")
@@ -43,13 +45,10 @@ jobs:
test:
strategy:
matrix:
- distutils:
- - local
python:
- "3.7"
- - "3.10"
- # disabled due to #3365
- # - "3.11"
+ - "3.11"
+ - "3.12"
# Workaround for actions/setup-python#508
dev:
- -dev
@@ -58,14 +57,22 @@ jobs:
- macos-latest
- windows-latest
include:
+ - python: "3.8"
+ platform: ubuntu-latest
+ - python: "3.9"
+ platform: ubuntu-latest
+ - python: "3.10"
+ platform: ubuntu-latest
- python: pypy3.9
platform: ubuntu-latest
+ distutils: stdlib
- platform: ubuntu-latest
python: "3.10"
distutils: stdlib
runs-on: ${{ matrix.platform }}
+ continue-on-error: ${{ matrix.python == '3.12' }}
env:
- SETUPTOOLS_USE_DISTUTILS: ${{ matrix.distutils }}
+ SETUPTOOLS_USE_DISTUTILS: ${{ matrix.distutils || 'local' }}
timeout-minutes: 75
steps:
- uses: actions/checkout@v3
@@ -104,12 +111,29 @@ jobs:
VM-${{ matrix.platform }},
Py-${{ steps.python-install.outputs.python-version }}
+ docs:
+ runs-on: ubuntu-latest
+ env:
+ TOXENV: docs
+ steps:
+ - uses: actions/checkout@v3
+ - name: Setup Python
+ uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python }}${{ matrix.dev }}
+ - name: Install tox
+ run: |
+ python -m pip install tox
+ - name: Run tests
+ run: tox
+
check: # This job does nothing and is only used for the branch protection
if: always()
needs:
- integration-test
- test
+ - docs
- test_cygwin
runs-on: ubuntu-latest
diff --git a/README.rst b/README.rst
index 86197e76..0bb27abd 100644
--- a/README.rst
+++ b/README.rst
@@ -14,7 +14,7 @@
.. image:: https://img.shields.io/readthedocs/setuptools/latest.svg
:target: https://setuptools.pypa.io
-.. image:: https://img.shields.io/badge/skeleton-2022-informational
+.. image:: https://img.shields.io/badge/skeleton-2023-informational
:target: https://blog.jaraco.com/skeleton
.. image:: https://img.shields.io/codecov/c/github/pypa/setuptools/master.svg?logo=codecov&logoColor=white
diff --git a/docs/build_meta.rst b/docs/build_meta.rst
index 37738b8f..08fd8a7b 100644
--- a/docs/build_meta.rst
+++ b/docs/build_meta.rst
@@ -143,11 +143,11 @@ the ``_custom_build/backend.py`` file, as shown in the following example:
build_sdist = _orig.build_sdist
- def get_requires_for_build_wheel(self, config_settings=None):
+ def get_requires_for_build_wheel(config_settings=None):
return _orig.get_requires_for_build_wheel(config_settings) + [...]
- def get_requires_for_build_sdist(self, config_settings=None):
+ def get_requires_for_build_sdist(config_settings=None):
return _orig.get_requires_for_build_sdist(config_settings) + [...]
diff --git a/docs/conf.py b/docs/conf.py
index 64c2625f..831fcc89 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-
extensions = [
'sphinx.ext.autodoc',
'jaraco.packaging.sphinx',
@@ -178,6 +176,7 @@ nitpick_ignore = [
('envvar', 'DISTUTILS_DEBUG'), # undocumented
('envvar', 'HOME'), # undocumented
('envvar', 'PLAT'), # undocumented
+ ('envvar', 'DIST_EXTRA_CONFIG'), # undocumented
('py:attr', 'CCompiler.language_map'), # undocumented
('py:attr', 'CCompiler.language_order'), # undocumented
('py:class', 'distutils.dist.Distribution'), # undocumented
diff --git a/docs/deprecated/distutils-legacy.rst b/docs/deprecated/distutils-legacy.rst
index 63c8ff07..8112f12e 100644
--- a/docs/deprecated/distutils-legacy.rst
+++ b/docs/deprecated/distutils-legacy.rst
@@ -13,7 +13,7 @@ Since the 60.0.0 release, Setuptools includes a local, vendored copy of distutil
Unless ``SETUPTOOLS_USE_DISTUTILS=stdlib``, they will have no effect on the build process.
You can still use a global user config file, ``~/.pydistutils.cfg`` (POSIX) or ``%USERPROFILE%/pydistutils.cfg`` (Windows),
- or use the environment variable :doc:`DIST_EXTRA_CONFIG <deprecated/distutils/configfile>` to point to another
+ or use the environment variable :ref:`DIST_EXTRA_CONFIG <setup-config>` to point to another
supplementary configuration file.
@@ -24,7 +24,7 @@ As Distutils is deprecated, any usage of functions or objects from distutils is
``distutils.core.setup`` → ``setuptools.setup``
-``distutils.cmd.Command`` → ``setuptools.Command``
+``distutils.cmd.Command`` or ``distutils.core.Command`` → ``setuptools.Command``
``distutils.command.{build_clib,build_ext,build_py,sdist}`` → ``setuptools.command.*``
diff --git a/pytest.ini b/pytest.ini
index 9d326e54..12007ade 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -10,6 +10,9 @@ filterwarnings=
error
## upstream
+ # Ensure ResourceWarnings are emitted
+ default::ResourceWarning
+
# Suppress deprecation warning in flake8
ignore:SelectableGroups dict interface is deprecated::flake8
diff --git a/setup.cfg b/setup.cfg
index 99c1bece..b20e7d1d 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -43,7 +43,9 @@ testing =
# upstream
pytest >= 6
pytest-checkdocs >= 2.4
- pytest-flake8
+ pytest-flake8; \
+ # workaround for tholo/pytest-flake8#87
+ python_version < "3.12"
# workaround for tholo/pytest-flake8#87
flake8 < 5
pytest-black >= 0.3.7; \
@@ -91,6 +93,9 @@ docs =
jaraco.packaging >= 9
rst.linker >= 1.9
furo
+ sphinx-lint
+
+ # tidelift
jaraco.tidelift >= 1.4
# local
diff --git a/setuptools/tests/test_editable_install.py b/setuptools/tests/test_editable_install.py
index c8ee7477..4406eda5 100644
--- a/setuptools/tests/test_editable_install.py
+++ b/setuptools/tests/test_editable_install.py
@@ -341,7 +341,7 @@ def test_editable_with_prefix(tmp_path, sample_project, editable_opts):
site_packages.mkdir(parents=True)
# install workaround
- pip_run.launch.inject_sitecustomize(str(site_packages))
+ pip_run.launch.inject_sitecustomize(site_packages)
env = dict(os.environ, PYTHONPATH=str(site_packages))
cmd = [
diff --git a/setuptools/tests/test_virtualenv.py b/setuptools/tests/test_virtualenv.py
index 65358543..acfe04e9 100644
--- a/setuptools/tests/test_virtualenv.py
+++ b/setuptools/tests/test_virtualenv.py
@@ -19,7 +19,7 @@ def pytest_virtualenv_works(venv):
pytest_virtualenv may not work. if it doesn't, skip these
tests. See #1284.
"""
- venv_prefix = venv.run(["python" , "-c", "import sys; print(sys.prefix)"]).strip()
+ venv_prefix = venv.run(["python", "-c", "import sys; print(sys.prefix)"]).strip()
if venv_prefix == sys.prefix:
pytest.skip("virtualenv is broken (see pypa/setuptools#1284)")
@@ -55,18 +55,37 @@ def access_pypi():
'pip_version',
[
None,
- pytest.param('pip<20', marks=pytest.mark.xfail(reason='pypa/pip#6599')),
- 'pip<20.1',
- 'pip<21',
- 'pip<22',
+ pytest.param(
+ 'pip<20.1',
+ marks=pytest.mark.xfail(
+ 'sys.version_info > (3, 12)',
+ reason="pip 22 requried for Python 3.12 and later",
+ ),
+ ),
+ pytest.param(
+ 'pip<21',
+ marks=pytest.mark.xfail(
+ 'sys.version_info > (3, 12)',
+ reason="pip 22 requried for Python 3.12 and later",
+ ),
+ ),
+ pytest.param(
+ 'pip<22',
+ marks=pytest.mark.xfail(
+ 'sys.version_info > (3, 12)',
+ reason="pip 22 requried for Python 3.12 and later",
+ ),
+ ),
+ 'pip<23',
pytest.param(
'https://github.com/pypa/pip/archive/main.zip',
marks=pytest.mark.xfail(reason='#2975'),
),
- ]
+ ],
)
-def test_pip_upgrade_from_source(pip_version, venv_without_setuptools,
- setuptools_wheel, setuptools_sdist):
+def test_pip_upgrade_from_source(
+ pip_version, venv_without_setuptools, setuptools_wheel, setuptools_sdist
+):
"""
Check pip can upgrade setuptools from source.
"""
@@ -90,10 +109,12 @@ def _check_test_command_install_requirements(venv, tmpdir):
"""
Check the test command will install all required dependencies.
"""
+
def sdist(distname, version):
dist_path = tmpdir.join('%s-%s.tar.gz' % (distname, version))
make_nspkg_sdist(str(dist_path), distname, version)
return dist_path
+
dependency_links = [
pathlib.Path(str(dist_path)).as_uri()
for dist_path in (
@@ -104,8 +125,9 @@ def _check_test_command_install_requirements(venv, tmpdir):
)
]
with tmpdir.join('setup.py').open('w') as fp:
- fp.write(DALS(
- '''
+ fp.write(
+ DALS(
+ '''
from setuptools import setup
setup(
@@ -127,17 +149,24 @@ def _check_test_command_install_requirements(venv, tmpdir):
""",
}}
)
- '''.format(dependency_links=dependency_links)))
+ '''.format(
+ dependency_links=dependency_links
+ )
+ )
+ )
with tmpdir.join('test.py').open('w') as fp:
- fp.write(DALS(
- '''
+ fp.write(
+ DALS(
+ '''
import foobar
import bits
import bobs
import pieces
open('success', 'w').close()
- '''))
+ '''
+ )
+ )
cmd = ["python", 'setup.py', 'test', '-s', 'test']
venv.run(cmd, cwd=str(tmpdir))
diff --git a/tox.ini b/tox.ini
index e8d8efb7..4a863295 100644
--- a/tox.ini
+++ b/tox.ini
@@ -40,6 +40,7 @@ extras =
changedir = docs
commands =
python -m sphinx -W --keep-going . {toxinidir}/build/html
+ python -m sphinxlint
[testenv:finalize]
skip_install = True