Skip to content

Commit

Permalink
Move most setup.cfg configs to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvothecoder committed Oct 26, 2023
1 parent b89d759 commit b1f4e22
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ repos:
hooks:
- id: isort


# =======================
# Python linting
# =======================
Expand Down
26 changes: 25 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.black]
line-length = 88
target-version = ['py36']
target-version = ['py39']
include = '\.pyi?$'
exclude = '''
(
Expand All @@ -21,3 +21,27 @@ exclude = '''
)/
)
'''

[tool.isort]
# Docs: https://pycqa.github.io/isort/docs/configuration/options.html#example-pyprojecttoml_4
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
line_length = 88

[tool.pytest.ini_options]
# Docs: https://docs.pytest.org/en/7.2.x/reference/customize.html#configuration
junit_family = "xunit2"
addopts = "--cov=pcmdi_metrics --cov-report term --cov-report html:tests_coverage_reports/htmlcov --cov-report xml:tests_coverage_reports/coverage.xml -s --ignore tests/deprecated"
python_files = ["tests.py", "test_*.py"]


[tool.mypy]
# Docs: https://mypy.readthedocs.io/en/stable/config_file.html
python_version = 3.10
check_untyped_defs = true
ignore_missing_imports = true
warn_unused_ignores = true
warn_redundant_casts = true
warn_unused_configs = true
25 changes: 1 addition & 24 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[flake8]
# https://pep8.readthedocs.io/en/latest/intro.html#error-codes
# flake8 dooes not support pyproject.toml yet: https://github.com/PyCQA/flake8/issues/234
ignore =
# whitespace before ‘:’
E203
Expand Down Expand Up @@ -31,31 +32,7 @@ exclude =
*json
*md

[isort]
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=0
use_parentheses=True
line_length=88

[pycodestyle]
max-line-length = 119
exclude =
.tox
.git
*/migrations/*
*/static/CACHE/*
docs
node_modules
.idea
.mypy_cache
.pytest_cache
*__init__.py
venv

[aliases]
# Define setup.py command aliases here
test = pytest

[tool:pytest]
junit_family = xunit2
Expand Down

0 comments on commit b1f4e22

Please sign in to comment.