Skip to content

Commit

Permalink
Install package locally
Browse files Browse the repository at this point in the history
Prior to this change, the `timezone_tools` package was not installed
locally and so you had to pass a `PYTHONPATH` environment variable to
pytest to run tests.

This isn't a problem when running tests in `tox` and it automatically
installs the first-party package as part of its set-up phase.

This change updates the `makefile` to install the `timezone_tools` in
editable mode.

Now it's possible to run `pytest` from repo root.
  • Loading branch information
codeinthehole committed Oct 11, 2024
1 parent 2a2c8a0 commit 34a492b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 4 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ source venv/bin/activate
You could also use [virtualenvwrapper], [direnv] or any similar tool
to help manage your virtual environments.

### Install the Python dependencies
### Install the `timezone_tools` package and its dependencies

To install all the development dependencies in your virtual environment,
To install the `timezone_tools` package and all the development dependencies in your virtual environment,
run:

```sh
Expand All @@ -37,8 +37,6 @@ make dev
[direnv]: https://direnv.net
[virtualenvwrapper]: https://virtualenvwrapper.readthedocs.io/

The tools used to manage this project will be installed.

### Run the tests

To start the tests with [tox](https://tox.wiki), run:
Expand All @@ -48,10 +46,10 @@ tox
```

Alternatively, if you want to run the tests directly in your virtual environment,
you many run the tests with:
you may run the tests with:

```sh
PYTHONPATH=src python3 -m pytest
python3 -m pytest
```

### Static analysis
Expand Down
3 changes: 2 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ dev: install_python_packages

.PHONY:install_python_packages
install_python_packages: requirements.txt
python3 -m pip install -r requirements.txt
# Install the `timezone_tools` package in editable mode.
python3 -m pip install -r requirements.txt -e .

0 comments on commit 34a492b

Please sign in to comment.