-
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.
- Use ruff for linting - Update tox.ini and pyproject.toml configurations - Update .pre-commit-config.yaml - Update Makefile - Update dependencies, use requirements/dev.in and requirements/main.in instead - Update github actions
- Loading branch information
Showing
15 changed files
with
2,641 additions
and
244 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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,36 +1,14 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
rev: v4.6.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: check-yaml | ||
- id: check-toml | ||
- id: check-yaml | ||
- id: trailing-whitespace | ||
|
||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.13.2 | ||
hooks: | ||
- id: isort | ||
additional_dependencies: [toml] | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 24.1.1 | ||
hooks: | ||
- id: black | ||
|
||
- repo: https://github.com/asottile/blacken-docs | ||
rev: v1.12.1 | ||
hooks: | ||
- id: blacken-docs | ||
additional_dependencies: [black==23.3.0] | ||
args: [-l, '79', -t, py38] | ||
|
||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 7.0.0 | ||
hooks: | ||
- id: flake8 | ||
|
||
- repo: https://github.com/PyCQA/pydocstyle | ||
rev: 6.3.0 | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.4.6 | ||
hooks: | ||
- id: pydocstyle | ||
additional_dependencies: [tomli] | ||
- id: ruff | ||
args: [--fix, --exit-non-zero-on-fix] | ||
- id: ruff-format |
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,29 +1,48 @@ | ||
.PHONY: help | ||
help: | ||
@echo "Make targets for sasquatch-backpack:" | ||
@echo "make clean - Remove generated files" | ||
@echo "make init - Set up dev environment (install pre-commit hooks)" | ||
@echo "make linkcheck - Check for broken links in documentation" | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -rf .tox | ||
rm -rf docs/_build | ||
rm -rf docs/api | ||
@echo "Make targets for example" | ||
@echo "make init - Set up dev environment" | ||
@echo "make run - Start a local development instance" | ||
@echo "make update - Update pinned dependencies and run make init" | ||
@echo "make update-deps - Update pinned dependencies" | ||
@echo "make update-deps-no-hashes - Pin dependencies without hashes" | ||
|
||
.PHONY: init | ||
init: | ||
pip install --upgrade pip tox pre-commit | ||
pip install --upgrade -e ".[dev]" | ||
pre-commit install | ||
pip install --upgrade uv | ||
uv pip install -r requirements/main.txt -r requirements/dev.txt \ | ||
-r requirements/tox.txt | ||
uv pip install --editable . | ||
rm -rf .tox | ||
uv pip install --upgrade pre-commit | ||
pre-commit install | ||
|
||
.PHONY: run | ||
run: | ||
tox run -e run | ||
|
||
.PHONY: update | ||
update: update-deps init | ||
|
||
.PHONY: update-deps | ||
update-deps: | ||
pip install --upgrade uv | ||
uv pip install --upgrade pre-commit | ||
pre-commit autoupdate | ||
uv pip compile --upgrade --generate-hashes \ | ||
--output-file requirements/main.txt requirements/main.in | ||
uv pip compile --upgrade --generate-hashes \ | ||
--output-file requirements/dev.txt requirements/dev.in | ||
uv pip compile --upgrade --generate-hashes \ | ||
--output-file requirements/tox.txt requirements/tox.in | ||
|
||
# This is defined as a Makefile target instead of only a tox command because | ||
# if the command fails we want to cat output.txt, which contains the | ||
# actually useful linkcheck output. tox unfortunately doesn't support this | ||
# level of shell trickery after failed commands. | ||
.PHONY: linkcheck | ||
linkcheck: | ||
sphinx-build --keep-going -n -W -T -b linkcheck docs \ | ||
docs/_build/linkcheck \ | ||
|| (cat docs/_build/linkcheck/output.txt; exit 1) | ||
# Useful for testing against a Git version of Safir. | ||
.PHONY: update-deps-no-hashes | ||
update-deps-no-hashes: | ||
pip install --upgrade uv | ||
uv pip compile --upgrade \ | ||
--output-file requirements/main.txt requirements/main.in | ||
uv pip compile --upgrade \ | ||
--output-file requirements/dev.txt requirements/dev.in | ||
uv pip compile --upgrade \ | ||
--output-file requirements/tox.txt requirements/tox.in |
Oops, something went wrong.