From f4b89f5f86d2d2a80d2889ddae3349fabaaf219d Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Sun, 14 Apr 2024 22:34:10 +0200 Subject: [PATCH] Rename check_consistent.py to check_typeshed_structure.py (#11761) --- .github/workflows/tests.yml | 6 +++--- CONTRIBUTING.md | 2 +- scripts/runtests.py | 8 ++++---- tests/README.md | 8 +++++--- .../{check_consistent.py => check_typeshed_structure.py} | 0 5 files changed, 13 insertions(+), 11 deletions(-) rename tests/{check_consistent.py => check_typeshed_structure.py} (100%) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9e01a33fe..1a96d5a14 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,8 +22,8 @@ concurrency: cancel-in-progress: true jobs: - file-consistency: - name: Check file consistency + typeshed-structure: + name: Check typeshed structure runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -32,7 +32,7 @@ jobs: python-version: "3.12" - run: curl -LsSf https://astral.sh/uv/install.sh | sh - run: uv pip install -r requirements-tests.txt --system - - run: python ./tests/check_consistent.py + - run: python ./tests/check_typeshed_structure.py new-syntax: name: Ensure new syntax usage diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ac582a6e1..70c20e59f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -221,7 +221,7 @@ This has the following keys: distribution. The format of all `METADATA.toml` files can be checked by running -`python3 ./tests/check_consistent.py`. +`python3 ./tests/check_typeshed_structure.py`. ## Preparing Changes diff --git a/scripts/runtests.py b/scripts/runtests.py index 4e7755bc6..219886aca 100755 --- a/scripts/runtests.py +++ b/scripts/runtests.py @@ -84,8 +84,8 @@ def main() -> None: print("\nRunning pre-commit...") pre_commit_result = subprocess.run(["pre-commit", "run", "--all-files"]) - print("\nRunning check_consistent.py...") - check_consistent_result = subprocess.run([sys.executable, "tests/check_consistent.py"]) + print("\nRunning check_typeshed_structure.py...") + check_structure_result = subprocess.run([sys.executable, "tests/check_typeshed_structure.py"]) print("\nRunning check_new_syntax.py...") check_new_syntax_result = subprocess.run([sys.executable, "tests/check_new_syntax.py"]) @@ -179,7 +179,7 @@ def main() -> None: any_failure = any( [ pre_commit_result.returncode, - check_consistent_result.returncode, + check_structure_result.returncode, check_new_syntax_result.returncode, pyright_returncode, mypy_result.returncode, @@ -206,7 +206,7 @@ def main() -> None: applied some autofixes. If the latter, you may want to check that the autofixes did sensible things.""" ) - print("Check consistent:", _SUCCESS if check_consistent_result.returncode == 0 else _FAILED) + print("Check structure:", _SUCCESS if check_structure_result.returncode == 0 else _FAILED) print("Check new syntax:", _SUCCESS if check_new_syntax_result.returncode == 0 else _FAILED) if pyright_skipped: print("Pyright:", _SKIPPED) diff --git a/tests/README.md b/tests/README.md index 1cb056a18..ae48d19bc 100644 --- a/tests/README.md +++ b/tests/README.md @@ -7,7 +7,7 @@ tests the stubs with [mypy](https://github.com/python/mypy/) [pyright](https://github.com/microsoft/pyright). - `tests/regr_test.py` runs mypy against the test cases for typeshed's stubs, guarding against accidental regressions. -- `tests/check_consistent.py` checks that typeshed's directory +- `tests/check_typeshed_structure.py` checks that typeshed's directory structure and metadata files are correct. - `tests/check_new_syntax.py` contains linter-like checks to ensure that certain code conventions are followed. @@ -109,11 +109,13 @@ for more information about what these test cases are for and how they work. Run `python tests/regr_test.py --help` for information on the various configuration options. -## check\_consistent.py +## check\_typeshed\_structure.py + +This checks that typeshed's directory structure and metadata files are correct. Run using: ```bash -$ python3 tests/check_consistent.py +$ python3 tests/check_typeshed_structure.py ``` ## stubtest\_stdlib.py diff --git a/tests/check_consistent.py b/tests/check_typeshed_structure.py similarity index 100% rename from tests/check_consistent.py rename to tests/check_typeshed_structure.py