-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* uv add --dev coverage * Fix coverage report config * Add Makefile * Add CONTRIBUTING.md
- Loading branch information
1 parent
e08de50
commit e435e27
Showing
4 changed files
with
68 additions
and
1 deletion.
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,10 @@ | ||
# Contributing to magentic | ||
|
||
1. Fork and clone the repository | ||
2. [Install uv](https://docs.astral.sh/uv/getting-started/installation/) | ||
3. [Install pre-commit](https://pre-commit.com/#install) | ||
4. Run `make install` to install dependencies | ||
5. Run `make test` to run unit tests | ||
6. Run `make format` to format code | ||
7. Run `make lint` to lint code | ||
8. run `make docs` to build docs and `make docs-serve` to serve docs locally |
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,50 @@ | ||
# Adapted from https://github.com/pydantic/logfire/blob/main/Makefile | ||
|
||
.DEFAULT_GOAL := all | ||
|
||
.PHONY: .uv # Check that uv is installed | ||
.uv: | ||
@uv --version || echo 'Please install uv: https://docs.astral.sh/uv/getting-started/installation/' | ||
|
||
.PHONY: .pre-commit # Check that pre-commit is installed | ||
.pre-commit: | ||
@pre-commit -V || echo 'Please install pre-commit: https://pre-commit.com/' | ||
|
||
.PHONY: install # Install the package, dependencies, and pre-commit for local development | ||
install: .uv .pre-commit | ||
uv sync --frozen | ||
pre-commit install --install-hooks | ||
|
||
.PHONY: format # Format the code | ||
format: | ||
uv run ruff format | ||
uv run ruff check --fix | ||
|
||
.PHONY: lint # Lint the code | ||
lint: | ||
uv run ruff check | ||
uv run ruff format --check --diff | ||
|
||
.PHONY: typecheck # Typecheck the code | ||
typecheck: | ||
uv run mypy . | ||
|
||
.PHONY: test # Run the tests | ||
test: | ||
uv run pytest -vv | ||
|
||
.PHONY: testcov # Run tests and generate a coverage report | ||
testcov: test | ||
@echo "building coverage html" | ||
uv run coverage html --show-contexts | ||
|
||
.PHONY: docs # Build the documentation | ||
docs: | ||
uv run mkdocs build | ||
|
||
.PHONY: docs-serve # Build and serve the documentation | ||
docs-serve: | ||
uv run mkdocs serve | ||
|
||
.PHONY: all | ||
all: format lint test |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.