Skip to content

Commit 47afe7f

Browse files
author
nightcityblade
committed
[aiofiles] Remove regression test
0 parents  commit 47afe7f

5,855 files changed

Lines changed: 379062 additions & 0 deletions

File tree

Some content is hidden

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

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
root = true
2+
3+
[*]
4+
trim_trailing_whitespace = true
5+
insert_final_newline = true
6+
indent_style = space
7+
end_of_line = lf
8+
indent_size = 2
9+
10+
[*.md]
11+
max_line_length = 79
12+
trim_trailing_whitespace = false
13+
14+
[*.{py,pyi,toml,json}]
15+
max_line_length = 130
16+
indent_size = 4

.flake8

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[flake8]
2+
# Y: Flake8 is only used to run flake8-pyi, everything else is in Ruff
3+
select = Y
4+
# Ignore rules normally excluded by default
5+
# Also ignore Y041 (redundant (complex |) float | int), see
6+
# https://github.com/python/typeshed/issues/16059
7+
extend-ignore = Y041,Y090,Y091
8+
per-file-ignores =
9+
# Generated protobuf files:
10+
# Y021: Include docstrings
11+
# Y023: Alias typing as typing_extensions
12+
# Y026: Have implicit type aliases
13+
# Y053: have literals >50 characters long
14+
stubs/*_pb2.pyi: Y021, Y023, Y026, Y053
15+
16+
exclude = .venv*,.git

.gitattributes

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Normalize EOF
2+
* autocrlf=false
3+
* eol=lf
4+
# Set linguist-language to support comments syntax highlight
5+
**/stubtest_allowlist*.txt linguist-language=ini
6+
**/stubtest_allowlists/*.txt linguist-language=ini
7+
pyrightconfig*.json linguist-language=jsonc
8+
.vscode/*.json linguist-language=jsonc

.github/renovate.json5

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"dependencyDashboard": true,
4+
"suppressNotifications": ["prEditedNotification"],
5+
"extends": ["config:recommended"],
6+
"labels": ["bot: dependencies"],
7+
"rebaseLabel": ["bot: rebase"],
8+
"semanticCommits": "disabled",
9+
"separateMajorMinor": false,
10+
"prHourlyLimit": 10,
11+
// This package rule disables updates for `actions/setup-python` Python versions:
12+
// it's better to do these manually as there's often a reason why we can't use
13+
// the latest Python version in CI for a specific job
14+
ignoreDeps: ["python"],
15+
"pre-commit": {
16+
"enabled": true
17+
},
18+
"packageRules": [
19+
{
20+
groupName: "GitHub Actions",
21+
matchManagers: ["github-actions"],
22+
description: "Quarterly update of GitHub Action dependencies",
23+
schedule: ["every 3 months on the first day of the month"]
24+
},
25+
{
26+
groupName: "most test/lint dependencies",
27+
matchManagers: ["pip_requirements", "pre-commit"],
28+
matchPackageNames: ["!pyright"],
29+
description: "Quarterly update of most test dependencies",
30+
schedule: ["every 3 months on the first day of the month"]
31+
},
32+
{
33+
"groupName": "pyright",
34+
"matchManagers": ["pip_requirements"],
35+
"matchPackageNames": ["pyright"],
36+
"description": "Daily update of pyright",
37+
"schedule": ["before 4am"]
38+
}
39+
]
40+
}

.github/workflows/daily.yml

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
name: Daily test
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "0 0 * * *"
7+
pull_request:
8+
paths:
9+
- "requirements-tests.txt"
10+
- ".github/workflows/daily.yml"
11+
12+
# Please keep the permissions minimal, as stubtest runs arbitrary code from pypi.
13+
permissions:
14+
contents: read
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
18+
cancel-in-progress: true
19+
20+
env:
21+
# A few env vars to speedup brew install
22+
HOMEBREW_NO_ANALYTICS: 1
23+
HOMEBREW_NO_AUTOUPDATE: 1
24+
HOMEBREW_NO_INSTALL_CLEANUP: 1 # Environments are isolated, no need to cleanup old versions
25+
NONINTERACTIVE: 1 # Required for brew install on CI
26+
PIP_DISABLE_PIP_VERSION_CHECK: 1
27+
FORCE_COLOR: 1
28+
TERM: xterm-256color # needed for FORCE_COLOR to work on mypy on Ubuntu, see https://github.com/python/mypy/issues/13817
29+
30+
jobs:
31+
stubtest-stdlib:
32+
name: "stubtest: stdlib"
33+
if: ${{ github.repository == 'python/typeshed' || github.event_name != 'schedule' }}
34+
runs-on: ${{ matrix.os }}
35+
strategy:
36+
matrix:
37+
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
38+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
39+
exclude:
40+
# https://github.com/python/typeshed/issues/15694
41+
- os: "windows-latest"
42+
python-version: "3.10"
43+
fail-fast: false
44+
45+
steps:
46+
- uses: actions/checkout@v7
47+
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
48+
uses: actions/setup-python@v6
49+
with:
50+
python-version: ${{ matrix.python-version }}
51+
cache: pip
52+
cache-dependency-path: requirements-tests.txt
53+
allow-prereleases: true
54+
check-latest: true
55+
- name: Install dependencies
56+
run: pip install -r requirements-tests.txt
57+
- name: Run stubtest
58+
run: python tests/stubtest_stdlib.py
59+
60+
stubtest-third-party:
61+
name: "stubtest: third party"
62+
if: ${{ github.repository == 'python/typeshed' || github.event_name != 'schedule' }}
63+
runs-on: ${{ matrix.os }}
64+
strategy:
65+
matrix:
66+
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
67+
shard-index: [0, 1, 2, 3]
68+
fail-fast: false
69+
steps:
70+
- uses: actions/checkout@v7
71+
- uses: actions/setup-python@v6
72+
with:
73+
python-version: "3.13"
74+
cache: pip
75+
cache-dependency-path: |
76+
requirements-tests.txt
77+
stubs/**/METADATA.toml
78+
- name: Install dependencies
79+
run: pip install -r requirements-tests.txt
80+
- name: Install required system packages
81+
shell: bash
82+
run: |
83+
PACKAGES=$(python tests/get_stubtest_system_requirements.py)
84+
85+
if [ "${{ runner.os }}" = "Linux" ]; then
86+
if [ -n "$PACKAGES" ]; then
87+
printf "Installing APT packages:\n $(echo $PACKAGES | sed 's/ /\n /g')\n"
88+
sudo apt-get update -q && sudo apt-get install -qy $PACKAGES
89+
fi
90+
else
91+
if [ "${{ runner.os }}" = "macOS" ] && [ -n "$PACKAGES" ]; then
92+
printf "Installing Homebrew packages:\n $(echo $PACKAGES | sed 's/ /\n /g')\n"
93+
brew install -q $PACKAGES
94+
fi
95+
96+
if [ "${{ runner.os }}" = "Windows" ] && [ -n "$PACKAGES" ]; then
97+
printf "Installing Chocolatey packages:\n $(echo $PACKAGES | sed 's/ /\n /g')\n"
98+
choco install -y $PACKAGES
99+
fi
100+
fi
101+
- name: Run stubtest
102+
shell: bash
103+
run: |
104+
if [ "${{ runner.os }}" = "Linux" ]; then
105+
PYTHON_EXECUTABLE="xvfb-run python"
106+
else
107+
PYTHON_EXECUTABLE="python"
108+
fi
109+
110+
$PYTHON_EXECUTABLE tests/stubtest_third_party.py --ci-platforms-only --num-shards 4 --shard-index ${{ matrix.shard-index }}
111+
112+
stub-uploader:
113+
name: stub_uploader tests
114+
if: ${{ github.repository == 'python/typeshed' || github.event_name != 'schedule' }}
115+
runs-on: ubuntu-latest
116+
steps:
117+
- name: Checkout typeshed
118+
uses: actions/checkout@v7
119+
with:
120+
path: typeshed
121+
- name: Checkout stub_uploader
122+
uses: actions/checkout@v7
123+
with:
124+
repository: typeshed-internal/stub_uploader
125+
path: stub_uploader
126+
- uses: astral-sh/setup-uv@v8.2.0
127+
with:
128+
version-file: "typeshed/requirements-tests.txt"
129+
- name: Run tests
130+
run: |
131+
cd stub_uploader
132+
# Keep Python version in sync with stub_uploader's check_scripts.yml workflow.
133+
uv run --python=3.13 --no-project --with-requirements=requirements.txt -m pytest tests
134+
135+
# https://github.community/t/run-github-actions-job-only-if-previous-job-has-failed/174786/2
136+
create-issue-on-failure:
137+
name: Create issue on failure
138+
runs-on: ubuntu-latest
139+
needs: [stubtest-stdlib, stubtest-third-party, stub-uploader]
140+
if: ${{ github.repository == 'python/typeshed' && always() && github.event_name == 'schedule' && (needs.stubtest-stdlib.result == 'failure' || needs.stubtest-third-party.result == 'failure' || needs.stub-uploader.result == 'failure') }}
141+
permissions:
142+
issues: write
143+
steps:
144+
- uses: actions/github-script@v9
145+
with:
146+
github-token: ${{ secrets.GITHUB_TOKEN }}
147+
script: |
148+
await github.rest.issues.create({
149+
owner: "python",
150+
repo: "typeshed",
151+
title: `Daily tests failed on ${new Date().toDateString()}`,
152+
body: "Run listed here: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
153+
labels: ["help wanted"],
154+
})

