Imported Upstream version 65.7.0 upstream/65.7.0
authorJinWang An <jinwang.an@samsung.com>
Mon, 27 Mar 2023 08:02:58 +0000 (17:02 +0900)
committerJinWang An <jinwang.an@samsung.com>
Mon, 27 Mar 2023 08:02:58 +0000 (17:02 +0900)
18 files changed:
.bumpversion.cfg
.github/workflows/main.yml
CHANGES.rst
README.rst
docs/build_meta.rst
docs/conf.py
docs/deprecated/distutils-legacy.rst
docs/userguide/declarative_config.rst
docs/userguide/pyproject_config.rst
pytest.ini
setup.cfg
setuptools/command/egg_info.py
setuptools/config/pyprojecttoml.py
setuptools/discovery.py
setuptools/tests/test_editable_install.py
setuptools/tests/test_egg_info.py
setuptools/tests/test_virtualenv.py
tox.ini

index 38dbe69f1b1ddd997e075c37794d6f613dee2ccd..3428c6fef5b459ae261421f5423c1ad65047d369 100644 (file)
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 65.6.3
+current_version = 65.7.0
 commit = True
 tag = True
 
index 7413fa7de4f7c997a5598133139fc8f35b681d7e..c1bebc48c69ba5e5a93ed0d9a97c162674ea3c4b 100644 (file)
@@ -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
index 4f4ede6a66bc67430ce71f6b3713ab2f7f9d6964..495d8aa6e23fd6976570d6d60d5aa3f9aff7f670 100644 (file)
@@ -1,3 +1,18 @@
+v65.7.0
+-------
+
+
+Changes
+^^^^^^^
+* #3594: Added ``htmlcov`` to FlatLayoutModuleFinder.DEFAULT_EXCLUDE -- by :user:`demianbrecht`
+* #3667: Added a human-readable error description when ``.egg-info`` directory is not writeable -- by :user:`droodev`
+
+Misc
+^^^^
+* #3713: Fixed incomplete ``getattr`` statement that caused problems when accessing
+  undefined attribute.
+
+
 v65.6.3
 -------
 
index 86197e765d77580c98c3c4f7c809aa8205bee784..0bb27abd110f386633c08c553ec556fb583bbb9c 100644 (file)
@@ -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
index 37738b8f9423f83f0aa967ef5022432c336f8da3..08fd8a7bbb25c32d6ba04ed8316fa72f3f8ffa1f 100644 (file)
@@ -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) + [...]
 
 
index 64c2625f4a3d00b8936dedf6fb1efa33b1a4d6d3..831fcc89da7656d466db56498882311ed3426fba 100644 (file)
@@ -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
index 63c8ff07c003c053f8b0c346d34bd5c43f7c56ce..8112f12eaee9e292e3f9fcb89df07e47c4a9c706 100644 (file)
@@ -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.*``
 
index 3ef7b074629c7cc415a503da42e0842c27a809e2..adedb0c0db4bdbe72f09e4a3540383894fa98b1c 100644 (file)
@@ -25,10 +25,13 @@ boilerplate code in some cases.
     [metadata]
     name = my_package
     version = attr: my_package.VERSION
+    author = Josiah Carberry
+    author_email = josiah_carberry@brown.edu
     description = My package description
     long_description = file: README.rst, CHANGELOG.rst, LICENSE.rst
     keywords = one, two
-    license = BSD 3-Clause License
+    python_requires = >=3.7
+    license = BSD-3-Clause
     classifiers =
         Framework :: Django
         Programming Language :: Python :: 3
index cc811ed737574ddb6779d395d0c467d31a446b88..633f4de7a25ee5e5de51fdedbe7fae57b30d38ff 100644 (file)
@@ -42,11 +42,14 @@ The ``project`` table contains metadata fields as described by
 
    [project]
    name = "my_package"
+   authors = [
+       {name = "Josiah Carberry", email = "josiah_carberry@brown.edu"},
+   ]
    description = "My package description"
    readme = "README.rst"
    requires-python = ">=3.7"
    keywords = ["one", "two"]
