-
Notifications
You must be signed in to change notification settings - Fork 3
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
1 parent
eb615ea
commit b74523a
Showing
4 changed files
with
797 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
version: '3' | ||
run: once | ||
|
||
vars: | ||
VERSION: | ||
sh: poetry version --short | ||
PYTHON: | ||
sh: git ls-files "*.py" | ||
YAML: | ||
sh: git ls-files "*.yaml" | ||
TEST: | ||
sh: git ls-files "openfisca_extension_template/tests/*.yaml" | ||
|
||
tasks: | ||
default: | ||
aliases: [all] | ||
deps: | ||
- task: clean | ||
- task: lint | ||
- task: test | ||
|
||
uninstall: | ||
desc: Uninstall this library and all of its dependencies. | ||
cmds: | ||
- poetry env remove --all | ||
- pip freeze | grep -v "^-e" | sed "s/@.*//" | xargs pip uninstall -y | ||
|
||
install: | ||
desc: Install this library and all of its dependencies. | ||
cmds: | ||
- poetry install --all-extras --sync | ||
|
||
build: | ||
desc: Build the library. | ||
deps: | ||
- task: clean | ||
cmds: | ||
- poetry build | ||
|
||
install-build: | ||
desc: Install the library from the distribution file. | ||
cmds: | ||
- pip install --find-links . openfisca_extension_template | ||
|
||
install-build-dev: | ||
desc: Install the library from the distribution file with dev extras. | ||
cmds: | ||
- pip install --find-links . openfisca_extension_template[dev] | ||
|
||
clean: | ||
desc: Remove all of the build files. | ||
cmds: | ||
- rm -rf build dist | ||
- find . -name "*.pyc" -exec rm \{\} \; | ||
- find . -type d -name "__pycache__" -exec rm -r {} + | ||
|
||
format: | ||
desc: Format the code using different formatters. | ||
vars: | ||
PYTHON: | ||
ref: .PYTHON | splitLines | join " " | ||
deps: | ||
- task: clean | ||
cmds: | ||
- poetry run isort {{.PYTHON}} | ||
- poetry run ruff format {{.PYTHON}} | ||
|
||
lint: | ||
desc: Lint the code using different linters. | ||
vars: | ||
PYTHON: | ||
ref: .PYTHON | splitLines | join " " | ||
YAML: | ||
ref: .YAML | splitLines | join " " | ||
deps: | ||
- task: clean | ||
cmds: | ||
- poetry run isort --check {{.PYTHON}} | ||
- poetry run ruff check {{.PYTHON}} | ||
- poetry run yamllint --strict {{.YAML}} | ||
|
||
test: | ||
desc: Test the library. | ||
deps: | ||
- task: clean | ||
env: | ||
PYTEST_ADDOPTS: --quiet | ||
vars: | ||
TEST: | ||
ref: .TEST | splitLines | join " " | ||
cmds: | ||
- | | ||
poetry run openfisca test {{.TEST}} \ | ||
--country-package=openfisca_country_template \ | ||
--extensions=openfisca_extension_template | ||
check-build: | ||
desc: Check if the build is ok. | ||
deps: | ||
- task: clean | ||
- task: build | ||
cmds: | ||
- poetry run twine check dist/* | ||
- defer: rm -rf build dist | ||
|
||
check-version: | ||
desc: Check if the version is acceptable. | ||
cmds: | ||
- ./.github/is-version-number-acceptable.sh | ||
|
||
check-changes: | ||
desc: Check for functional changes. | ||
cmds: | ||
- ./.github/has-functional-changes.sh | ||
|
||
release: | ||
desc: Publish the library to PyPI. | ||
cmds: | ||
- poetry publish --username $PYPI_USERNAME --password $PYPI_PASSWORD | ||
|
||
tag: | ||
desc: Update and push the version tag. | ||
cmds: | ||
- git tag ${{VERSION}} | ||
- git push --tags |
Oops, something went wrong.