Skip to content

Commit 7311f83

Browse files
committed
Merge branch 'main' into add-tests-for-duplicated-imports
2 parents c169a00 + 5b2b20d commit 7311f83

File tree

293 files changed

+20078
-376
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

293 files changed

+20078
-376
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 60.5.4
2+
current_version = 60.9.1
33
commit = True
44
tag = True
55

.codecov.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ comment: false
22
coverage:
33
status:
44
project:
5-
threshold: 0.5%
5+
default:
6+
threshold: 0.5%

.github/workflows/ci-sage.yml

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
name: Run Sage CI for Linux
2+
3+
## This GitHub Actions workflow provides:
4+
##
5+
## - portability testing, by building and testing this project on many platforms
6+
##
7+
## - continuous integration, by building and testing other software
8+
## that depends on this project.
9+
##
10+
## It runs on every push of a tag to the GitHub repository.
11+
##
12+
## The testing can be monitored in the "Actions" tab of the GitHub repository.
13+
##
14+
## After all jobs have finished (or are canceled) and a short delay,
15+
## tar files of all logs are made available as "build artifacts".
16+
##
17+
## This GitHub Actions workflow uses the portability testing framework
18+
## of SageMath (https://www.sagemath.org/). For more information, see
19+
## https://doc.sagemath.org/html/en/developer/portability_testing.html
20+
21+
## The workflow consists of two jobs:
22+
##
23+
## - First, it builds a source distribution of the project
24+
## and generates a script "update-pkgs.sh". It uploads them
25+
## as a build artifact named upstream.
26+
##
27+
## - Second, it checks out a copy of the SageMath source tree.
28+
## It downloads the upstream artifact and replaces the project's
29+
## package in the SageMath distribution by the newly packaged one
30+
## from the upstream artifact, by running the script "update-pkgs.sh".
31+
## Then it builds a small portion of the Sage distribution.
32+
##
33+
## Many copies of the second step are run in parallel for each of the tested
34+
## systems/configurations.
35+
36+
on:
37+
push:
38+
tags:
39+
- '*'
40+
workflow_dispatch:
41+
# Allow to run manually
42+
43+
env:
44+
# Ubuntu packages to install so that the project's "setup.py sdist" can succeed
45+
DIST_PREREQ: python3
46+
# Name of this project in the Sage distribution
47+
SPKG: setuptools
48+
# Sage distribution packages to build
49+
TARGETS_PRE: build/make/Makefile
50+
TARGETS: setuptools pyzmq
51+
TARGETS_OPTIONAL: build/make/Makefile
52+
# Standard setting: Test the current beta release of Sage:
53+
SAGE_REPO: sagemath/sage
54+
SAGE_REF: develop
55+
# Test with the branch from https://trac.sagemath.org/ticket/33288
56+
# This may provide hotfixes for the CI that have not been merged into
57+
# the sage develop branch yet.
58+
SAGE_TRAC_GIT: https://github.com/sagemath/sagetrac-mirror.git
59+
SAGE_TICKET: 33288
60+
REMOVE_PATCHES: "*"
61+
62+
jobs:
63+
64+
dist:
65+
runs-on: ubuntu-latest
66+
steps:
67+
- name: Check out ${{ env.SPKG }}
68+
uses: actions/checkout@v2
69+
with:
70+
path: build/pkgs/${{ env.SPKG }}/src
71+
- name: Install prerequisites
72+
run: |
73+
sudo DEBIAN_FRONTEND=noninteractive apt-get update
74+
sudo DEBIAN_FRONTEND=noninteractive apt-get install $DIST_PREREQ
75+
python3 -m pip install build
76+
- name: Run make dist, prepare upstream artifact
77+
run: |
78+
(cd build/pkgs/${{ env.SPKG }}/src && python3 -m build --sdist) \
79+
&& mkdir -p upstream && cp build/pkgs/${{ env.SPKG }}/src/dist/*.tar.gz upstream/${{ env.SPKG }}-git.tar.gz \
80+
&& echo "sage-package create ${{ env.SPKG }} --version git --tarball ${{ env.SPKG }}-git.tar.gz --type=standard" > upstream/update-pkgs.sh \
81+
&& if [ -n "${{ env.REMOVE_PATCHES }}" ]; then echo "(cd ../build/pkgs/${{ env.SPKG }}/patches && rm -f ${{ env.REMOVE_PATCHES }}; :)" >> upstream/update-pkgs.sh; fi \
82+
&& ls -l upstream/
83+
- uses: actions/upload-artifact@v2
84+
with:
85+
path: upstream
86+
name: upstream
87+
88+
docker:
89+
runs-on: ubuntu-latest
90+
needs: [dist]
91+
strategy:
92+
fail-fast: false
93+
max-parallel: 32
94+
matrix:
95+
tox_system_factor: [ubuntu-trusty, ubuntu-xenial, ubuntu-bionic, ubuntu-focal, ubuntu-hirsute, ubuntu-impish, ubuntu-jammy, debian-stretch, debian-buster, debian-bullseye, debian-bookworm, debian-sid, linuxmint-17, linuxmint-18, linuxmint-19, linuxmint-19.3, linuxmint-20.1, linuxmint-20.2, linuxmint-20.3, fedora-26, fedora-27, fedora-28, fedora-29, fedora-30, fedora-31, fedora-32, fedora-33, fedora-34, fedora-35, centos-7, centos-stream-8, centos-stream-9, gentoo-python3.9, archlinux-latest, opensuse-15, opensuse-15.3, opensuse-tumbleweed, slackware-14.2, ubuntu-bionic-i386, manylinux-2_24-i686, debian-buster-i386, centos-7-i386]
96+
tox_packages_factor: [minimal, standard]
97+
env:
98+
TOX_ENV: docker-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }}
99+
LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-tox-docker-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }}
100+
DOCKER_TARGETS: configured with-targets with-targets-optional
101+
steps:
102+
- name: Check out SageMath
103+
uses: actions/checkout@v2
104+
with:
105+
repository: ${{ env.SAGE_REPO }}
106+
ref: ${{ env.SAGE_REF }}
107+
fetch-depth: 2000
108+
if: env.SAGE_REPO != ''
109+
- name: Check out git-trac-command
110+
uses: actions/checkout@v2
111+
with:
112+
repository: sagemath/git-trac-command
113+
path: git-trac-command
114+
if: env.SAGE_TRAC_GIT != ''
115+
- name: Check out SageMath from trac.sagemath.org
116+
shell: bash {0}
117+
run: |
118+
git config --global user.email "[email protected]"
119+
git config --global user.name "ci-sage workflow"
120+
if [ ! -d .git ]; then git init; fi; git remote add trac ${{ env.SAGE_TRAC_GIT }} && x=1 && while [ $x -le 5 ]; do x=$(( $x + 1 )); sleep $(( $RANDOM % 60 + 1 )); if git-trac-command/git-trac fetch $SAGE_TICKET; then git merge FETCH_HEAD || echo "(ignored)"; exit 0; fi; sleep 40; done; exit 1
121+
if: env.SAGE_TRAC_GIT != ''
122+
- uses: actions/download-artifact@v2
123+
with:
124+
path: upstream
125+
name: upstream
126+
- name: Install test prerequisites
127+
run: |
128+
sudo DEBIAN_FRONTEND=noninteractive apt-get update
129+
sudo DEBIAN_FRONTEND=noninteractive apt-get install tox python3-setuptools
130+
- name: Update Sage packages from upstream artifact
131+
run: |
132+
(export PATH=$(pwd)/build/bin:$PATH; (cd upstream && bash -x update-pkgs.sh) && sed -i.bak '/upstream/d' .dockerignore && echo "/:toolchain:/i ADD upstream upstream" | sed -i.bak -f - build/bin/write-dockerfile.sh && git diff)
133+
- name: Configure and build Sage distribution within a Docker container
134+
run: |
135+
set -o pipefail; EXTRA_DOCKER_BUILD_ARGS="--build-arg USE_MAKEFLAGS=\"-k V=0 SAGE_NUM_THREADS=3\"" tox -e $TOX_ENV -- $TARGETS 2>&1 | sed "/^configure: notice:/s|^|::warning file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;/^configure: warning:/s|^|::warning file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;/^configure: error:/s|^|::error file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;"
136+
- name: Copy logs from the Docker image or build container
137+
run: |
138+
mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"
139+
cp -r .tox/$TOX_ENV/Dockerfile .tox/$TOX_ENV/log "artifacts/$LOGS_ARTIFACT_NAME"
140+
if [ -f .tox/$TOX_ENV/Dockertags ]; then CONTAINERS=$(docker create $(tail -1 .tox/$TOX_ENV/Dockertags) /bin/bash || true); fi
141+
if [ -n "$CONTAINERS" ]; then for CONTAINER in $CONTAINERS; do for ARTIFACT in /sage/logs; do docker cp $CONTAINER:$ARTIFACT artifacts/$LOGS_ARTIFACT_NAME && HAVE_LOG=1; done; if [ -n "$HAVE_LOG" ]; then break; fi; done; fi
142+
if: always()
143+
- uses: actions/upload-artifact@v2
144+
with:
145+
path: artifacts
146+
name: ${{ env.LOGS_ARTIFACT_NAME }}
147+
if: always()
148+
- name: Print out logs for immediate inspection
149+
# and markup the output with GitHub Actions logging commands
150+
run: |
151+
.github/workflows/scan-logs.sh "artifacts/$LOGS_ARTIFACT_NAME"
152+
if: always()

.github/workflows/main.yml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@ name: tests
22

33
on: [push, pull_request, workflow_dispatch]
44

5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
7+
cancel-in-progress: true
8+
59
jobs:
610
test:
711
strategy:
812
matrix:
913
distutils:
10-
- stdlib
1114
- local
1215
python:
1316
- pypy-3.7
@@ -19,6 +22,10 @@ jobs:
1922
- ubuntu-latest
2023
- macos-latest
2124
- windows-latest
25+
include:
26+
- platform: ubuntu-latest
27+
python: "3.10"
28+
distutils: stdlib
2229
runs-on: ${{ matrix.platform }}
2330
env:
2431
SETUPTOOLS_USE_DISTUTILS: ${{ matrix.distutils }}
@@ -42,14 +49,7 @@ jobs:
4249
${{ matrix.python }}
4350
4451
test_cygwin:
45-
strategy:
46-
matrix:
47-
distutils:
48-
- stdlib
49-
- local
5052
runs-on: windows-latest
51-
env:
52-
SETUPTOOLS_USE_DISTUTILS: ${{ matrix.distutils }}
5353
steps:
5454
- uses: actions/checkout@v2
5555
- name: Install Cygwin with Python
@@ -72,11 +72,6 @@ jobs:
7272
tox -- --cov-report xml
7373
7474
integration-test:
75-
strategy:
76-
matrix:
77-
distutils:
78-
- stdlib
79-
- local
8075
needs: test
8176
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && contains(github.ref, 'refs/tags/'))
8277
# To avoid long times and high resource usage, we assume that:
@@ -87,8 +82,6 @@ jobs:
8782
# "integration")
8883
# With that in mind, the integration tests can run for a single setup
8984
runs-on: ubuntu-latest
90-
env:
91-
SETUPTOOLS_USE_DISTUTILS: ${{ matrix.distutils }}
9285
steps:
9386
- uses: actions/checkout@v2
9487
- name: Install OS-level dependencies

CHANGES.rst

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,106 @@
1+
v60.9.1
2+
-------
3+
4+
5+
Misc
6+
^^^^
7+
* #3102: Prevent vendored importlib_metadata from loading distributions from older importlib_metadata.
8+
* #3103: Fixed issue where string-based entry points would be omitted.
9+
* #3107: Bump importlib_metadata to 4.11.1 addressing issue with parsing requirements in egg-info as found in PyPy.
10+
11+
12+
v60.9.0
13+
-------
14+
15+
16+
Changes
17+
^^^^^^^
18+
* #2876: In the build backend, allow single config settings to be supplied.
19+
* #2993: Removed workaround in distutils hack for get-pip now that pypa/get-pip#137 is closed.
20+
* #3085: Setuptools no longer relies on ``pkg_resources`` for entry point handling.
21+
* #3098: Bump vendored packaging to 21.3.
22+
* Removed bootstrap script.
23+
24+
25+
v60.8.2
26+
-------
27+
28+
29+
Misc
30+
^^^^
31+
* #3091: Make ``concurrent.futures`` import lazy in vendored ``more_itertools``
32+
package to a avoid importing threading as a side effect (which caused
33+
`gevent/gevent#1865 <https://github.com/gevent/gevent/issues/1865>`__).
34+
-- by :user:`maciejp-ro`
35+
36+
37+
v60.8.1
38+
-------
39+
40+
41+
Misc
42+
^^^^
43+
* #3084: When vendoring jaraco packages, ensure the namespace package is converted to a simple package to support zip importer.
44+
45+
46+
v60.8.0
47+
-------
48+
49+
50+
Changes
51+
^^^^^^^
52+
* #3085: Setuptools now vendors importlib_resources and importlib_metadata and jaraco.text. Setuptools no longer relies on pkg_resources for ensure_directory nor parse_requirements.
53+
54+
55+
v60.7.1
56+
-------
57+
58+
59+
Misc
60+
^^^^
61+
* #3072: Remove lorem_ipsum from jaraco.text when vendored.
62+
63+
64+
v60.7.0
65+
-------
66+
67+
68+
Changes
69+
^^^^^^^
70+
* #3061: Vendored jaraco.text and use line processing from that library in pkg_resources.
71+
72+
Misc
73+
^^^^
74+
* #3070: Avoid AttributeError in easy_install.create_home_path when sysconfig.get_config_vars values are not strings.
75+
76+
77+
v60.6.0
78+
-------
79+
80+
81+
Changes
82+
^^^^^^^
83+
* #3043: Merge with pypa/distutils@bb018f1ac3 including consolidated behavior in sysconfig.get_platform (pypa/distutils#104).
84+
* #3057: Don't include optional ``Home-page`` in metadata if no ``url`` is specified. -- by :user:`cdce8p`
85+
* #3062: Merge with pypa/distutils@b53a824ec3 including improved support for lib directories on non-x64 Windows builds.
86+
87+
Documentation changes
88+
^^^^^^^^^^^^^^^^^^^^^
89+
* #2897: Added documentation about wrapping ``setuptools.build_meta`` in a in-tree
90+
custom backend. This is a :pep:`517`-compliant way of dynamically specifying
91+
build dependencies (e.g. when platform, OS and other markers are not enough).
92+
-- by :user:`abravalheri`
93+
* #3034: Replaced occurrences of the defunct distutils-sig mailing list with pointers
94+
to GitHub Discussions.
95+
-- by :user:`ashemedai`
96+
* #3056: The documentation has stopped suggesting to add ``wheel`` to
97+
:pep:`517` requirements -- by :user:`webknjaz`
98+
99+
Misc
100+
^^^^
101+
* #3054: Used Py3 syntax ``super().__init__()`` -- by :user:`imba-tjd`
102+
103+
1104
v60.5.4
2105
-------
3106

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
.. image:: https://img.shields.io/readthedocs/setuptools/latest.svg
2323
:target: https://setuptools.pypa.io
2424

25-
.. image:: https://img.shields.io/badge/skeleton-2021-informational
25+
.. image:: https://img.shields.io/badge/skeleton-2022-informational
2626
:target: https://blog.jaraco.com/skeleton
2727

2828
.. image:: https://img.shields.io/codecov/c/github/pypa/setuptools/master.svg?logo=codecov&logoColor=white

_distutils_hack/__init__.py

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -139,33 +139,6 @@ def spec_for_pip(self):
139139
clear_distutils()
140140
self.spec_for_distutils = lambda: None
141141

142-
def spec_for_setuptools(self):
143-
"""
144-
get-pip imports setuptools solely for the purpose of
145-
determining if it's installed. In this case, provide
146-
a stubbed spec to represent setuptools being present
147-
without invoking any behavior.
148-
149-
Workaround for pypa/get-pip#137. Ref #2993.
150-
"""
151-
if not self.is_script('get-pip'):
152-
return
153-
154-
import importlib
155-
156-
class StubbedLoader(importlib.abc.Loader):
157-
158-
def create_module(self, spec):
159-
import types
160-
return types.ModuleType('setuptools')
161-
162-
def exec_module(self, module):
163-
pass
164-
165-
return importlib.util.spec_from_loader(
166-
'setuptools', StubbedLoader(),
167-
)
168-
169142
@classmethod
170143
def pip_imported_during_build(cls):
171144
"""
@@ -177,14 +150,6 @@ def pip_imported_during_build(cls):
177150
for frame, line in traceback.walk_stack(None)
178151
)
179152

180-
@staticmethod
181-
def is_script(name):
182-
try:
183-
import __main__
184-
return os.path.basename(__main__.__file__) == f'{name}.py'
185-
except AttributeError:
186-
pass
187-
188153
@staticmethod
189154
def frame_file_is_setup(frame):
190155
"""

0 commit comments

Comments
 (0)