-   license = {text = "BSD 3-Clause License"}
+   license = {text = "BSD-3-Clause"}
    classifiers = [
        "Framework :: Django",
        "Programming Language :: Python :: 3",
@@ -187,13 +190,19 @@ of all given files and concatenate them in a single string.
 Key                        Directive           Notes
 ========================== =================== =================================================================================================
 ``version``                ``attr``, ``file``
-``readme``                 ``file``
-``description``            ``file``            One-line text
+``readme``                 ``file``            Here you can also set ``"content-type"``:
+
+                                               ``readme = {file = ["README", "USAGE"], content-type = "text/plain"}``
+
+                                               If ``content-type`` is not given, ``"text/x-rst"`` is used by default.
+``description``            ``file``            One-line text (no line breaks)
 ``classifiers``            ``file``            Multi-line text with one classifier per line
 ``entry-points``           ``file``            INI format following :doc:`PyPUG:specifications/entry-points`
                                                (``console_scripts`` and ``gui_scripts`` can be included)
-``dependencies``           ``file``            ``requirements.txt`` format (``#`` comments and blank lines excluded) **BETA**
-``optional-dependencies``  ``file``            ``requirements.txt`` format per group (``#`` comments and blank lines excluded) **BETA**
+``dependencies``           ``file``            *subset* of the ``requirements.txt`` format
+                                               (``#`` comments and blank lines excluded) **BETA**
+``optional-dependencies``  ``file``            *subset* of the ``requirements.txt`` format per group
+                                               (``#`` comments and blank lines excluded) **BETA**
 ========================== =================== =================================================================================================
 
 Supporting ``file`` for dependencies is meant for a convenience for packaging
index 9d326e54c7cfd3fcce414430ae76e063a535a9fb..12007aded67b055cc3872c59a13a1a4ff8b6c96b 100644 (file)
@@ -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
 
index 99c1bece554483c0402de3bd070cfe7a1e61bd7f..937b72c861ac8bad321cf566c7d481ba83375296 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,6 +1,6 @@
 [metadata]
 name = setuptools
-version = 65.6.3
+version = 65.7.0
 author = Python Packaging Authority
 author_email = distutils-sig@python.org
 description = Easily download, build, install, upgrade, and uninstall Python packages
@@ -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
index 25888ed8642ffe2e078bed5440bcc720f076904f..95c818453ea15bf6975226afddef3037e763ca44 100644 (file)
@@ -295,7 +295,11 @@ class egg_info(InfoCommon, Command):
 
     def run(self):
         self.mkpath(self.egg_info)
-        os.utime(self.egg_info, None)
+        try:
+            os.utime(self.egg_info, None)
+        except OSError as e:
+            msg = f"Cannot update time stamp of directory '{self.egg_info}'"
+            raise distutils.errors.DistutilsFileError(msg) from e
         for ep in metadata.entry_points(group='egg_info.writers'):
             writer = ep.load()
             writer(self, ep.name, os.path.join(self.egg_info, ep.name))
index d995f0bcc7e322d50af91ee23f3241d8cf46e637..fee6fac6ae0ae0cf3983787e77a7423b745dd9ee 100644 (file)
@@ -112,7 +112,7 @@ def read_configuration(
     # `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") is not None:
+    if dist and getattr(dist, "include_package_data", None) is not None:
         setuptools_table.setdefault("include-package-data", dist.include_package_data)
     else:
         setuptools_table.setdefault("include-package-data", True)
index 98fc2a7f487da55a23b962793158911848800211..6244a185588c0fae1aad7ffabe692635ddfb8295 100644 (file)
@@ -273,6 +273,7 @@ class FlatLayoutModuleFinder(ModuleFinder):
         "benchmarks",
         "exercise",
         "exercises",
+        "htmlcov",
         # ---- Hidden files/Private modules ----
         "[._]*",
     )
index c8ee74778bc1ffa41c0e3be31e8d45a3695c0bc4..4406eda5fd7887fe0aeb3a229d0967a5d2ef9404 100644 (file)
@@ -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 = [
index 387773c13556ecf8cb8d2421cfc7d5d6fb44e691..6a2a989308877c60c700ba9052be6d5edf4d9624 100644 (file)
@@ -7,6 +7,7 @@ import stat
 import time
 from typing import List, Tuple
 from pathlib import Path
+from unittest import mock
 
 import pytest
 from jaraco import path
@@ -158,6 +159,21 @@ class TestEggInfo:
         ]
         assert sorted(actual) == expected
 
+    def test_handling_utime_error(self, tmpdir_cwd, env):
+        dist = Distribution()
+        ei = egg_info(dist)
+        utime_patch = mock.patch('os.utime', side_effect=OSError("TEST"))
+        mkpath_patch = mock.patch(
+            'setuptools.command.egg_info.egg_info.mkpath', return_val=None
+        )
+
+        with utime_patch, mkpath_patch:
+            import distutils.errors
+
+            msg = r"Cannot update time stamp of directory 'None'"
+            with pytest.raises(distutils.errors.DistutilsFileError, match=msg):
+                ei.run()
+
     def test_license_is_a_string(self, tmpdir_cwd, env):
         setup_config = DALS("""
             [metadata]
index 65358543f14164e7533af566b6fa4ea87f0eb8b7..acfe04e9ddb64ab05266a4e766ff621d4bd42b83 100644 (file)
@@ -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 e8d8efb7926aada84c197c55b5ba195ade04889f..4a8632959c230ed231834e13cb3300682ff9d1cc 100644 (file)
--- 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