From 52f938c343f8fc4ee9b43e6f780d113e271975f1 Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Thu, 25 Jan 2024 11:48:29 -0500 Subject: [PATCH] MNT: updates Makefile scripts, adds isort to requirements-tests.txt --- .github/pull_request_template.md | 2 +- .gitignore | 3 ++- Makefile | 43 ++++++++++++++++++-------------- requirements-tests.txt | 5 ++-- 4 files changed, 30 insertions(+), 23 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index a2b73bb1a..4cbf22547 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -16,7 +16,7 @@ - [ ] Tests for the changes have been added (if needed) - [ ] Docs have been reviewed and added / updated - [ ] Lint (`black rocketpy/ tests/`) has passed locally -- [ ] All tests (`pytest --runslow`) have passed locally +- [ ] All tests (`python3 -m pytest tests -m slow --runslow`) have passed locally - [ ] `CHANGELOG.md` has been updated (if relevant) ## Current behavior diff --git a/.gitignore b/.gitignore index 5001f8daf..ed8cc5659 100644 --- a/.gitignore +++ b/.gitignore @@ -36,7 +36,7 @@ MANIFEST pip-log.txt pip-delete-this-directory.txt -# Unit test / coverage reports +# Unit test / coverage reports / lints reports htmlcov/ .tox/ .nox/ @@ -50,6 +50,7 @@ coverage.xml .hypothesis/ .pytest_cache/ cover/ +.pylint-report.txt # Translations *.mo diff --git a/Makefile b/Makefile index 83d15b38d..0a40f33cb 100644 --- a/Makefile +++ b/Makefile @@ -1,27 +1,32 @@ -test: - python -m pytest tests -vv +pytest: + python3 -m pytest tests -testfile: - python -m pytest tests/$(file) -vv +pytest-slow: + python3 -m pytest tests -vv -m slow --runslow -tests: - test - -coverage: - python -m pytest --cov=rocketpy tests -vv +coverage: + python3 -m pytest --cov=rocketpy tests coverage-report: - python -m pytest --cov=rocketpy tests -vv --cov-report html + python3 -m pytest --cov=rocketpy tests --cov-report html -install: - python -m pip install --upgrade pip +install: + python3 -m pip install --upgrade pip pip install -r requirements.txt - python setup.py install + pip install -r requirements-optional.txt + pip install -e . + +isort: + isort --profile black rocketpy/ tests/ docs/ -verify-lint: - flake8 --select BLK rocketpy - flake8 --select BLK test +black: + black rocketpy/ tests/ docs/ + +pylint: + -pylint rocketpy tests --output=.pylint-report.txt -lint: - black rocketpy - black tests +biuld-docs: + cd docs + python3 -m pip install -r requirements.txt + make html + cd .. \ No newline at end of file diff --git a/requirements-tests.txt b/requirements-tests.txt index 837e2ef36..19d26679a 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -1,7 +1,8 @@ pytest==6.2.4 pytest-coverage -black +black[jupyter] flake8-black pandas numericalunits==1.25 -pylint \ No newline at end of file +pylint +isort \ No newline at end of file