forked from pypa/setuptools
-
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.
* Bump importlib_metadata in type tests * New pyright specific workflow * Add missing spaces in comparison * Fix requirements * Typo and fix cygwin * Update .github/workflows/pyright.yml * get_ext_filename doesn't need to be modified for this PR --------- Co-authored-by: Anderson Bravalheri <andersonbravalheri+github@gmail.com> Co-authored-by: Anderson Bravalheri <andersonbravalheri@gmail.com>
- Loading branch information
1 parent
59ec6f9
commit d12330d
Showing
18 changed files
with
183 additions
and
35 deletions.
There are no files selected for viewing
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,74 @@ | ||
# Split workflow file to not interfere with skeleton | ||
name: pyright | ||
|
||
on: | ||
merge_group: | ||
push: | ||
branches-ignore: | ||
# temporary GH branches relating to merge queues (jaraco/skeleton#93) | ||
- gh-readonly-queue/** | ||
tags: | ||
# required if branches-ignore is supplied (jaraco/skeleton#103) | ||
- '**' | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: >- | ||
${{ github.workflow }}- | ||
${{ github.ref_type }}- | ||
${{ github.event.pull_request.number || github.sha }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
# pin pyright version so a new version doesn't suddenly cause the CI to fail, | ||
# until types-setuptools is removed from typeshed. | ||
# For help with static-typing issues, or pyright update, ping @Avasam | ||
PYRIGHT_VERSION: "1.1.377" | ||
|
||
# Environment variable to support color support (jaraco/skeleton#66) | ||
FORCE_COLOR: 1 | ||
|
||
# Suppress noisy pip warnings | ||
PIP_DISABLE_PIP_VERSION_CHECK: 'true' | ||
PIP_NO_PYTHON_VERSION_WARNING: 'true' | ||
PIP_NO_WARN_SCRIPT_LOCATION: 'true' | ||
|
||
jobs: | ||
pyright: | ||
strategy: | ||
# https://blog.jaraco.com/efficient-use-of-ci-resources/ | ||
matrix: | ||
python: | ||
- "3.8" | ||
- "3.12" | ||
platform: | ||
- ubuntu-latest | ||
runs-on: ${{ matrix.platform }} | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
allow-prereleases: true | ||
- name: Install typed dependencies | ||
run: python -m pip install -e .[core,type] | ||
- name: Inform how to run locally | ||
run: | | ||
echo 'To run this test locally with npm pre-installed, run:' | ||
echo '> npx -y pyright@${{ env.PYRIGHT_VERSION }} --threads' | ||
echo 'You can also instead install "Pyright for Python" which will install npm for you:' | ||
if [ '$PYRIGHT_VERSION' == 'latest' ]; then | ||
echo '> pip install -U' | ||
else | ||
echo '> pip install pyright==${{ env.PYRIGHT_VERSION }}' | ||
fi | ||
echo 'pyright --threads' | ||
shell: bash | ||
- name: Run pyright | ||
uses: jakebailey/pyright-action@v2 | ||
with: | ||
version: ${{ env.PYRIGHT_VERSION }} | ||
extra-args: --threads |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/microsoft/pyright/main/packages/vscode-pyright/schemas/pyrightconfig.schema.json", | ||
"exclude": [ | ||
"build", | ||
".tox", | ||
".eggs", | ||
"**/_vendor", // Vendored | ||
"setuptools/_distutils", // Vendored | ||
"setuptools/config/_validate_pyproject/**", // Auto-generated | ||
], | ||
// Our testing setup doesn't allow passing CLI arguments, so local devs have to set this manually. | ||
// "pythonVersion": "3.8", | ||
// For now we don't mind if mypy's `type: ignore` comments accidentally suppresses pyright issues | ||
"enableTypeIgnoreComments": true, | ||
"typeCheckingMode": "basic", | ||
// Too many issues caused by dynamic patching, still worth fixing when we can | ||
"reportAttributeAccessIssue": "warning", | ||
// Fails on Python 3.12 due to missing distutils and on cygwin CI tests | ||
"reportAssignmentType": "warning", | ||
"reportMissingImports": "warning", | ||
"reportOptionalCall": "warning", | ||
// FIXME: A handful of reportOperatorIssue spread throughout the codebase | ||
"reportOperatorIssue": "warning", | ||
// Deferred initialization (initialize_options/finalize_options) causes many "potentially None" issues | ||
// TODO: Fix with type-guards or by changing how it's initialized | ||
"reportArgumentType": "warning", // A lot of these are caused by jaraco.path.build's spec argument not being a Mapping https://github.com/jaraco/jaraco.path/pull/3 | ||
"reportCallIssue": "warning", | ||
"reportGeneralTypeIssues": "warning", | ||
"reportOptionalIterable": "warning", | ||
"reportOptionalMemberAccess": "warning", | ||
"reportOptionalOperand": "warning", | ||
} |
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.