-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve the development flow and extend the README with steps recomme…
…nded before submitting a PR (#544)
- Loading branch information
1 parent
9b8e5db
commit 9784632
Showing
5 changed files
with
72 additions
and
30 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
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,23 +1,61 @@ | ||
DOCKER_IMAGE := m2cgen | ||
DOCKER_RUN_ARGS := docker run --rm -it -v "$$PWD":"/m2cgen" $(DOCKER_IMAGE) | ||
TARGETS := ./m2cgen ./tests | ||
|
||
clean: | ||
rm -rf ./m2cgen.egg-info ./dist ./build | ||
|
||
docker-build: | ||
docker build -t $(DOCKER_IMAGE) . | ||
flake8: | ||
flake8 $(TARGETS) | ||
|
||
isort: | ||
isort $(TARGETS) | ||
|
||
isort-check: | ||
isort $(TARGETS) --check-only | ||
|
||
test-api: | ||
pytest -v tests/ --cov=m2cgen/ --cov-report=xml:coverage.xml --ignore=tests/e2e/ | ||
|
||
package: | ||
python setup.py bdist_wheel --plat-name=any --python-tag=py3 && \ | ||
python setup.py sdist | ||
|
||
publish: clean package | ||
python -m twine upload dist/* | ||
|
||
install-requirements: | ||
pip install -r requirements-test.txt | ||
|
||
install-develop: | ||
python setup.py develop | ||
|
||
docker-test-all: | ||
$(DOCKER_RUN_ARGS) | ||
pre-pr: install-requirements flake8 isort test-api | ||
|
||
docker-test-unit: | ||
$(DOCKER_RUN_ARGS) bash -c "pytest -v --fast tests/ --ignore=tests/e2e/" | ||
generate-code-examples: install-develop | ||
python tools/generate_code_examples.py ./generated_code_examples | ||
|
||
download-codecov: | ||
wget -q https://uploader.codecov.io/latest/linux/codecov -O codecov && \ | ||
chmod +x codecov | ||
|
||
run-codecov: download-codecov | ||
./codecov -f coverage.xml -Z | ||
|
||
docker-build: | ||
docker build -t $(DOCKER_IMAGE) . | ||
|
||
docker-generate-examples: | ||
$(DOCKER_RUN_ARGS) bash -c "python setup.py develop && python tools/generate_code_examples.py generated_code_examples" | ||
$(DOCKER_RUN_ARGS) make generate-code-examples | ||
|
||
docker-lint: | ||
$(DOCKER_RUN_ARGS) bash -c "flake8 . && isort . --check-only" | ||
$(DOCKER_RUN_ARGS) make flake8 isort-check | ||
|
||
docker-test-api: | ||
$(DOCKER_RUN_ARGS) make test-api | ||
|
||
docker-pre-pr: | ||
$(DOCKER_RUN_ARGS) make pre-pr | ||
|
||
docker-shell: | ||
$(DOCKER_RUN_ARGS) bash | ||
|
||
docker-pre-pr: docker-lint docker-test-all |
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
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 +1 @@ | ||
0.9.1 | ||
0.10.1 |
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