Skip to content

Commit

Permalink
Use pyright library
Browse files Browse the repository at this point in the history
  • Loading branch information
vemel committed Apr 29, 2024
1 parent dc3aca9 commit 67e947e
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 60 deletions.
23 changes: 3 additions & 20 deletions .github/workflows/aio_integration.yml
Expand Up @@ -18,18 +18,11 @@ jobs:
with:
python-version-file: pyproject.toml
cache: "poetry"
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install dependencies
run: |
poetry install -n
poetry run pip install -U aioboto3 boto3-stubs types-aiobotocore types-aioboto3
poetry install -n
- name: Install Node.js dependencies
run: |
npm install -g pyright
- name: Integration tests
run: |
poetry run python scripts/integration.py --product aioboto3 -d
Expand Down Expand Up @@ -57,25 +50,15 @@ jobs:
with:
name: aio_mypy_boto3_output
path: mypy_boto3_output
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.version }}
cache: "poetry"
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "pip"
- name: Install dependencies
run: |
poetry install -n
poetry run pip install -U mypy ruff aioboto3 boto3-stubs types-aiobotocore types-aioboto3
poetry install -n
- name: Install Node.js dependencies
run: |
npm install -g pyright
python -m pip install -U pip
poetry run pip install -U mypy ruff pyright aioboto3 boto3-stubs types-aiobotocore types-aioboto3
- name: Check output
run: |
poetry run python ./scripts/check_output.py -p ./mypy_boto3_output
7 changes: 0 additions & 7 deletions .github/workflows/aio_sanity_check.yml
Expand Up @@ -53,10 +53,6 @@ jobs:
with:
python-version-file: pyproject.toml
cache: "poetry"
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install dependencies
run: |
poetry install -n
Expand All @@ -68,9 +64,6 @@ jobs:
BOTOCORE_VERSION: ${{ needs.versions.outputs.botocore }}
run: |
poetry run pip install -U boto3==${BOTO3_VERSION} botocore==${BOTOCORE_VERSION}
- name: Install Node.js dependencies
run: |
npm install -g pyright
- name: Build master packages
run: |
rm -rf mypy_boto3_output/*
Expand Down
17 changes: 2 additions & 15 deletions .github/workflows/integration.yml
Expand Up @@ -18,17 +18,10 @@ jobs:
with:
python-version-file: pyproject.toml
cache: "poetry"
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install dependencies
run: |
poetry install -n
poetry run pip install -U --no-dependencies aiobotocore
- name: Install Node.js dependencies
run: |
npm install -g pyright
- name: Integration tests
run: |
poetry run python scripts/integration.py --product boto3 -d
Expand Down Expand Up @@ -60,17 +53,11 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.version }}
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "pip"
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install mypy ruff boto3 botocore botocore-stubs boto3-stubs-lite types-requests
- name: Install Node.js dependencies
run: |
npm install -g pyright
python -m pip install mypy ruff pyright boto3 botocore botocore-stubs boto3-stubs-lite types-requests
- name: Check output
run: |
python scripts/check_output.py
9 changes: 0 additions & 9 deletions .github/workflows/on_push.yml
Expand Up @@ -42,15 +42,6 @@ jobs:
run: |
poetry run ruff check mypy_boto3_builder --output-format github
poetry run ruff check scripts --output-format github
- name: Set up Node
if: ${{ matrix.check-typing }}
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install Node.js dependencies
if: ${{ matrix.check-typing }}
run: |
npm install -g pyright
- name: Typing
if: ${{ matrix.check-typing }}
run: |
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/sanity_check.yml
Expand Up @@ -53,10 +53,6 @@ jobs:
with:
python-version-file: pyproject.toml
cache: "poetry"
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install dependencies
run: |
poetry install -n
Expand All @@ -66,9 +62,6 @@ jobs:
BOTOCORE_VERSION: ${{ needs.versions.outputs.botocore }}
run: |
poetry run pip install -U boto3==${BOTO3_VERSION} botocore==${BOTOCORE_VERSION}
- name: Install Node.js dependencies
run: |
npm install -g pyright
- name: Build master packages
run: |
rm -rf mypy_boto3_output/*
Expand Down
2 changes: 1 addition & 1 deletion scripts/check_output.py
Expand Up @@ -176,7 +176,7 @@ def run_pyright(path: Path) -> None:
with tempfile.NamedTemporaryFile("w+b") as f:
try:
subprocess.check_call(
["npx", "pyright", path.as_posix(), "--outputjson"],
[sys.executable, "-m", "pyright", path.as_posix(), "--outputjson"],
stderr=subprocess.DEVNULL,
stdout=f,
)
Expand Down
2 changes: 1 addition & 1 deletion scripts/integration.py
Expand Up @@ -210,7 +210,7 @@ def run_pyright(path: Path, snapshot_path: Path, update: bool) -> None:
shutil.copyfile(PYRIGHT_CONFIG_PATH, config_path)
try:
output = subprocess.check_output(
["pyright", path.as_posix(), "--outputjson"],
[sys.executable, "-m", "pyright", path.as_posix(), "--outputjson"],
stderr=subprocess.DEVNULL,
encoding="utf8",
)
Expand Down

0 comments on commit 67e947e

Please sign in to comment.