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

Commit c513e00

Browse files
authored
readme flake8 and reqs
1 parent 6fd5898 commit c513e00

1 file changed

Lines changed: 30 additions & 3 deletions

File tree

README.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,35 @@ You can activate the virtual environment with `source .venv/bin/activate`.
2323
To enable the new venv in jupyter notebooks follow the instructions here:
2424
https://janakiev.com/blog/jupyter-virtual-envs/
2525

26+
link to the venv documentation:
27+
https://docs.python.org/3/library/venv.html
28+
29+
Alternatives to venv are conda environments but there are some big differences between the 2:
30+
https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html
2631

2732
## requirements.txt
28-
*[insert description]*
33+
Requirements files specify the dependencies of the project for other packages.
34+
How the requirements are distributed across directories and files varries.
35+
For this project we have 3 files where the requirements are stored:
36+
* [requirements.dev.txt](requirements.dev.txt) has the dependencies anything that is necessary for the developer but not the user of the package (e.g. testing & linting)
37+
* [docs/requirements.txt](docs/requirements.txt) has the dependencies for building the documentation.
38+
* [setup.py](setup.py) has the **examplepackage** dependencies as part of the `install_requires` parameter of the `setup` function. More info in the dedicated section below.
39+
40+
The command `pip installs -r requirements.txt` install requirements from the specified file.
41+
42+
Alternatives to using requirements.txt files are conda enviroment yaml files (if you choose to use a conda env that is):
43+
https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html
2944

3045
## flake8
31-
*[insert description]*
46+
Quotting the the [flake8 documentation](https://flake8.pycqa.org/en/latest/manpage.html) directly:
47+
*flake8 is a command-line utility for enforcing style consistency across Python projects. By default it includes lint checks provided by the PyFlakes project, PEP-0008 inspired style checks provided by the PyCodeStyle project, and McCabe complexity checking provided by the McCabe project. It will also run third-party extensions if they are found and installed.*
48+
49+
In summary, flake8 checks if the code is uggly according to [PEP8](https://www.python.org/dev/peps/pep-0008/).
50+
flake8 is part of the requirements.dev.txt file and can be installed with pip.
51+
To run a flake8 check you simply execute the command:
52+
`flake8 examplepackage` *or any other dir that contains python files*
53+
54+
You can configure flake8 by adding a section for flake8 in the setup.cfg[setup.cfg] file. For example you can choose to instruct flake8 to ignore certain errors or change the default line length.
3255

3356
## black
3457
*[insert description]*
@@ -39,6 +62,9 @@ https://janakiev.com/blog/jupyter-virtual-envs/
3962
## setup.py
4063
*[insert description]*
4164

65+
## setup.cfg
66+
*[insert description]*
67+
4268
## Installing a package in Development mode
4369
*[insert description]*
4470

@@ -56,5 +82,6 @@ https://janakiev.com/blog/jupyter-virtual-envs/
5682

5783
## TO-DOs:
5884
- [ ] Descriptions for each component
59-
- [ ] Add documentation using sphynx
85+
- [X] Add documentation using sphynx
6086
- [ ] Add branch protection rules
87+
- [ ] Add a Makefile for ease of use

0 commit comments

Comments
 (0)