Skip to content

Commit

Permalink
Fix precommit config and hatch setup
Browse files Browse the repository at this point in the history
  • Loading branch information
mcarans committed Feb 26, 2024
1 parent 573ab47 commit 43fe444
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 53 deletions.
2 changes: 0 additions & 2 deletions .config/black.toml

This file was deleted.

19 changes: 9 additions & 10 deletions .config/pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,22 @@ default_language_version:
python: python3.11
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-ast
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
args: [--config, .config/black.toml]
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.267
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.14
hooks:
# Run the linter.
- id: ruff
args: [--config, .config/ruff.toml, --fix, --exit-non-zero-on-fix]
args: [--config, .config/ruff.toml, --fix]
# Run the formatter.
- id: ruff-format
args: [--config, .config/ruff.toml]
- repo: https://github.com/jazzband/pip-tools
rev: 6.13.0
rev: 7.3.0
hooks:
- id: pip-compile
name: pip-compile requirements.txt
Expand Down
13 changes: 8 additions & 5 deletions .config/ruff.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
line-length = 79
exclude = ["_version.py"]
ignore = [
"E501" # Line too long
]
# List of rules: https://beta.ruff.rs/docs/rules/

[lint]
# List of rules: https://docs.astral.sh/ruff/rules/
select = [
"E", # pycodestyle - default
"F", # pyflakes - default
"I" # isort
]
ignore = [
"E501" # Line too long
]


[isort]
[lint.isort]
known-local-folder = ["hdx"]
16 changes: 4 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,14 @@ test = """
"""

[[tool.hatch.envs.test.matrix]]
python = ["3.12"]
python = ["3.11"]

[tool.hatch.envs.lint]
detached = true
dependencies = [
"black",
"ruff",
]
dependencies = ["ruff"]

[tool.hatch.envs.lint.scripts]
style = [
"ruff --config .config/ruff.toml {args:.}",
"black --config .config/black.toml --check --diff {args:.}",
]
# Not used for anything at the moment
fmt = [
"black --config .config/black.toml {args:.}",
"ruff --config .config/ruff.toml --fix {args:.}",
"ruff check --config .config/ruff.toml --diff {args:.}",
"ruff format --config .config/ruff.toml --diff {args:.}",
]
47 changes: 23 additions & 24 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ attrs==23.2.0
# frictionless
# jsonlines
# jsonschema
certifi==2023.11.17
certifi==2024.2.2
# via requests
cfgv==3.4.0
# via pre-commit
Expand All @@ -23,21 +23,21 @@ click==8.1.7
# via typer
colorama==0.4.6
# via typer
coverage[toml]==7.4.0
coverage[toml]==7.4.3
# via pytest-cov
distlib==0.3.8
# via virtualenv
et-xmlfile==1.1.0
# via openpyxl
filelock==3.13.1
# via virtualenv
frictionless==5.16.0
frictionless==5.16.1
# via hdx-python-utilities
hdx-python-utilities==3.6.4
hdx-python-utilities==3.6.5
# via hdx-python-country (pyproject.toml)
humanize==4.9.0
# via frictionless
identify==2.5.33
identify==2.5.35
# via pre-commit
idna==3.6
# via requests
Expand All @@ -51,21 +51,21 @@ jinja2==3.1.3
# via frictionless
jsonlines==4.0.0
# via hdx-python-utilities
jsonpath-ng==1.6.0
jsonpath-ng==1.6.1
# via libhxl
jsonschema==4.17.3
# via
# frictionless
# tableschema-to-template
libhxl==5.2
libhxl==5.2.1
# via hdx-python-country (pyproject.toml)
loguru==0.7.2
# via hdx-python-utilities
markdown-it-py==3.0.0
# via rich
marko==2.0.2
marko==2.0.3
# via frictionless
markupsafe==2.1.3
markupsafe==2.1.5
# via jinja2
mdurl==0.1.2
# via markdown-it-py
Expand All @@ -77,27 +77,27 @@ packaging==23.2
# via pytest
petl==1.7.14
# via frictionless
platformdirs==4.1.0
platformdirs==4.2.0
# via virtualenv
pluggy==1.3.0
pluggy==1.4.0
# via pytest
ply==3.11
# via
# jsonpath-ng
# libhxl
pre-commit==3.6.0
pre-commit==3.6.2
# via hdx-python-country (pyproject.toml)
pydantic==2.5.3
pydantic==2.6.2
# via frictionless
pydantic-core==2.14.6
pydantic-core==2.16.3
# via pydantic
pygments==2.17.2
# via rich
pyphonetics==0.5.3
# via hdx-python-country (pyproject.toml)
pyrsistent==0.20.0
# via jsonschema
pytest==7.4.4
pytest==8.0.2
# via
# hdx-python-country (pyproject.toml)
# pytest-cov
Expand All @@ -110,7 +110,7 @@ python-dateutil==2.8.2
# libhxl
python-io-wrapper==0.3.1
# via libhxl
python-slugify==8.0.1
python-slugify==8.0.4
# via frictionless
pyyaml==6.0.1
# via
Expand All @@ -124,13 +124,13 @@ requests==2.31.0
# frictionless
# libhxl
# requests-file
requests-file==1.5.1
requests-file==2.0.0
# via hdx-python-utilities
rfc3986==2.0.0
# via frictionless
rich==13.7.0
# via typer
ruamel-yaml==0.18.5
ruamel-yaml==0.18.6
# via hdx-python-utilities
ruamel-yaml-clib==0.2.8
# via ruamel-yaml
Expand All @@ -142,7 +142,6 @@ six==1.16.0
# via
# isodate
# python-dateutil
# requests-file
stringcase==1.2.0
# via frictionless
structlog==24.1.0
Expand All @@ -155,31 +154,31 @@ text-unidecode==1.3
# via python-slugify
typer[all]==0.9.0
# via frictionless
typing-extensions==4.9.0
typing-extensions==4.10.0
# via
# frictionless
# pydantic
# pydantic-core
# typer
unidecode==1.3.7
unidecode==1.3.8
# via
# libhxl
# pyphonetics
urllib3==2.1.0
urllib3==2.2.1
# via
# libhxl
# requests
validators==0.22.0
# via frictionless
virtualenv==20.25.0
virtualenv==20.25.1
# via pre-commit
wheel==0.42.0
# via libhxl
xlrd==2.0.1
# via hdx-python-utilities
xlrd3==1.1.0
# via libhxl
xlsxwriter==3.1.9
xlsxwriter==3.2.0
# via tableschema-to-template
xlwt==1.3.0
# via hdx-python-utilities
Expand Down

0 comments on commit 43fe444

Please sign in to comment.