Skip to content

Commit

Permalink
Merge branch 'main' into docs-notfound-page
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri authored Aug 1, 2022
2 parents fe6d794 + 3ecabf8 commit 00eaec7
Show file tree
Hide file tree
Showing 102 changed files with 470 additions and 841 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 = 63.1.0
current_version = 63.3.0
commit = True
tag = True

Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ jobs:
distutils:
- local
python:
# Build on pre-releases until stable, then stable releases.
# actions/setup-python#213
- ~3.7.0-0
- ~3.10.0-0
- 3.7-dev
- 3.10-dev
# disabled due to #3365
# - ~3.11.0-0
# - 3.11-dev
- pypy-3.7
platform:
- ubuntu-latest
Expand Down Expand Up @@ -151,7 +149,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
python-version: "3.11-dev"
- name: Install tox
run: |
python -m pip install tox
Expand Down
28 changes: 28 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
v63.3.0
-------


Changes
^^^^^^^
* #3460: <<<<<<< HEAD
Limit the scope of the _distutils_hack workaround for pip.
=======
Remove the pip workaround in _distutils_hack.
>>>>>>> 46344cf0 (Remove pip workaround in _distutils_hack.)
* #3475: Merge with pypa/distutils@129480b, including substantial delinting and cleanup, some refactoring around compiler logic, better messaging in cygwincompiler (pypa/distutils#161).


v63.2.0
-------


Changes
^^^^^^^
* #3395: Included a performance optimization: ``setuptools.build_meta`` no longer tries
to :func:`compile` the setup script code before :func:`exec`-ing it.

Misc
^^^^
* #3435: Corrected issue in macOS framework builds on Python 3.9 not installed by homebrew (pypa/distutils#158).


v63.1.0
-------

Expand Down
2 changes: 0 additions & 2 deletions changelog.d/3395.change.rst

This file was deleted.

2 changes: 2 additions & 0 deletions changelog.d/3443.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Installed ``sphinx-hoverxref`` extension to show tooltips on internal an external references.
-- by :user:`humitos`
1 change: 1 addition & 0 deletions changelog.d/3475.change.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Merge with pypa/distutils@129480b, including substantial delinting and cleanup, some refactoring around compiler logic, better messaging in cygwincompiler (pypa/distutils#161).
13 changes: 13 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,19 @@
),
})

# Support tooltips on references
extensions += ['hoverxref.extension']
hoverxref_auto_ref = True
hoverxref_intersphinx = [
'python',
'pip',
'build',
'PyPUG',
'packaging',
'twine',
'importlib-resources',
]

# Add support for linking usernames
github_url = 'https://github.com'
github_repo_org = 'pypa'
Expand Down
2 changes: 1 addition & 1 deletion docs/deprecated/commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ You could also run commands in other circumstances:

* ``setuptools`` projects without ``setup.py`` (e.g., ``setup.cfg``-only)::

python -c "import setuptools; setup()" --help
python -c "from setuptools import setup; setup()" --help

* ``distutils`` projects (with a ``setup.py`` importing ``distutils``)::

Expand Down
6 changes: 3 additions & 3 deletions docs/userguide/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ distributing into something that looks like the following

mypackage
├── pyproject.toml
| # setup.cfg or setup.py (depending on the confuguration method)
| # setup.cfg or setup.py (depending on the configuration method)
| # README.rst or README.md (a nice description of your package)
| # LICENCE (properly chosen license information, e.g. MIT, BSD-3, GPL-3, MPL-2, etc...)
└── mypackage
Expand Down Expand Up @@ -186,9 +186,9 @@ found, as shown in the example below:
.. code-block:: ini
[options]
packages = find: # OR `find_namespaces:` if you want to use namespaces
packages = find: # OR `find_namespace:` if you want to use namespaces
[options.packages.find] # (always `find` even if `find_namespaces:` was used before)
[options.packages.find] # (always `find` even if `find_namespace:` was used before)
# This section is optional
# Each entry in this section is optional, and if not specified, the default values are:
# `where=.`, `include=*` and `exclude=` (empty).
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ addopts = "--flake8"
[tool.pytest-enabler.cov]
addopts = "--cov"

[pytest.enabler.xdist]
[tool.pytest-enabler.xdist]
addopts = "-n auto"

