From 6d4338a7bd4499d4eb219605141070a0bdaac6c7 Mon Sep 17 00:00:00 2001 From: Marcello Perathoner Date: Sat, 23 Sep 2023 21:27:46 +0200 Subject: [PATCH] ceate venv in github action --- .github/workflows/python-package.yml | 2 ++ Makefile | 44 ++++++++++++++-------------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 80ebc7e..acf5b2a 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -26,6 +26,8 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip + python -m venv .venv + source .venv/bin/activate python -m pip install pytest coverage[toml] tox - name: Run tox run: | diff --git a/Makefile b/Makefile index a3ed7cf..75b8763 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ .PHONY: lint test dist upload docs -BIN=.venv/bin +BIN=.venv/bin/ DIRS=src/ tests/unit/ docs/ scripts/ # tests/performance/ BROWSER=firefox PYTEST=pytest --doctest-modules --doctest-glob="*.rst" --doctest-ignore-import-errors @@ -8,64 +8,64 @@ PYTEST=pytest --doctest-modules --doctest-glob="*.rst" --doctest-ignore-import-e all: lint test black: - -$(BIN)/black $(DIRS) + -$(BIN)black $(DIRS) blackdoc: - -$(BIN)/blackdoc $(DIRS) + -$(BIN)blackdoc $(DIRS) pylint: - -$(BIN)/pylint src/ + -$(BIN)pylint src/ mypy: - -$(BIN)/mypy $(DIRS) + -$(BIN)mypy $(DIRS) doc8: -doc8 README.rst pydocstyle: - $(BIN)/pydocstyle src/ + $(BIN)pydocstyle src/ lint: black blackdoc pylint mypy pydocstyle test: - $(BIN)/python3 -m $(PYTEST) src/ tests/ docs/ README.rst + $(BIN)python3 -m $(PYTEST) src/ tests/ docs/ README.rst test-performance: - $(BIN)/python3 -m $(PYTEST) --performance tests/performance/ + $(BIN)python3 -m $(PYTEST) --performance tests/performance/ coverage: - $(BIN)/coverage erase - $(BIN)/coverage run --branch --source=src -m $(PYTEST) tests/ - $(BIN)/coverage run --append --branch --source=src -m $(PYTEST) --debug-mode tests/ - $(BIN)/coverage report - $(BIN)/coverage html + $(BIN)coverage erase + $(BIN)coverage run --branch --source=src -m $(PYTEST) tests/ + $(BIN)coverage run --append --branch --source=src -m $(PYTEST) --debug-mode tests/ + $(BIN)coverage report + $(BIN)coverage html $(BROWSER) htmlcov/index.html profile: - $(BIN)/python3 -O -m scripts.profile + $(BIN)python3 -O -m scripts.profile docs: cd docs; make html badges: coverage - $(BIN)/python docs/make_badges.py + $(BIN)python docs/make_badges.py tox: - $(BIN)/tox + $(BIN)tox dist: clean test coverage badges - $(BIN)/python3 -m build - $(BIN)/twine check dist/* + $(BIN)python3 -m build + $(BIN)twine check dist/* upload: dist - $(BIN)/twine check dist/* - $(BIN)/twine upload dist/* + $(BIN)twine check dist/* + $(BIN)twine upload dist/* install: - $(BIN)/pip3 install --force-reinstall -e . + $(BIN)pip3 install --force-reinstall -e . uninstall: - $(BIN)/pip3 uninstall super_collator + $(BIN)pip3 uninstall super_collator clean: -rm -rf dist build *.egg-info