Skip to content

Commit

Permalink
ceate venv in github action
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelloPerathoner committed Sep 23, 2023
1 parent f9392fc commit 6d4338a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 22 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
44 changes: 22 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,71 +1,71 @@
.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

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
Expand Down

0 comments on commit 6d4338a

Please sign in to comment.