Skip to content

Commit 8239745

Browse files
author
Mauko Quiroga
committed
Minimize changes
1 parent 6be5a00 commit 8239745

8 files changed

Lines changed: 58 additions & 58 deletions

File tree

.DS_Store

6 KB
Binary file not shown.

Makefile

Lines changed: 58 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
include openfisca_make/install.mk
2-
include openfisca_make/lint.mk
3-
include openfisca_make/publish.mk
4-
include openfisca_make/serve.mk
5-
include openfisca_make/test_code.mk
6-
include openfisca_make/test_doc.mk
1+
include openfisca_tasks/test_code.mk
2+
include openfisca_tasks/test_doc.mk
73

84
help = sed -n "/^$1/ { x ; p ; } ; s/\#\#/[⚙]/ ; s/\./.../ ; x" ${MAKEFILE_LIST}
95

@@ -14,3 +10,59 @@ all: test
1410

1511
## Run all lints and tests.
1612
test: clean lint test-code
13+
14+
## Install project dependencies.
15+
install:
16+
@$(call help,$@:)
17+
@pip install --upgrade pip twine wheel
18+
@pip install --editable .[dev] --upgrade --use-deprecated=legacy-resolver
19+
20+
## Uninstall project dependencies.
21+
uninstall:
22+
@$(call help,$@:)
23+
@pip freeze | grep -v "^-e" | sed "s/@.*//" | xargs pip uninstall -y
24+
25+
## Delete builds and compiled python files.
26+
clean: \
27+
$(shell ls -d * | grep "build\|dist") \
28+
$(shell find . -name "*.pyc")
29+
@$(call help,$@:)
30+
@rm -rf $?
31+
32+
## Install openfisca-core for deployment and publishing.
33+
build: setup.py
34+
@## This allows us to be sure tests are run against the packaged version
35+
@## of openfisca-core, the same we put in the hands of users and reusers.
36+
@$(call help,$@:)
37+
@python $? bdist_wheel
38+
@find dist -name "*.whl" -exec pip install --force-reinstall {}[dev] \;
39+
40+
## Lint the codebase.
41+
lint: check-syntax-errors check-style check-types
42+
43+
## Compile python files to check for syntax errors.
44+
check-syntax-errors: .
45+
@$(call help,$@:)
46+
@python -m compileall -q $?
47+
48+
## Run linters to check for syntax and style errors.
49+
check-style: $(shell git ls-files "*.py")
50+
@$(call help,$@:)
51+
@flake8 $?
52+
53+
## Run static type checkers for type errors.
54+
check-types: openfisca_core openfisca_web_api
55+
@$(call help,$@:)
56+
@mypy $?
57+
58+
## Run code formatters to correct style errors.
59+
format-style: $(shell git ls-files "*.py")
60+
@$(call help,$@:)
61+
@autopep8 $?
62+
63+
## Serve the openfisca Web API.
64+
api:
65+
@$(call help,$@:)
66+
@openfisca serve \
67+
--country-package openfisca_country_template \
68+
--extensions openfisca_extension_template

openfisca_make/install.mk

Lines changed: 0 additions & 17 deletions
This file was deleted.

openfisca_make/lint.mk

Lines changed: 0 additions & 22 deletions
This file was deleted.

openfisca_make/publish.mk

Lines changed: 0 additions & 7 deletions
This file was deleted.

openfisca_make/serve.mk

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)