forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into cached_property_docs
* main: (204 commits) pythongh-101819: Fix _io clinic input for unused base class method stubs (python#104418) pythongh-101819: Isolate `_io` (python#101948) Bump mypy from 1.2.0 to 1.3.0 in /Tools/clinic (python#104501) pythongh-104494: Update certain Tkinter pack/place tests for Tk 8.7 errors (python#104495) pythongh-104050: Run mypy on `clinic.py` in CI (python#104421) pythongh-104490: Consistently define phony make targets (python#104491) pythongh-67056: document that registering/unregistering an atexit func from within an atexit func is undefined (python#104473) pythongh-104487: PYTHON_FOR_REGEN must be minimum Python 3.10 (python#104488) pythongh-101282: move BOLT config after PGO (pythongh-104493) pythongh-104469 Convert _testcapi/float.c to use AC (pythongh-104470) pythongh-104456: Fix ref leak in _ctypes.COMError (python#104457) pythongh-98539: Make _SSLTransportProtocol.abort() safe to call when closed (python#104474) pythongh-104337: Clarify random.gammavariate doc entry (python#104410) Minor improvements to typing docs (python#104465) pythongh-87092: avoid gcc warning on uninitialized struct field in assemble.c (python#104460) pythonGH-71383: IDLE - Document testing subsets of modules (python#104463) pythongh-104454: Fix refleak in AttributeError_reduce (python#104455) pythongh-75710: IDLE - add docstrings and comments to editor module (python#104446) pythongh-91896: Revert some very noisy DeprecationWarnings for `ByteString` (python#104424) Add a mention of PYTHONBREAKPOINT to breakpoint() docs (python#104430) ...
- Loading branch information
Showing
571 changed files
with
18,584 additions
and
9,705 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,7 @@ jobs: | |
timeout-minutes: 10 | ||
outputs: | ||
run_tests: ${{ steps.check.outputs.run_tests }} | ||
run_hypothesis: ${{ steps.check.outputs.run_hypothesis }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Check for source changes | ||
|
@@ -61,6 +62,17 @@ jobs: | |
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc)' && echo "run_tests=true" >> $GITHUB_OUTPUT || true | ||
fi | ||
# Check if we should run hypothesis tests | ||
GIT_BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}} | ||
echo $GIT_BRANCH | ||
if $(echo "$GIT_BRANCH" | grep -q -w '3\.\(8\|9\|10\|11\)'); then | ||
echo "Branch too old for hypothesis tests" | ||
echo "run_hypothesis=false" >> $GITHUB_OUTPUT | ||
else | ||
echo "Run hypothesis tests" | ||
echo "run_hypothesis=true" >> $GITHUB_OUTPUT | ||
fi | ||
check_generated_files: | ||
name: 'Check if generated files are up to date' | ||
runs-on: ubuntu-latest | ||
|
@@ -291,6 +303,92 @@ jobs: | |
- name: SSL tests | ||
run: ./python Lib/test/ssltests.py | ||
|
||
test_hypothesis: | ||
name: "Hypothesis Tests on Ubuntu" | ||
runs-on: ubuntu-20.04 | ||
timeout-minutes: 60 | ||
needs: check_source | ||
if: needs.check_source.outputs.run_tests == 'true' && needs.check_source.outputs.run_hypothesis == 'true' | ||
env: | ||
OPENSSL_VER: 1.1.1t | ||
PYTHONSTRICTEXTENSIONBUILD: 1 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Register gcc problem matcher | ||
run: echo "::add-matcher::.github/problem-matchers/gcc.json" | ||
- name: Install Dependencies | ||
run: sudo ./.github/workflows/posix-deps-apt.sh | ||
- name: Configure OpenSSL env vars | ||
run: | | ||
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV | ||
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV | ||
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV | ||
- name: 'Restore OpenSSL build' | ||
id: cache-openssl | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./multissl/openssl/${{ env.OPENSSL_VER }} | ||
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }} | ||
- name: Install OpenSSL | ||
if: steps.cache-openssl.outputs.cache-hit != 'true' | ||
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux | ||
- name: Add ccache to PATH | ||
run: | | ||
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV | ||
- name: Configure ccache action | ||
uses: hendrikmuhs/[email protected] | ||
- name: Setup directory envs for out-of-tree builds | ||
run: | | ||
echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV | ||
echo "CPYTHON_BUILDDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-builddir)" >> $GITHUB_ENV | ||
- name: Create directories for read-only out-of-tree builds | ||
run: mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR | ||
- name: Bind mount sources read-only | ||
run: sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR | ||
- name: Configure CPython out-of-tree | ||
working-directory: ${{ env.CPYTHON_BUILDDIR }} | ||
run: ../cpython-ro-srcdir/configure --with-pydebug --with-openssl=$OPENSSL_DIR | ||
- name: Build CPython out-of-tree | ||
working-directory: ${{ env.CPYTHON_BUILDDIR }} | ||
run: make -j4 | ||
- name: Display build info | ||
working-directory: ${{ env.CPYTHON_BUILDDIR }} | ||
run: make pythoninfo | ||
- name: Remount sources writable for tests | ||
# some tests write to srcdir, lack of pyc files slows down testing | ||
run: sudo mount $CPYTHON_RO_SRCDIR -oremount,rw | ||
- name: Setup directory envs for out-of-tree builds | ||
run: | | ||
echo "CPYTHON_BUILDDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-builddir)" >> $GITHUB_ENV | ||
- name: "Create hypothesis venv" | ||
working-directory: ${{ env.CPYTHON_BUILDDIR }} | ||
run: | | ||
VENV_LOC=$(realpath -m .)/hypovenv | ||
VENV_PYTHON=$VENV_LOC/bin/python | ||
echo "HYPOVENV=${VENV_LOC}" >> $GITHUB_ENV | ||
echo "VENV_PYTHON=${VENV_PYTHON}" >> $GITHUB_ENV | ||
./python -m venv $VENV_LOC && $VENV_PYTHON -m pip install -U hypothesis | ||
- name: "Run tests" | ||
working-directory: ${{ env.CPYTHON_BUILDDIR }} | ||
run: | | ||
# Most of the excluded tests are slow test suites with no property tests | ||
# | ||
# (GH-104097) test_sysconfig is skipped because it has tests that are | ||
# failing when executed from inside a virtual environment. | ||
${{ env.VENV_PYTHON }} -m test \ | ||
-W \ | ||
-o \ | ||
-j4 \ | ||
-x test_asyncio \ | ||
-x test_multiprocessing_fork \ | ||
-x test_multiprocessing_forkserver \ | ||
-x test_multiprocessing_spawn \ | ||
-x test_concurrent_futures \ | ||
-x test_socket \ | ||
-x test_subprocess \ | ||
-x test_signal \ | ||
-x test_sysconfig | ||
build_asan: | ||
name: 'Address sanitizer' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Lint | ||
|
||
on: [push, pull_request, workflow_dispatch] | ||
|
||
permissions: | ||
contents: read | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.x" | ||
- uses: pre-commit/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Workflow to run mypy on select parts of the CPython repo | ||
name: mypy | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
paths: | ||
- "Tools/clinic/**" | ||
- ".github/workflows/mypy.yml" | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
PIP_DISABLE_PIP_VERSION_CHECK: 1 | ||
FORCE_COLOR: 1 | ||
TERM: xterm-256color # needed for FORCE_COLOR to work on mypy on Ubuntu, see https://github.com/python/mypy/issues/13817 | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
mypy: | ||
name: Run mypy on Tools/clinic/ | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.x" | ||
cache: pip | ||
cache-dependency-path: Tools/clinic/requirements-dev.txt | ||
- run: pip install -r Tools/clinic/requirements-dev.txt | ||
- run: mypy --config-file Tools/clinic/mypy.ini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: check-yaml | ||
- id: trailing-whitespace | ||
types_or: [c, python, rst] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.