-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from NHFLO/actions
Actions
- Loading branch information
Showing
13 changed files
with
171 additions
and
100 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Tools repository | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint: | ||
name: Lint python files | ||
runs-on: ubuntu-latest | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | ||
cancel-in-progress: true | ||
strategy: | ||
fail-fast: false | ||
env: | ||
HATCH_VERBOSE: 1 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: "pyproject.toml" | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v3 | ||
- name: Install hatch | ||
run: uv tool install hatch | ||
- name: Lint Python files | ||
run: hatch run lintformat:lintminimal |
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 |
---|---|---|
|
@@ -45,29 +45,32 @@ license = { file = "LICENSE.txt" } | |
maintainers = [{ name = "Bas des Tombe", email = "[email protected]" }] | ||
name = "nhflotools" | ||
readme = "README.md" | ||
requires-python = ">=3.9, <3.12" | ||
requires-python = "==3.11" | ||
|
||
[project.optional-dependencies] | ||
dev = ["hatch", "pytest", "ruff"] | ||
lintformat = [ | ||
"hatch", | ||
"ruff==0.6.8", | ||
] | ||
|
||
[tool.hatch.envs.default] | ||
features = ["dev"] | ||
|
||
[tool.hatch.envs.default.scripts] | ||
fast-test = ["pytest ./tests/ -m \"not slow\""] | ||
format = ["ruff check --fix .", "ruff format ."] | ||
lint = ["ruff check ."] | ||
test = ["pytest ./src/ ./tests/"] # --doctest-modules | ||
|
||
[tool.hatch.envs.matrix_test] | ||
features = ["dev"] | ||
installer = "uv" | ||
python = "3.11" | ||
|
||
[[tool.hatch.envs.matrix_test.matrix]] | ||
python = ["3.10", "3.11", "3.9"] | ||
[tool.hatch.envs.lintformat] | ||
detached = true | ||
features = ["lintformat"] | ||
|
||
[tool.hatch.envs.matrix_test.scripts] | ||
test = ["pytest ./tests/"] # --doctest-modules | ||
[tool.hatch.envs.lintformat.scripts] | ||
format = [ | ||
"ruff check --fix --unsafe-fixes src/nhflotools/*.py tests", | ||
"ruff format src/nhflotools/*.py tests" | ||
] | ||
lint = [ | ||
"ruff check tests/test_pwnlayers.py src/nhflotools/pwnlayers src/nhflotools/major_surface_waters.py src/nhflotools/nhi_chloride.py src/nhflotools/panden.py src/nhflotools/polder.py src/nhflotools/well.py" | ||
] | ||
lintminimal = ["ruff check src/nhflotools/pwnlayers src/nhflotools/major_surface_waters.py src/nhflotools/nhi_chloride.py src/nhflotools/panden.py src/nhflotools/polder.py src/nhflotools/well.py --config \"lint.select=['E4', 'E7', 'E9', 'F']\""] | ||
|
||
[tool.pytest.ini_options] | ||
markers = ["slow: marks tests as slow (deselect with '-m \"not slow\"')"] | ||
testpaths = ["tests"] |
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.