[tool.towncrier]
Expand Down
7 changes: 5 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = setuptools
version = 63.1.0
version = 63.3.0
author = Python Packaging Authority
author_email = [email protected]
description = Easily download, build, install, upgrade, and uninstall Python packages
Expand Down Expand Up @@ -43,6 +43,8 @@ testing =
pytest >= 6
pytest-checkdocs >= 2.4
pytest-flake8
# workaround for tholo/pytest-flake8#87
flake8 < 5
pytest-black >= 0.3.7; \
# workaround for jaraco/skeleton#22
python_implementation != "PyPy"
Expand Down Expand Up @@ -88,7 +90,8 @@ docs =
jaraco.packaging >= 9
rst.linker >= 1.9
jaraco.tidelift >= 1.4
sphinx-notfound-page==0.8.3
sphinx-notfound-page == 0.8.3
sphinx-hoverxref < 2

# local
pygments-github-lexers==0.0.5
Expand Down
2 changes: 1 addition & 1 deletion setuptools/_distutils/_msvccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def make_out_path(p):

return list(map(make_out_path, source_filenames))

def compile(
def compile( # noqa: C901
self,
sources,
output_dir=None,
Expand Down
2 changes: 1 addition & 1 deletion setuptools/_distutils/archive_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def _set_uid_gid(tarinfo):
return archive_name


def make_zipfile(base_name, base_dir, verbose=0, dry_run=0):
def make_zipfile(base_name, base_dir, verbose=0, dry_run=0): # noqa: C901
"""Create a zip file from all the files under 'base_dir'.
The output zip file will be named 'base_name' + ".zip". Uses either the
Expand Down
8 changes: 4 additions & 4 deletions setuptools/_distutils/bcppcompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def __init__(self, verbose=0, dry_run=0, force=0):

# -- Worker methods ------------------------------------------------

def compile(
def compile( # noqa: C901
self,
sources,
output_dir=None,
Expand Down Expand Up @@ -174,7 +174,7 @@ def create_static_lib(

# create_static_lib ()

def link(
def link( # noqa: C901
self,
target_desc,
objects,
Expand Down Expand Up @@ -250,8 +250,8 @@ def link(
else:
objects.append(file)

for l in library_dirs:
ld_args.append("/L%s" % os.path.normpath(l))
for ell in library_dirs:
ld_args.append("/L%s" % os.path.normpath(ell))
ld_args.append("/L.") # we sometimes use relative paths

# list of object files
Expand Down
21 changes: 14 additions & 7 deletions setuptools/_distutils/ccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@
Contains CCompiler, an abstract base class that defines the interface
for the Distutils compiler abstraction model."""

import sys, os, re
from distutils.errors import *
import sys
import os
import re
from distutils.errors import (
CompileError,
LinkError,
UnknownFileError,
DistutilsPlatformError,
DistutilsModuleError,
)
from distutils.spawn import spawn
from distutils.file_util import move_file
from distutils.dir_util import mkpath
Expand Down Expand Up @@ -808,7 +816,7 @@ def library_option(self, lib):
"""
raise NotImplementedError

def has_function(
def has_function( # noqa: C901
self,
funcname,
includes=None,
Expand Down Expand Up @@ -945,10 +953,9 @@ def library_filename(
self, libname, lib_type='static', strip_dir=0, output_dir='' # or 'shared'
):
assert output_dir is not None
if lib_type not in ("static", "shared", "dylib", "xcode_stub"):
raise ValueError(
"'lib_type' must be \"static\", \"shared\", \"dylib\", or \"xcode_stub\""
)
expected = '"static", "shared", "dylib", "xcode_stub"'
if lib_type not in eval(expected):
raise ValueError(f"'lib_type' must be {expected}")
fmt = getattr(self, lib_type + "_lib_format")
ext = getattr(self, lib_type + "_lib_extension")

Expand Down
4 changes: 3 additions & 1 deletion setuptools/_distutils/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
in the distutils.command package.
"""

import sys, os, re
import sys
import os
import re
from distutils.errors import DistutilsOptionError
from distutils import util, dir_util, file_util, archive_util, dep_util
from distutils import log
Expand Down
8 changes: 1 addition & 7 deletions setuptools/_distutils/command/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Package containing implementation of all the standard Distutils
commands."""

__all__ = [
__all__ = [ # noqa: F822
'build',
'build_py',
'build_ext',
Expand All @@ -23,10 +23,4 @@
'bdist_wininst',
'check',
'upload',
# These two are reserved for future use:
#'bdist_sdux',
#'bdist_pkgtool',
# Note:
# bdist_packager is not included because it only provides
# an abstract base class
]
7 changes: 5 additions & 2 deletions setuptools/_distutils/command/_framework_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,21 @@
import os
import functools
import subprocess
import sysconfig


@functools.lru_cache()
def enabled():
"""
Only enabled for Python 3.9 framework builds except ensurepip and venv.
Only enabled for Python 3.9 framework homebrew builds
except ensurepip and venv.
"""
PY39 = (3, 9) < sys.version_info < (3, 10)
framework = sys.platform == 'darwin' and sys._framework
homebrew = "Cellar" in sysconfig.get_config_var('projectbase')
venv = sys.prefix != sys.base_prefix
ensurepip = os.environ.get("ENSUREPIP_OPTIONS")
return PY39 and framework and not venv and not ensurepip
return PY39 and framework and homebrew and not venv and not ensurepip


schemes = dict(
Expand Down
54 changes: 26 additions & 28 deletions setuptools/_distutils/command/bdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import os
from distutils.core import Command
from distutils.errors import *
from distutils.errors import DistutilsPlatformError, DistutilsOptionError
from distutils.util import get_platform


Expand All @@ -15,11 +15,17 @@ def show_formats():

formats = []
for format in bdist.format_commands:
formats.append(("formats=" + format, None, bdist.format_command[format][1]))
formats.append(("formats=" + format, None, bdist.format_commands[format][1]))
pretty_printer = FancyGetopt(formats)
pretty_printer.print_help("List of available distribution formats:")


class ListCompat(dict):
# adapter to allow for Setuptools compatibility in format_commands
def append(self, item):
return


class bdist(Command):

description = "create a built (binary) distribution"
Expand Down Expand Up @@ -64,31 +70,23 @@ class bdist(Command):
# Debian-ish Linux, Solaris, FreeBSD, ..., Windows, Mac OS.
default_format = {'posix': 'gztar', 'nt': 'zip'}

# Establish the preferred order (for the --help-formats option).
format_commands = [
'rpm',
'gztar',
'bztar',
'xztar',
'ztar',
'tar',
'wininst',
'zip',
'msi',
]

# And the real information.
format_command = {
'rpm': ('bdist_rpm', "RPM distribution"),
'gztar': ('bdist_dumb', "gzip'ed tar file"),
'bztar': ('bdist_dumb', "bzip2'ed tar file"),
'xztar': ('bdist_dumb', "xz'ed tar file"),
'ztar': ('bdist_dumb', "compressed tar file"),
'tar': ('bdist_dumb', "tar file"),
'wininst': ('bdist_wininst', "Windows executable installer"),
'zip': ('bdist_dumb', "ZIP file"),
'msi': ('bdist_msi', "Microsoft Installer"),
}
# Define commands in preferred order for the --help-formats option
format_commands = ListCompat(
{
'rpm': ('bdist_rpm', "RPM distribution"),
'gztar': ('bdist_dumb', "gzip'ed tar file"),
'bztar': ('bdist_dumb', "bzip2'ed tar file"),
'xztar': ('bdist_dumb', "xz'ed tar file"),
'ztar': ('bdist_dumb', "compressed tar file"),
'tar': ('bdist_dumb', "tar file"),
'wininst': ('bdist_wininst', "Windows executable installer"),
'zip': ('bdist_dumb', "ZIP file"),
'msi': ('bdist_msi', "Microsoft Installer"),
}
)

# for compatibility until Setuptools references only format_commands
format_command = format_commands

def initialize_options(self):
self.bdist_base = None
Expand Down Expand Up @@ -132,7 +130,7 @@ def run(self):
commands = []
for format in self.formats:
try:
commands.append(self.format_command[format][0])
commands.append(self.format_commands[format][0])
except KeyError:
raise DistutilsOptionError("invalid format '%s'" % format)

Expand Down
2 changes: 1 addition & 1 deletion setuptools/_distutils/command/bdist_dumb.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from distutils.core import Command
from distutils.util import get_platform
from distutils.dir_util import remove_tree, ensure_relative
from distutils.errors import *
from distutils.errors import DistutilsPlatformError
from distutils.sysconfig import get_python_version
from distutils import log

Expand Down
Loading

0 comments on commit 00eaec7

Please sign in to comment.