Skip to content
This repository was archived by the owner on May 26, 2026. It is now read-only.

Commit a1df00e

Browse files
authored
readme for makefile
1 parent ee26ce8 commit a1df00e

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ A python project template for educational purposes
1313
5. Install the package in development mode:
1414
`pip install -e .`
1515

16+
OR
17+
18+
1. `make environment`
19+
2. `source .venv/bin/activate`
20+
1621
## Python venv
1722
**venv** stands for virtual environment and is part of the python standard library (i.e. you don't have to install it).
1823
Python virtual environments' role is to create an isolated python environment for each project so that there are no dependency issues etc. from conflicting project requirements (e.g. Project A need pandas 1.0 and Project B needs pandas 1.1).
@@ -179,6 +184,41 @@ The title is pretty self explanatory.
179184

180185
.gitignore is a file where you can add files and directories that you want git to ignore. The [.gitignore](.gitignore) in this template has the typical content. For example .venv, the directory that contains the python virtual environment, should not be push to github and is in .gitignore.
181186

187+
## Makefile
188+
The [Makefile](Makefile) makes life a bit more simple by having some of the necessary commands ready to go.
189+
Available commands for this template are:
190+
1. `make environment`, equivalent to:
191+
```
192+
python -m venv .venv
193+
source .venv/bin/activate
194+
pip install -r requirements.dev.txt
195+
pip install -e .
196+
python -m ipykernel install --name=examplepackage
197+
jupyter kernelspec list
198+
pre-commit install
199+
```
200+
2. `make clean`, equivalent to:
201+
```
202+
echo "> Removing virtual environment"
203+
rm -r .venv
204+
echo "> Uninstalling from jupyter"
205+
jupyter kernelspec uninstall examplepackage
206+
```
207+
3. `make install`, equivalent to:
208+
```
209+
pip install -r requirements.dev.txt
210+
pip install -e .
211+
```
212+
4. `make test`, equivalent to:
213+
```
214+
pytest examplepackage
215+
```
216+
5. `make lint`, equivalent to:
217+
```
218+
flake8 examplepackage
219+
pydocstyle examplepackage
220+
```
221+
182222
## Github Actions
183223
From the official https://github.com/features/actions page:
184224
*"GitHub Actions makes it easy to automate all your software workflows, now with world-class CI/CD. Build, test, and deploy your code right from GitHub. Make code reviews, branch management, and issue triaging work the way you want."*

0 commit comments

Comments
 (0)