Skip to content

Commit 383ed7a

Browse files
committed
Merge branch 'main' into debt/remove-easy-install
2 parents 8d12d61 + e009a87 commit 383ed7a

File tree

496 files changed

+35319
-3720
lines changed

Some content is hidden

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

496 files changed

+35319
-3720
lines changed

.bumpversion.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 59.2.0
2+
current_version = 62.1.0
33
commit = True
44
tag = True
55

.codecov.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,11 @@ comment: false
22
coverage:
33
status:
44
project:
5-
threshold: 0.5%
5+
default:
6+
informational: true # Treat coverage info as informational only
7+
threshold: 0.5%
8+
patch:
9+
default:
10+
informational: true # Treat coverage info as informational only
11+
github_checks:
12+
annotations: false # Codecov may pollute the "files" diff view

.coveragerc

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
omit =
33
# leading `*/` for pytest-dev/pytest-cov#456
44
*/.tox/*
5+
*/_validate_pyproject/* # generated code, tested in `validate-pyproject`
56

67
[report]
78
show_missing = True

.flake8

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ extend-exclude =
88
build
99
setuptools/_vendor
1010
setuptools/_distutils
11+
setuptools/config/_validate_pyproject/fastjsonschema_*
1112
pkg_resources/_vendor
1213

1314
extend-ignore =

.github/ISSUE_TEMPLATE/bug-report.yml

-11
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,4 @@ body:
115115
validations:
116116
required: true
117117

118-
119-
- type: checkboxes
120-
attributes:
121-
label: Code of Conduct
122-
description: |
123-
Read the [PSF Code of Conduct][CoC] first.
124-
125-
[CoC]: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md
126-
options:
127-
- label: I agree to follow the PSF Code of Conduct
128-
required: true
129118
...

.github/ISSUE_TEMPLATE/config.yml

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# Ref: https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
2-
blank_issues_enabled: false # default: true
31
contact_links:
42
- name: 🤔 Have questions or need support?
53
url: https://github.com/pypa/setuptools/discussions
@@ -9,7 +7,6 @@ contact_links:
97
about: |
108
Please ask typical Q&A here: general ideas for Python packaging,
119
questions about structuring projects and so on
12-
- name: >-
13-
💬 IRC: #pypa @ Freenode
14-
url: https://webchat.freenode.net/#pypa
10+
- name: 💬 Discord (chat)
11+
url: https://discord.com/invite/pypa
1512
about: Chat with devs

.github/workflows/ci-sage.yml

+152
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

+87-8
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,129 @@
11
name: tests
22

3-
on: [push, pull_request]
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
concurrency:
6+
group: >-
7+
${{ github.workflow }}-
8+
${{ github.ref_type }}-
9+
${{ github.event.pull_request.number || github.sha }}
10+
cancel-in-progress: true
411

512
jobs:
613
test:
714
strategy:
815
matrix:
916
distutils:
10-
- stdlib
1117
- local
1218
python:
13-
- pypy3
14-
- 3.6
19+
- pypy-3.7
20+
- 3.7
21+
- 3.8
1522
- 3.9
1623
- "3.10"
1724
platform:
1825
- ubuntu-latest
1926
- macos-latest
2027
- windows-latest
28+
include:
29+
- platform: ubuntu-latest
30+
python: "3.10"
31+
distutils: stdlib
2132
runs-on: ${{ matrix.platform }}
2233
env:
2334
SETUPTOOLS_USE_DISTUTILS: ${{ matrix.distutils }}
35+
timeout-minutes: 75
2436
steps:
2537
- uses: actions/checkout@v2
2638
- name: Setup Python
2739
uses: actions/setup-python@v2
2840
with:
2941
python-version: ${{ matrix.python }}
42+
- uses: actions/cache@v3
43+
id: cache
44+
with:
45+
path: setuptools/tests/config/downloads/*.cfg
46+
key: >-
47+
${{ hashFiles('setuptools/tests/config/setupcfg_examples.txt') }}-
48+
${{ hashFiles('setuptools/tests/config/downloads/*.py') }}
49+
- name: Populate download cache
50+
if: steps.cache.outputs.cache-hit != 'true'
51+
working-directory: setuptools/tests/config
52+
run: python -m downloads.preload setupcfg_examples.txt
3053
- name: Install tox
3154
run: |
3255
python -m pip install tox
3356
- name: Run tests
34-
run: tox -- --cov-report xml
57+
run: tox
58+
- name: Create coverage report
59+
if: hashFiles('.coverage') != '' # Rudimentary `file.exists()`
60+
run: pipx run coverage xml --ignore-errors
3561
- name: Publish coverage
36-
if: false # disabled for #2727
62+
if: hashFiles('coverage.xml') != '' # Rudimentary `file.exists()`
3763
uses: codecov/codecov-action@v1
3864
with:
3965
flags: >- # Mark which lines are covered by which envs
4066
${{ runner.os }},
4167
${{ matrix.python }}
4268
43-
release:
69+
test_cygwin:
70+
runs-on: windows-latest
71+
timeout-minutes: 75
72+
steps:
73+
- uses: actions/checkout@v2
74+
- name: Install Cygwin with Python
75+
uses: cygwin/cygwin-install-action@v1
76+
with:
77+
platform: x86_64
78+
packages: >-
79+
git,
80+
gcc-core,
81+
python38,
82+
python38-devel,
83+
python38-pip
84+
- name: Install tox
85+
shell: C:\cygwin\bin\env.exe CYGWIN_NOWINPATH=1 CHERE_INVOKING=1 C:\cygwin\bin\bash.exe -leo pipefail -o igncr {0}
86+
run: |
87+
python3.8 -m pip install tox
88+
- name: Run tests
89+
shell: C:\cygwin\bin\env.exe CYGWIN_NOWINPATH=1 CHERE_INVOKING=1 C:\cygwin\bin\bash.exe -leo pipefail -o igncr {0}
90+
run: |
91+
tox -- --cov-report xml
92+
93+
integration-test:
4494
needs: test
45-
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
95+
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && contains(github.ref, 'refs/tags/'))
96+
# To avoid long times and high resource usage, we assume that:
97+
# 1. The setuptools APIs used by packages don't vary too much with OS or
98+
# Python implementation
99+
# 2. Any circumstance for which the previous assumption is not valid is
100+
# already tested via unit tests (or other tests not classified here as
101+
# "integration")
102+
# With that in mind, the integration tests can run for a single setup
46103
runs-on: ubuntu-latest
104+
timeout-minutes: 75
105+
steps:
106+
- uses: actions/checkout@v2
107+
- name: Install OS-level dependencies
108+
run: |
109+
sudo apt-get update
110+
sudo apt-get install build-essential gfortran libopenblas-dev
111+
- name: Setup Python
112+
uses: actions/setup-python@v2
113+
with:
114+
# Use a release that is not very new but still have a long life:
115+
python-version: "3.8"
116+
- name: Install tox
117+
run: |
118+
python -m pip install tox
119+
- name: Run integration tests
120+
run: tox -e integration
47121

122+
release:
123+
needs: [test, test_cygwin, integration-test]
124+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
125+
runs-on: ubuntu-latest
126+
timeout-minutes: 75
48127
steps:
49128
- uses: actions/checkout@v2
50129
- name: Setup Python

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ docs/build
66
include
77
lib
88
distribute.egg-info
9-
foo.egg-info
109
setuptools.egg-info
1110
.coverage
1211
.eggs

0 commit comments

Comments
 (0)