-
Notifications
You must be signed in to change notification settings - Fork 132
Ruff linter #586
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
Merged
Merged
Ruff linter #586
Changes from 9 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
4afa565
init
juanitorduz 8f11ff5
isort
juanitorduz d433680
remove autoflake
juanitorduz 7dc5beb
formatter
juanitorduz 507fd25
simplify excludes a bit
juanitorduz d982c63
remove ignores
juanitorduz b1c284a
comment about tests ignores
juanitorduz 7280917
rm setup.cfg
juanitorduz 0f37dda
undo remove isorts
juanitorduz bf49e6a
add pyupgrade
juanitorduz be86730
fix pyupgrade
juanitorduz 4b77c9a
Merge branch 'main' into ruff_linter
maresb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -1,24 +1,20 @@ | ||
[build-system] | ||
requires = [ | ||
"setuptools>=48.0.0", | ||
"cython", | ||
"numpy>=1.17.0", | ||
"versioneer[toml]==0.28", | ||
"setuptools>=48.0.0", | ||
"cython", | ||
"numpy>=1.17.0", | ||
"versioneer[toml]==0.28", | ||
] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "pytensor" | ||
dynamic = [ | ||
'version' | ||
] | ||
dynamic = ['version'] | ||
requires-python = ">=3.9,<3.12" | ||
authors = [ | ||
{name = "pymc-devs", email = "[email protected]"} | ||
] | ||
authors = [{ name = "pymc-devs", email = "[email protected]" }] | ||
description = "Optimizing compiler for evaluating mathematical expressions on CPUs and GPUs." | ||
readme = "README.rst" | ||
license = {file = "LICENSE.txt"} | ||
license = { file = "LICENSE.txt" } | ||
classifiers = [ | ||
"Development Status :: 6 - Mature", | ||
"Intended Audience :: Education", | ||
|
@@ -71,15 +67,8 @@ documentation = "https://pytensor.readthedocs.io/en/latest/" | |
pytensor-cache = "pytensor.bin.pytensor_cache:main" | ||
|
||
[project.optional-dependencies] | ||
complete = [ | ||
"pytensor[jax]", | ||
"pytensor[numba]", | ||
] | ||
development = [ | ||
"pytensor[complete]", | ||
"pytensor[tests]", | ||
"pytensor[rtd]" | ||
] | ||
complete = ["pytensor[jax]", "pytensor[numba]"] | ||
development = ["pytensor[complete]", "pytensor[tests]", "pytensor[rtd]"] | ||
tests = [ | ||
"pytest", | ||
"pre-commit", | ||
|
@@ -88,34 +77,16 @@ tests = [ | |
"pytest-benchmark", | ||
"pytest-mock", | ||
] | ||
rtd = [ | ||
"sphinx>=5.1.0,<6", | ||
"pygments", | ||
"pydot", | ||
"pydot2", | ||
"pydot-ng", | ||
] | ||
jax = [ | ||
"jax", | ||
"jaxlib", | ||
] | ||
numba = [ | ||
"numba>=0.55", | ||
"numba-scipy>=0.3.0" | ||
] | ||
rtd = ["sphinx>=5.1.0,<6", "pygments", "pydot", "pydot2", "pydot-ng"] | ||
jax = ["jax", "jaxlib"] | ||
numba = ["numba>=0.55", "numba-scipy>=0.3.0"] | ||
|
||
[tool.setuptools.packages.find] | ||
include = ["pytensor*", "bin"] | ||
|
||
[tool.setuptools.package-data] | ||
pytensor = [ | ||
"py.typed" | ||
] | ||
"pytensor.d3viz" = [ | ||
"html/*", | ||
"css/*", | ||
"js/*", | ||
] | ||
pytensor = ["py.typed"] | ||
"pytensor.d3viz" = ["html/*", "css/*", "js/*"] | ||
|
||
[tool.coverage.run] | ||
omit = [ | ||
|
@@ -136,14 +107,8 @@ branch = true | |
relative_files = true | ||
|
||
[tool.coverage.report] | ||
omit = [ | ||
"pytensor/_version.py", | ||
"tests/", | ||
] | ||
exclude_lines = [ | ||
"pragma: no cover", | ||
"if TYPE_CHECKING:", | ||
] | ||
omit = ["pytensor/_version.py", "tests/"] | ||
exclude_lines = ["pragma: no cover", "if TYPE_CHECKING:"] | ||
show_missing = true | ||
|
||
[tool.versioneer] | ||
|
@@ -163,41 +128,36 @@ max-line-length = 88 | |
[tool.pylint.messages_control] | ||
disable = ["C0330", "C0326"] | ||
|
||
[tool.isort] | ||
profile = "black" | ||
lines_after_imports = 2 | ||
lines_between_sections = 1 | ||
honor_noqa = true | ||
skip_gitignore = true | ||
skip = "pytensor/version.py" | ||
skip_glob = "**/*.pyx" | ||
|
||
[tool.ruff] | ||
select=["C","E","F","W"] | ||
ignore=["E501","E741","C408","C901"] | ||
exclude = [ | ||
"doc/", | ||
"pytensor/_version.py", | ||
"bin/pytensor_cache.py", | ||
] | ||
select = ["C", "E", "F", "I", "W"] | ||
ignore = ["E501", "E741", "C408", "C901"] | ||
exclude = ["doc/", "pytensor/_version.py", "bin/pytensor_cache.py"] | ||
|
||
|
||
[tool.ruff.isort] | ||
lines-after-imports = 2 | ||
|
||
[tool.ruff.per-file-ignores] | ||
# TODO: Get rid of these: | ||
"**/__init__.py"=["F401","E402","F403"] | ||
"pytensor/tensor/linalg.py"=["F401","F403"] | ||
"pytensor/scalar/basic_scipy.py"=["E402","F403","F401"] | ||
"pytensor/graph/toolbox.py"=["E402","F403","F401"] | ||
"pytensor/link/jax/jax_dispatch.py"=["E402","F403","F401"] | ||
"pytensor/link/jax/jax_linker.py"=["E402","F403","F401"] | ||
"pytensor/sparse/sandbox/sp2.py"=["F401"] | ||
"tests/tensor/test_math_scipy.py"=["E402"] | ||
"tests/sparse/test_basic.py"=["E402"] | ||
"tests/sparse/test_opt.py"=["E402"] | ||
"tests/sparse/test_sp2.py"=["E402"] | ||
"tests/sparse/test_utils.py"=["E402","F401"] | ||
"tests/sparse/sandbox/test_sp.py"=["E402","F401"] | ||
"tests/scalar/test_basic_sympy.py"=["E402"] | ||
"pytensor/graph/rewriting/unify.py"=["F811"] | ||
"**/__init__.py" = ["F401", "E402", "F403"] | ||
"pytensor/tensor/linalg.py" = ["F401", "F403"] | ||
"pytensor/scalar/basic_scipy.py" = ["E402"] | ||
"pytensor/graph/toolbox.py" = ["E402"] | ||
# For the tests we skip because `pytest.importorskip` is used: | ||
"tests/link/jax/test_scalar.py" = ["E402"] | ||
"tests/link/jax/test_tensor_basic.py" = ["E402"] | ||
"tests/link/numba/test_basic.py" = ["E402"] | ||
"tests/link/numba/test_cython_support.py" = ["E402"] | ||
"tests/link/numba/test_performance.py" = ["E402"] | ||
"tests/link/numba/test_sparse.py" = ["E402"] | ||
"tests/link/numba/test_tensor_basic.py" = ["E402"] | ||
"tests/tensor/test_math_scipy.py" = ["E402"] | ||
"tests/sparse/test_basic.py" = ["E402"] | ||
"tests/sparse/test_sp2.py" = ["E402"] | ||
"tests/sparse/test_utils.py" = ["E402"] | ||
"tests/sparse/sandbox/test_sp.py" = ["E402", "F401"] | ||
"versioneer.py" = ["I"] | ||
|
||
|
||
[tool.mypy] | ||
|
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.