Skip to content

Commit

Permalink
feat: add makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBernstorff committed Oct 25, 2023
1 parent b826de4 commit 035307c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 59 deletions.
35 changes: 0 additions & 35 deletions .github/workflows/release.yml

This file was deleted.

52 changes: 28 additions & 24 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
lint:
@echo Running black
black .
install-dev:
pip install -r dev-requirements.txt

@echo Running ruff
ruff check . --fix
install-deps:
pip install -r requirements.txt

test:
@echo ––– Testing –––
pytest -n auto -rfE --failed-first --disable-warnings -q
install:
make install-deps
pip install -e .

type-check:
@echo ––– Running static type checks –––
pyright .
test: ## Run tests
pytest {{cookiecutter.package_name}}

install:
pip install --upgrade -e .[dev,tests]

validate:
@echo ––– Ensuring dependencies are up to date. This will take a few moments ---
@make install > /dev/null
@make lint && make type-check && make test

pr:
gh pr create -w
make validate
git push
gh pr merge --auto --merge
lint: ## Format code
ruff check {{cookiecutter.package_name}} --fix
ruff format {{cookiecutter.package_name}}

type-check: ## Type-check code
pyright {{cookiecutter.package_name}}

validate: ## Run all checks
make lint
make type-check
make test

create-and-merge-pr:
gh pr create -w || true
gh pr merge --auto --merge --delete-branch

pr: ## Run relevant tests before PR
make create-and-merge-pr
make validate

0 comments on commit 035307c

Please sign in to comment.