-
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 #33 from MartinBernstorff/mbern_update_cruft
ci: update cruft
- Loading branch information
Showing
11 changed files
with
88 additions
and
40 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 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 |
---|---|---|
|
@@ -40,4 +40,4 @@ jobs: | |
push: filter | ||
refFilterForPush: refs/heads/main | ||
runCmd: | ||
make validate | ||
make validate_ci |
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 |
---|---|---|
|
@@ -9,7 +9,8 @@ __pycache__/ | |
_build/ | ||
.tox | ||
|
||
# | ||
# Coverage | ||
**/.coverage* | ||
|
||
# VSCode | ||
.vscode/ | ||
|
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,43 +1,88 @@ | ||
SRC_PATH = functionalpy | ||
MAKEFLAGS = --no-print-directory | ||
|
||
install-dev: | ||
pip install --upgrade -r dev-requirements.txt | ||
@pip install --upgrade -r dev-requirements.txt | ||
|
||
install-deps: | ||
pip install --upgrade -r requirements.txt | ||
@pip install --upgrade -r requirements.txt | ||
|
||
install: | ||
make install-deps | ||
make install-dev | ||
pip install -e . | ||
@make install-deps | ||
@make install-dev | ||
@pip install -e . | ||
|
||
# Tasks | ||
generate_coverage: | ||
@pytest --cov=$(SRC_PATH) $(SRC_PATH) --cov-report xml:.coverage.xml --cov-report lcov:.coverage.lcov | ||
|
||
test: ## Run tests | ||
pytest $(SRC_PATH) | ||
@echo "––– Testing –––" | ||
@make generate_coverage | ||
@diff-cover .coverage.xml --fail-under=80 | ||
@echo "✅✅✅ Tests passed ✅✅✅" | ||
|
||
lint: ## Format code | ||
ruff check . --fix | ||
ruff format . | ||
@echo "––– Linting –––" | ||
@ruff format . | ||
@ruff . --fix \ | ||
--extend-select F401 \ | ||
--extend-select F841 | ||
@echo "✅✅✅ Lint ✅✅✅" | ||
|
||
type-check: ## Type-check code | ||
pyright $(SRC_PATH) | ||
types: ## Type-check code | ||
@echo "––– Type-checking –––" | ||
@pyright $(SRC_PATH) | ||
@echo "✅✅✅ Types ✅✅✅" | ||
|
||
validate: ## Run all checks | ||
make lint | ||
make type-check | ||
make test | ||
@echo "––– Running all checks –––" | ||
@make lint | ||
@make types | ||
@make test | ||
|
||
validate_ci: ## Run all checks | ||
@echo "––– Running all checks –––" | ||
@make lint | ||
@make types | ||
## CI doesn't support local coverage report, so skipping full tests | ||
@make generate_coverage | ||
|
||
sync-pr: | ||
git push --set-upstream origin HEAD | ||
git push | ||
# PR management | ||
merge-main: | ||
@echo "––– Merging main –––" | ||
@git fetch | ||
@git merge --no-edit origin/main | ||
|
||
push: | ||
@echo "––– Pushing to origin/main –––" | ||
@git push --set-upstream origin HEAD | ||
@git push | ||
create-pr: | ||
gh pr create -w || true | ||
@echo "––– Creating PR –––" | ||
@gh pr create --title "$$(git rev-parse --abbrev-ref HEAD | tr -d '[:digit:]' | tr '-' ' ')" --body "Auto-created" || true | ||
|
||
enable-automerge: | ||
@gh pr merge --auto --merge --delete-branch | ||
|
||
merge-pr: | ||
gh pr merge --auto --merge --delete-branch | ||
pr-status: | ||
@gh pr view | cat | grep "title" | ||
@gh pr view | cat | grep "url" | ||
@echo "✅✅✅ PR created ✅✅✅" | ||
|
||
################ | ||
# Compositions # | ||
################ | ||
setup-pr: ## Update everything and setup the PR | ||
@make merge-main | ||
@make push | ||
@make create-pr | ||
|
||
finalise-pr: | ||
@make enable-automerge | ||
@make pr-status | ||
|
||
pr: ## Run relevant tests before PR | ||
make sync-pr | ||
make create-pr | ||
make validate | ||
make merge-pr | ||
@make setup-pr | ||
@make validate | ||
@make finalise-pr |
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,4 +1,8 @@ | ||
pytest==7.4.3 | ||
ruff==0.1.6 | ||
cruft==2.15.0 | ||
pyright==1.1.336 | ||
cruft==2.15.0 | ||
pytest==7.4.3 | ||
pytest-cov==4.1.0 | ||
pytest-xdist==3.5.0 | ||
pytest-sugar==0.9.7 | ||
diff-cover==8.0.1 | ||
ruff==0.1.6 |
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 +1 @@ | ||
from ._sequence import Seq, Group # noqa: F401 | ||
from ._sequence import Seq, Group # noqa: F401 # type: ignore |
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
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,5 +1,3 @@ | ||
from cgi import test | ||
|
||
from functionalpy._sequence import Seq | ||
|
||
|
||
|