.github/workflows/meta_tests.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# This workflow is for testing typeshed's scripts and tests themselves
2+
name: Meta-tests
3+
4+
on:
5+
workflow_dispatch:
6+
push:
7+
branches:
8+
- main
9+
pull_request:
10+
paths:
11+
- "scripts/**"
12+
- "tests/**"
13+
- "lib/**"
14+
- ".github/workflows/meta_tests.yml"
15+
- "requirements-tests.txt"
16+
- "pyproject.toml"
17+
18+
permissions:
19+
contents: read
20+
21+
env:
22+
PIP_DISABLE_PIP_VERSION_CHECK: 1
23+
FORCE_COLOR: 1
24+
25+
concurrency:
26+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
27+
cancel-in-progress: true
28+
29+
jobs:
30+
mypy:
31+
name: Check scripts and tests with mypy
32+
runs-on: ubuntu-latest
33+
strategy:
34+
matrix:
35+
platform: ["linux", "win32"]
36+
fail-fast: false
37+
steps:
38+
- uses: actions/checkout@v7
39+
- uses: astral-sh/setup-uv@v8.2.0
40+
with:
41+
version-file: "requirements-tests.txt"
42+
- run: |
43+
uv run \
44+
--python=3.13 \
45+
--no-project \
46+
--with-requirements=requirements-tests.txt \
47+
./tests/typecheck_typeshed.py \
48+
--platform=${{ matrix.platform }}
49+
50+
pyright:
51+
name: Check scripts and tests with pyright
52+
runs-on: ubuntu-latest
53+
strategy:
54+
matrix:
55+
python-platform: ["Linux", "Windows"]
56+
fail-fast: false
57+
steps:
58+
- uses: actions/checkout@v7
59+
- uses: actions/setup-python@v6
60+
with:
61+
python-version: "3.13"
62+
- uses: astral-sh/setup-uv@v8.2.0
63+
with:
64+
version-file: "requirements-tests.txt"
65+
- run: uv pip install -r requirements-tests.txt --system
66+
- name: Run pyright on typeshed
67+
uses: jakebailey/pyright-action@v3
68+
with:
69+
version: PATH
70+
python-platform: ${{ matrix.python-platform }}
71+
python-version: "3.10" # Oldest version supported for running scripts and tests
72+
project: ./pyrightconfig.scripts_and_tests.json
73+
74+
stubsabot-dry-run:
75+
name: Stubsabot dry run
76+
runs-on: ubuntu-latest
77+
steps:
78+
- uses: actions/checkout@v7
79+
- uses: astral-sh/setup-uv@v8.2.0
80+
with:
81+
version-file: "requirements-tests.txt"
82+
- name: Git config
83+
run: |
84+
git config --global user.name stubsabot
85+
git config --global user.email '<>'
86+
- run: |
87+
uv run \
88+
--python=3.13 \
89+
--no-project \
90+
--with-requirements=requirements-tests.txt \
91+
scripts/stubsabot.py \
92+
--action-level=local

0 commit comments

Comments
 (0)