-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
100 additions
and
2 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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024, Arcade AI | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,53 @@ | ||
.PHONY: help | ||
|
||
help: | ||
@echo "π οΈ math Commands:\n" | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | ||
|
||
.PHONY: install | ||
install: ## Install the poetry environment and install the pre-commit hooks | ||
@echo "π¦ Checking if Poetry is installed" | ||
@if ! command -v poetry &> /dev/null; then \ | ||
echo "π¦ Installing Poetry with pip"; \ | ||
pip install poetry; \ | ||
else \ | ||
echo "π¦ Poetry is already installed"; \ | ||
fi | ||
@echo "π Installing package in development mode with all extras" | ||
poetry install --all-extras | ||
|
||
.PHONY: build | ||
build: clean-build ## Build wheel file using poetry | ||
@echo "π Creating wheel file" | ||
poetry build | ||
|
||
.PHONY: clean-build | ||
clean-build: ## clean build artifacts | ||
@echo "ποΈ Cleaning dist directory" | ||
rm -rf dist | ||
|
||
.PHONY: test | ||
test: ## Test the code with pytest | ||
@echo "π Testing code: Running pytest" | ||
@poetry run pytest -W ignore -v --cov --cov-config=pyproject.toml --cov-report=xml | ||
|
||
.PHONY: coverage | ||
coverage: ## Generate coverage report | ||
@echo "coverage report" | ||
coverage report | ||
@echo "Generating coverage report" | ||
coverage html | ||
|
||
.PHONY: bump-version | ||
bump-version: ## Bump the version in the pyproject.toml file | ||
@echo "π Bumping version in pyproject.toml" | ||
poetry version patch | ||
|
||
.PHONY: check | ||
check: ## Run code quality tools. | ||
@echo "π Checking Poetry lock file consistency with 'pyproject.toml': Running poetry check --lock" | ||
@poetry check --lock | ||
@echo "π Linting code: Running pre-commit" | ||
@poetry run pre-commit run -a | ||
@echo "π Static type checking: Running mypy" | ||
@poetry run mypy --config-file=pyproject.toml |
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,17 +1,41 @@ | ||
[tool.poetry] | ||
name = "arcade_math" | ||
version = "0.0.13" | ||
version = "0.1.7" | ||
description = "Math toolkit for Arcade" | ||
authors = ["Arcade AI <[email protected]>"] | ||
|
||
|
||
[tool.poetry.dependencies] | ||
python = "^3.10" | ||
arcade-ai = "0.1.*" | ||
|
||
[tool.poetry.dev-dependencies] | ||
pytest = "^8.3.0" | ||
pytest-cov = "^4.0.0" | ||
pytest-asyncio = "^0.24.0" | ||
pytest-mock = "^3.11.1" | ||
mypy = "^1.5.1" | ||
pre-commit = "^3.4.0" | ||
tox = "^4.11.1" | ||
ruff = "^0.7.4" | ||
|
||
[build-system] | ||
requires = ["poetry-core>=1.0.0"] | ||
build-backend = "poetry.core.masonry.api" | ||
|
||
[tool.mypy] | ||
files = ["arcade_math/**/*.py"] | ||
python_version = "3.10" | ||
disallow_untyped_defs = "True" | ||
disallow_any_unimported = "True" | ||
no_implicit_optional = "True" | ||
check_untyped_defs = "True" | ||
warn_return_any = "True" | ||
warn_unused_ignores = "True" | ||
show_error_codes = "True" | ||
ignore_missing_imports = "True" | ||
|
||
[tool.pytest.ini_options] | ||
testpaths = ["tests"] | ||
|
||
[tool.coverage.report] | ||
skip_empty = true |