-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to ruff; fail on all warnings
- Loading branch information
1 parent
f925708
commit 2fb3b07
Showing
12 changed files
with
177 additions
and
164 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: pytest | ||
name: Test | ||
|
||
on: | ||
push: | ||
|
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,127 @@ | ||
[project] | ||
name = "recursive_diff" | ||
authors = [{name = "Guido Imperiale", email = "[email protected]"}] | ||
license = {text = "Apache"} | ||
description = "Recursively compare two Python data structures" | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Intended Audience :: Science/Research", | ||
"Topic :: Scientific/Engineering", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
] | ||
requires-python = ">=3.8" | ||
dependencies = [ | ||
"numpy >= 1.16", | ||
"pandas >= 0.25", | ||
"xarray >= 0.12", | ||
] | ||
dynamic = ["version"] | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/crusaderky/recursive_diff" | ||
|
||
[project.scripts] | ||
ncdiff = "recursive_diff.ncdiff:main" | ||
|
||
[tool.setuptools] | ||
packages = ["recursive_diff"] | ||
zip-safe = false # https://mypy.readthedocs.io/en/latest/installed_packages.html | ||
include-package-data = true | ||
|
||
[tool.setuptools_scm] | ||
# Use hardcoded version when .git has been removed and this is not a package created | ||
# by sdist. This is the case e.g. of a remote deployment with PyCharm. | ||
fallback_version = "9999" | ||
|
||
[tool.setuptools.package-data] | ||
recursive_diff = ["py.typed"] | ||
|
||
[build-system] | ||
requires = [ | ||
"setuptools>=66", | ||
"setuptools_scm[toml]", | ||
] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.pytest.ini_options] | ||
addopts = "--strict-markers --strict-config -v -r sxfE --color=yes" | ||
xfail_strict = true | ||
python_files = ["test_*.py"] | ||
testpaths = ["recursive_diff/tests"] | ||
filterwarnings = [ | ||
"error", | ||
# Raised internally by pandas | ||
'ignore:datetime.datetime.utcfromtimestamp\(\) is deprecated:DeprecationWarning', | ||
# numpy <1.26 only | ||
'ignore:elementwise comparison failed:DeprecationWarning', | ||
'ignore:elementwise comparison failed:FutureWarning', | ||
'ignore:invalid value encountered in cast:RuntimeWarning', | ||
# Deprecations in proper_unstack | ||
# FIXME https://github.com/crusaderky/xarray_extras/issues/33 | ||
'ignore:the `pandas.MultiIndex` object.* will no longer be implicitly promoted:FutureWarning', | ||
'ignore:updating coordinate .* with a PandasMultiIndex:FutureWarning', | ||
'ignore:Updating MultiIndexed coordinate .* would corrupt indices:FutureWarning', | ||
] | ||
|
||
[tool.coverage.report] | ||
show_missing = true | ||
exclude_lines = [ | ||
"pragma: nocover", | ||
"pragma: no cover", | ||
"TYPE_CHECKING", | ||
"except ImportError", | ||
"@overload", | ||
'@(abc\.)?abstractmethod', | ||
] | ||
|
||
[tool.ruff] | ||
builtins = ["ellipsis"] | ||
exclude = [".eggs"] | ||
target-version = "py38" | ||
|
||
[tool.ruff.lint] | ||
ignore = [ | ||
"E402", # module level import not at top of file | ||
"SIM108", # use ternary operator instead of if-else block | ||
"N999", # Invalid module name: 'TEMPLATE' TODO remove this line | ||
] | ||
select = [ | ||
"F", # Pyflakes | ||
"B", # flake8-bugbear | ||
"C4", # flake8-comprehensions | ||
"ISC", # flake8-implicit-str-concat | ||
"SIM", # flake8-simplify | ||
"E", # Pycodestyle | ||
"W", # Pycodestyle | ||
"I", # isort | ||
"N", # pep8-naming | ||
"UP", # Pyupgrade | ||
"RUF", # unused-noqa | ||
"EXE001", # Shebang is present but file is not executable | ||
] | ||
|
||
[tool.ruff.lint.isort] | ||
known-first-party = ["TEMPLATE"] | ||
|
||
[tool.mypy] | ||
allow_incomplete_defs = false | ||
allow_untyped_decorators = false | ||
allow_untyped_defs = false | ||
ignore_missing_imports = true | ||
no_implicit_optional = true | ||
show_error_codes = true | ||
warn_redundant_casts = true | ||
warn_unused_ignores = true | ||
warn_unreachable = true | ||
|
||
[[tool.mypy.overrides]] | ||
module = ["*.tests.*"] | ||
allow_untyped_defs = true |
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.