Skip to content

Commit

Permalink
Recommend installing package as editable in a virtual environment dur…
Browse files Browse the repository at this point in the history
…ing development
  • Loading branch information
ushkarev committed Feb 16, 2023
1 parent d0d9a83 commit f32b503
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,6 @@ jobs:
- name: Install testing requirements
run: pip install -r requirements-test.txt
- name: Run tests
run: python -m tests
run: |
pip install --editable .
python -m tests
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
.PHONY: help clean test test-all coverage lint release
.PHONY: help init clean test test-all coverage lint release

help:
@echo "Using make is entirely optional; these are simply shortcuts"
@echo "See README.rst for normal usage."
@echo ""
@echo "init - create virtual environment"
@echo "clean - remove all build and test artifacts"
@echo "test - run all tests using current python environment"
@echo "test-all - run all tests in all supported python environments"
@echo "coverage - check code coverage while running all tests using current python environment"
@echo "lint - check code style"
@echo "release - NOT NORMALLY USED; See README.rst for release process"

init:
[ -d venv ] || python -m venv venv
./venv/bin/pip install -U setuptools pip wheel
./venv/bin/pip install --editable .
@echo `./venv/bin/python --version` virtual environment installed. Activate it using '`. ./venv/bin/activate`'

clean:
rm -fr build/ dist/ .eggs/ .tox/ .coverage
find . -name '*.pyc' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +

test:
pip install --editable .
pip install -r requirements-test.txt
python -m tests

Expand Down
3 changes: 3 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ Development

Please report bugs and open pull requests on `GitHub`_.

To work on changes to this library, it’s recommended to install it in editable mode into a virtual environment,
i.e. ``pip install --editable .``

Use ``python -m tests`` to run all tests locally.
Alternatively, you can use ``tox`` if you have multiple python versions.

Expand Down

0 comments on commit f32b503

Please sign in to comment.