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

Fix style checks for coffea-casa repo #289

Merged
merged 7 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
72 changes: 72 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: debug-statements
- id: double-quote-string-fixer
- id: name-tests-test
- id: requirements-txt-fixer
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.20.1
hooks:
- id: setup-cfg-fmt
- repo: https://github.com/asottile/reorder_python_imports
rev: v3.1.0
hooks:
- id: reorder-python-imports
exclude: ^(pre_commit/resources/|testing/resources/python3_hooks_repo/)
args: [--py37-plus, --add-import, 'from __future__ import annotations']
- repo: https://github.com/asottile/add-trailing-comma
rev: v2.2.3
hooks:
- id: add-trailing-comma
args: [--py36-plus]
- repo: https://github.com/asottile/pyupgrade
rev: v2.32.1
hooks:
- id: pyupgrade
args: [--py37-plus]
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v1.6.0
hooks:
- id: autopep8
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
hooks:
- id: flake8
additional_dependencies: [flake8-bugbear, flake8-import-order, flake8-print]
- repo: https://github.com/psf/black
rev: stable
hooks:
- id: black

- repo: https://github.com/asottile/blacken-docs
rev: v1.12.1
hooks:
- id: blacken-docs
- repo: https://github.com/pycqa/isort
rev: 5.6.4
hooks:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
hooks:
- id: codespell
args: ["-L", "coffea_casa", "tests", "docs/*rst"]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.942
hooks:
- id: mypy
name: mypy with Python 3.7
files: coffea_casa
additional_dependencies: ["dask", "distributed"]
args: ["--python-version=3.7"]
- id: mypy
name: mypy with Python 3.9
files: coffea_casa
additional_dependencies: ["dask", "distributed"]
args: ["--python-version=3.9"]
15 changes: 8 additions & 7 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
version: 2

build:
image: latest

sphinx:
configuration: docs/conf.py

formats: all
os: ubuntu-22.04
tools:
python: "3.11"

python:
version: 3.8
install:
- method: pip
path: .
extra_requirements:
- docs

sphinx:
configuration: docs/conf.py

formats: all
47 changes: 47 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[build-system]
requires = ["setuptools>=42"]
build-backend = "setuptools.build_meta"

[tool.black]
target-version = ['py37', 'py38', 'py39']
include = '\.pyi?$'
exclude = '''
/(
\.git
| .eggs
| build
)/
'''

[tool.mypy]
files = "coffea_casa"
pretty = true
strict = true
strict_equality = true
python_version = "3.7"
disallow_untyped_calls = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
disallow_untyped_decorators = true
check_untyped_defs = true
disallow_any_generics = true
disallow_subclassing_any = true
warn_return_any = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_unused_configs = true
warn_unreachable = true
show_error_codes = true
show_error_context = true
no_implicit_optional = true
ignore_missing_imports = true
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]

# pyproject.toml
[tool.pytest.ini_options]
minversion = "6.0"
testpaths = [
"tests",]
log_cli_level = "INFO"
xfail_strict = true
filterwarnings = ['error']
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ ignore =
E741,
# Too long lines (still not ready for it)
E501
# extend-ignore uses flake8's default ignore list, and adds to it
extend-ignore = E203, E501
max-line-length = 120

[versioneer]
Expand Down
Loading