Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run pyright via tox #1134

Merged
merged 35 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
a07aae7
Run pyright in tox
pakrym-stripe Nov 15, 2023
4181ef5
Merge branch 'master' into pakrym/Run_pyright_in_tox
pakrym-stripe Nov 15, 2023
f177079
Update tox.ini by adding skipsdist, skip_install, usedevelop and pack…
pakrym-stripe Nov 15, 2023
f93fd7f
more
pakrym-stripe Nov 15, 2023
34fbad7
Remove 'tox' from requirements.txt.
pakrym-stripe Nov 15, 2023
4b817ab
need no deps
pakrym-stripe Nov 15, 2023
3bd1e4a
isntall and test using different versions
pakrym-stripe Nov 15, 2023
444a3db
split requirements
pakrym-stripe Nov 15, 2023
23499c9
Git: Add 'fail-fast: false' to CI workflow configuration and remove '…
pakrym-stripe Nov 15, 2023
e46ed69
Update ci.yml: remove previous Python 3.10 set up, use matrix python-…
pakrym-stripe Nov 15, 2023
4f0e36a
Makefile: Change default Python version from python3 to python3.10.
pakrym-stripe Nov 15, 2023
b54f7da
Update ci.yml to set up Python version 3.10 in Github workflows.
pakrym-stripe Nov 15, 2023
5545159
explicit
pakrym-stripe Nov 15, 2023
fe09c96
Change job name in ci.yml from 'Lint' to 'Typecheck and lint' and add…
pakrym-stripe Nov 15, 2023
4b84441
Combine testenv:pyright, testenv:fmt, and testenv:lint into a single …
pakrym-stripe Nov 15, 2023
07654f0
The commit modifies the CI workflow file to change the job name from …
pakrym-stripe Nov 15, 2023
0d28c00
Git diff shows the changes made in the file ".github/workflows/ci.yml…
pakrym-stripe Nov 15, 2023
c376461
Git: Add condition to skip typechecking in pypy legs in ci.yml and pa…
pakrym-stripe Nov 15, 2023
3f39b23
[LLM] Makefile updated to include 'DEFAULT_TEST_ENV' variable, update…
pakrym-stripe Nov 15, 2023
560ad48
[LLM] Added 'ignore_base_python_conflict = false' to tox.ini file.
pakrym-stripe Nov 15, 2023
99aa724
[LLM] Update '.github/workflows/ci.yml' and 'tox.ini' to map python-v…
pakrym-stripe Nov 15, 2023
69fd8b7
[LLM] Removed separate Python 3.10 setup step and integrated it into …
pakrym-stripe Nov 15, 2023
a1f7e35
remove stripe-mock-check
pakrym-stripe Nov 15, 2023
836a148
better
pakrym-stripe Nov 15, 2023
2093c66
try this
pakrym-stripe Nov 15, 2023
e4c9434
remove more
pakrym-stripe Nov 15, 2023
5330a74
[LLM] Update requirements.txt file to specify virtualenv version due …
pakrym-stripe Nov 15, 2023
d0ec83b
[LLM] Downgrade tox from 4.11.3 to 4.5.0 and move the comment and ver…
pakrym-stripe Nov 15, 2023
0d1da0f
comment
pakrym-stripe Nov 15, 2023
3e9cd04
fix mock detection
pakrym-stripe Nov 15, 2023
5f3ae4a
[LLM] Changed test name dynamic based on python-version, remove depre…
pakrym-stripe Nov 15, 2023
3a4fbba
[LLM] Move `name: Test ${{ python-version }}` from line 63 to line 94…
pakrym-stripe Nov 15, 2023
289988d
[LLM] Refactor python version setup in GitHub Actions workflow, chang…
pakrym-stripe Nov 15, 2023
5a6f547
[LLM] ci.yml: Change display format of Python version in test name.
pakrym-stripe Nov 15, 2023
e4fb670
[LLM] Change key from 'python.version' to 'python-version' in .github…
pakrym-stripe Nov 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,7 @@ coveralls: venv
@${VENV_NAME}/bin/tox -e coveralls

pyright: venv
# In order for pyright to be able to follow imports, we need "editable_mode=compat" to force setuptools to do
# an editable install via a .pth file mechanism and not "import hooks". See
# the "editable installs" section of https://github.com/microsoft/pyright/blob/main/docs/import-resolution.md#editable-installs

# This command might fail if we're on python 3.6, as versions of pip that
# support python 3.6 don't know about "--config-settings", but in this case
# we don't need to pass config-settings anyway because "editable_mode=compat" just
# means to perform as these old versions of pip already do.
pip install -e . --config-settings editable_mode=compat || pip install -e .
@${VENV_NAME}/bin/pyright --version
@${VENV_NAME}/bin/pyright $(PYRIGHT_ARGS)
@${VENV_NAME}/bin/tox -e pyright $(PYRIGHT_ARGS)

fmt: venv
@${VENV_NAME}/bin/tox -e fmt
Expand Down
24 changes: 10 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[tool.black]
line-length=79
line-length = 79
target-version = [
"py35",
"py36",
"py37",
"py38",
"py39",
"py310",
# "py311", # black 21.12b0 doesn't
# "py312", # support these targets
# "py311", # black 21.12b0 doesn't
# "py312", # support these targets
]
exclude = '''
/(
Expand All @@ -23,14 +23,10 @@ exclude = '''
)
'''
[tool.pyright]
executionEnvironments=[
{"root" = "stripe"},
{"root" = "tests"}
]
pakrym-stripe marked this conversation as resolved.
Show resolved Hide resolved
include=["stripe", "tests/test_generated_examples.py"]
exclude=["build", "**/__pycache__"]
reportMissingTypeArgument=true
reportUnnecessaryCast=true
reportUnnecessaryComparison=true
reportUnnecessaryContains=true
reportUnnecessaryIsInstance=true
include = ["stripe", "tests/test_generated_examples.py"]
exclude = ["build", "**/__pycache__"]
reportMissingTypeArgument = true
reportUnnecessaryCast = true
reportUnnecessaryComparison = true
reportUnnecessaryContains = true
reportUnnecessaryIsInstance = true
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
cryptography<40
tox
twine
pakrym-stripe marked this conversation as resolved.
Show resolved Hide resolved
pyright
tox == 4.11.3
pyright == 1.1.336
pytest-cov >= 2.8.1, < 2.11.0
pytest-mock >= 2.0.0
pytest-xdist >= 1.31.0
Expand All @@ -11,4 +12,4 @@ black == 22.8.0
flake8
coverage >= 4.5.3, < 5
coveralls
tox-gh-actions
tox-gh-actions == 3.1.3
9 changes: 9 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
envlist =
fmt
lint
pyright
py{312,311,310,39,38,37,36,py3}
skip_missing_interpreters = true
pakrym-stripe marked this conversation as resolved.
Show resolved Hide resolved

Expand Down Expand Up @@ -42,6 +43,14 @@ commands = pytest --cov {posargs:-n auto} --ignore stripe
# CFLAGS="-I$(brew --prefix openssl@1.1)/include"
passenv = LDFLAGS,CFLAGS

[testenv:pyright]
basepython = python3.10
skip_install = true
commands =
pyright
deps =
-r requirements.txt

[testenv:fmt]
description = run code formatting using black
basepython = python3.10
Expand Down
Loading