Skip to content

Commit

Permalink
use local .venv, manage venv via makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
chris48s committed Sep 2, 2023
1 parent 5c09e56 commit 3d0b0b1
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 5 deletions.
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[flake8]
ignore = E501, W503
exclude = .venv
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
run: make lint

- name: Ensure package builds
run: flit build
run: make build

- name: Upload coverage report to codecov
uses: codecov/codecov-action@v3
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ pip_abandoned.egg-info/
# test coverage
.coverage
coverage.xml

# venv
.venv
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ Development Tasks:
* Run the test suite: `make test`
* Run lint checks: `make lint`
* Auto-format: `make format`

Virtual Env Management:

* `source .venv/bin/activate`
* `deactivate`
21 changes: 17 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,41 @@
SHELL := /bin/bash
.PHONY: help format install lint test release
.PHONY: build help format install lint test release venv

help:
@grep '^\.PHONY' Makefile | cut -d' ' -f2- | tr ' ' '\n'

venv:
python3 -m venv .venv

format:
isort --profile black .
source .venv/bin/activate && \
isort --profile black . && \
black .

install:
python3 -m venv .venv
source .venv/bin/activate && \
pip install -e .[dev]

lint:
isort --profile black -c --diff .
black --check .
source .venv/bin/activate && \
isort --profile black -c --diff . && \
black --check . && \
flake8 .

test:
source .venv/bin/activate && \
pytest --cov=pip_abandoned --cov-report term --cov-report xml ./tests

build:
source .venv/bin/activate && \
flit build

release:
# usage: `make release version=0.0.0`
make test
@echo ""
make lint
@echo ""
source .venv/bin/activate && \
./release.sh "$(version)"

0 comments on commit 3d0b0b1

Please sign in to comment.