Skip to content

Commit

Permalink
Poetry use suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit-cty committed Oct 18, 2024
1 parent 66d3d2e commit dad766d
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
all: test

uninstall:
pip freeze | grep -v "^-e" | sed "s/@.*//" | xargs pip uninstall -y
poetry env remove --all

clean:
rm -rf build dist
Expand All @@ -12,24 +12,23 @@ install:
@# Install OpenFisca-Extension-Template for development.
@# The editable version of OpenFisca-Extension-Template allows contributors
@# to test as they code.
pip install --upgrade pip
poetry install --all-extras --sync

format:
@# Do not analyse .gitignored files.
@# `make` needs `$$` to output `$`. Ref: http://stackoverflow.com/questions/2382764.
black `git ls-files | grep "\.py$$"`
isort `git ls-files | grep "\.py$$"`
pyproject-fmt pyproject.toml
ruff format `git ls-files | grep "\.py$$"`
poetry run black `git ls-files | grep "\.py$$"`
poetry run isort `git ls-files | grep "\.py$$"`
poetry run pyproject-fmt pyproject.toml
poetry run ruff format `git ls-files | grep "\.py$$"`

lint: clean
@# Do not analyse .gitignored files.
@# `make` needs `$$` to output `$`. Ref: http://stackoverflow.com/questions/2382764.
black --check `git ls-files | grep "\.py$$"`
isort --check `git ls-files | grep "\.py$$"`
ruff check `git ls-files | grep "\.py$$"`
yamllint `git ls-files | grep "\.yaml$$"`
poetry run black --check `git ls-files | grep "\.py$$"`
poetry run isort --check `git ls-files | grep "\.py$$"`
poetry run ruff check `git ls-files | grep "\.py$$"`
poetry run yamllint `git ls-files | grep "\.yaml$$"`

test: clean
PYTEST_ADDOPTS="--import-mode importlib" openfisca test --country-package=openfisca_country_template --extensions=openfisca_extension_template openfisca_extension_template/tests
PYTEST_ADDOPTS="--import-mode importlib" poetry run openfisca test --country-package=openfisca_country_template --extensions=openfisca_extension_template openfisca_extension_template/tests

0 comments on commit dad766d

Please sign in to comment.