@@ -9,66 +9,75 @@ and provides more information on how to work with this repository.
99
1010Here is a * non-exhaustive* list of the most important files and directories in the repository.
1111
12- * General:*
13-
14- * ` AUTHORS.md ` : acknowledges and lists all contributors
15- * ` CHANGELOG.md ` : summarizes the changes for each version of the software for users
16- * ` CODE_OF_CONDUCT.md ` : defines the social standards that must be followed by contributors
17- * ` CONTRIBUTING.md ` : explains how others can contribute to the project
18- * ` README.md ` : provides an overview and points to other resources
19-
20- * Metadata:*
21-
22- * ` CITATION.cff ` : metadata stating how to cite the project
23- * ` codemeta.json ` : metadata for harvesting by other tools and services
24- * ` LICENSE ` : the (main) license of the project
25- * ` LICENSES ` : copies of all licenses that apply to files in the project
26- * ` .reuse/dep5 ` : granular license and copyright information for all files and directories
27-
28- * Development:*
29-
30- * ` pyproject.toml ` : project metadata, dependencies, development tool configurations
31- * ` poetry.lock ` : needed for reproducible installation of the project
32- * ` src ` : actual code provided by the project
33- * ` tests ` : all tests for the code in the project
34- * ` mkdocs.yml ` : configuration of the project website
35- * ` docs ` : most contents used for the project website
36-
37- * Automation and Quality Control:*
38-
39- * ` .pre-commit-config.yaml ` : quality assurance tools used in the project
40- * ` .github/workflows ` : CI scripts for GitHub (QA, documentation and package deployment)
41- * ` .github/ISSUE_TEMPLATE ` : templates for the GitHub issue tracker
42- * ` .gitlab-ci.yml ` : mostly equivalent CI scripts, but for GitLab
43- * ` .gitlab/issue_templates ` : The same issues templates, but for GitLab
12+ === "General"
13+ * ` AUTHORS.md ` : acknowledges and lists all contributors
14+ * ` CHANGELOG.md ` : summarizes the changes for each version of the software for users
15+ * ` CODE_OF_CONDUCT.md ` : defines the social standards that must be followed by contributors
16+ * ` CONTRIBUTING.md ` : explains how others can contribute to the project
17+ * ` README.md ` : provides an overview and points to other resources
18+
19+ === "Metadata"
20+ * ` CITATION.cff ` : metadata stating how to cite the project
21+ * ` codemeta.json ` : metadata for harvesting by other tools and services
22+ * ` LICENSE ` : the (main) license of the project
23+ * ` LICENSES ` : copies of all licenses that apply to files in the project
24+ * ` .reuse/dep5 ` : granular license and copyright information for all files and directories
25+
26+ === "Development"
27+ * ` pyproject.toml ` : project metadata, dependencies, development tool configurations
28+ * ` poetry.lock ` : needed for reproducible installation of the project
29+ * ` src ` : actual code provided by the project
30+ * ` tests ` : all tests for the code in the project
31+ * ` mkdocs.yml ` : configuration of the project website
32+ * ` docs ` : most contents used for the project website
33+
34+ === "CI / QA"
35+ * ` .pre-commit-config.yaml ` : quality assurance tools used in the project
36+ * ` .github/workflows ` : CI scripts for GitHub (QA, documentation and package deployment)
37+ * ` .github/ISSUE_TEMPLATE ` : templates for the GitHub issue tracker
38+ * ` .gitlab-ci.yml ` : mostly equivalent CI scripts, but for GitLab
39+ * ` .gitlab/issue_templates ` : The same issues templates, but for GitLab
40+
41+ !!! tip
42+ You might find various other files popping up which are generated by different tools.
43+ Most of these should not be committed into the repository, so they are excluded
44+ in the ` .gitignore ` file. Everything listed there is safe to delete.
4445
4546### Used Tools
4647
4748Here is a * non-exhaustive* list of the most important tools used in the project.
4849
49- Best practices for modern Python development are implemented by using:
50-
51- * ` poetry ` for dependency management and packaging
52- * ` pytest ` for unit testing
53- * ` hypothesis ` for property-based testing
54- * ` pre-commit ` for orchestrating linters, formatters and other utilities
55- * ` black ` for source-code formatting
56- * ` autoflake ` for automatically removing unused imports
57- * ` flake8 ` for general linting (using various linter plugins)
58- * ` pydocstyle ` for checking docstring conventions
59- * ` interrogate ` for computing docstring coverage
60- * ` mypy ` for editor-independent type-checking
61- * ` mkdocs ` for generating the project documentation website
62- * ` bandit ` for checking security issues in the code
63- * ` safety ` for checking security issues in the current dependencies
64-
65- Metadata best practices for FAIR software are implemented using:
66-
67- * ` cffconvert ` to check the ` CITATION.cff ` (citation metadata)
68- * ` codemetapy ` to generate a ` codemeta.json ` (general software metadata)
69- * ` somesy ` to keep all important metadata continuously synchronized
70- * ` reuse ` to check [ REUSE-compliance] ( https://reuse.software/spec/ ) (granular copyright and license metadata)
71- * ` licensecheck ` to scan for possible license incompatibilities in the dependencies
50+ === "General"
51+ * ` poetry ` for dependency management and packaging
52+ * ` poethepoet ` tool for running common tasks
53+ * ` pre-commit ` for orchestrating linters, formatters and other utilities
54+ * ` mkdocs ` for generating the project documentation website
55+ * ` mike ` for managing the ` mkdocs ` -generated documentation website
56+
57+ === "Code Quality"
58+ * ` flake8 ` for general linting (using various linter plugins)
59+ * ` mypy ` for editor-independent type-checking
60+ * ` pytest ` for unit testing
61+ * ` pytest-cov ` for computing code coverage by tests
62+ * ` hypothesis ` for property-based testing
63+ * ` bandit ` for checking security issues in the code
64+ * ` safety ` for checking security issues in the current dependencies
65+
66+ === "Formatting and Style"
67+ * ` black ` for source-code formatting
68+ * ` autoflake ` for automatically removing unused imports
69+ * ` pydocstyle ` for checking docstring conventions
70+
71+ === "FAIR metadata"
72+ * ` cffconvert ` to check the ` CITATION.cff ` (citation metadata)
73+ * ` codemetapy ` to generate a ` codemeta.json ` (general software metadata)
74+ * ` somesy ` to keep all important metadata continuously synchronized
75+ * ` reuse ` to check [ REUSE-compliance] ( https://reuse.software/spec/ ) (granular copyright and license metadata)
76+ * ` licensecheck ` to scan for possible license incompatibilities in the dependencies
77+
78+ !!! tip
79+ Most tools installed and used by this project are listed in the
80+ ` pyproject.toml ` and ` .pre-commit-config.yaml ` files.
7281
7382## Basics
7483
@@ -85,8 +94,9 @@ In older software, most of this information is often scattered over many little
8594tool-specific configuration files and a ` setup.py ` , ` setup.cfg ` and/or ` requirements.txt `
8695file.
8796
88- In this project, ` pyproject.toml ` is the first place that should be checked
89- when looking for the configuration of some development tool.
97+ !!! tip
98+ ` pyproject.toml ` is the first place your should check
99+ when looking for the configuration of some development tool.
90100
91101### Configuration
92102
@@ -109,8 +119,10 @@ Note that `poetry` is only needed for development of the repository.
109119The * end-users* who just want to * install and use* this project
110120do ** not need** to set up or know anything about poetry.
111121
112- Note that if you use ` poetry shell ` and the project is installed with ` poetry install ` ,
113- in the following you do not have to prepend ` poetry run ` to commands you will see below.
122+ !!! tip
123+ If you use ` poetry shell ` to activate the virtual environment of the project,
124+ and the project is already installed with ` poetry install ` , in the following you do not
125+ have to prepend ` poetry run ` in the commands you will see below.
114126
115127### Task Runner
116128
@@ -123,7 +135,7 @@ Often projects use a shell script or `Makefile` for this purpose. This project u
123135[ poethepoet] ( https://github.com/nat-n/poethepoet ) , as it integrates nicely with ` poetry ` .
124136The tasks are defined in ` pyproject.toml ` and can be launched using:
125137
126- ```
138+ ``` bash
127139poetry run poe TASK_NAME
128140```
129141
@@ -153,7 +165,7 @@ be activated. This is usually done using `pre-commit install`, which also requir
153165
154166In this project, you can run:
155167
156- ```
168+ ``` bash
157169poetry run poe init-dev
158170```
159171
@@ -182,7 +194,7 @@ After doing that, you can retry to `git commit` your changes.
182194To avoid having to deal with many issues at once, it is a good habit to run
183195` pre-commit ` by hand from time to time. In this project, this can be done with:
184196
185- ```
197+ ``` bash
186198poetry run poe lint --all-files
187199```
188200
@@ -204,10 +216,14 @@ Such randomized tests can be a good addition to hand-crafted tests and inputs.
204216
205217To run all tests, either invoke ` pytest ` directly, or use the provided task:
206218
207- ```
219+ ``` bash
208220poetry run poe test
209221```
210222
223+ !!! tip
224+ Add the flag ` --cov ` to enable the test coverage tracking and get a table with
225+ results after the tests are completed.
226+
211227## Documentation
212228
213229The project uses [ ` mkdocs ` ] ( https://www.mkdocs.org/ ) with the popular and excellent
@@ -234,6 +250,11 @@ To make this both possible as well as convenient, this project uses
234250[ ` mike ` ] ( https://github.com/jimporter/mike ) to generate and manage the ` mkdocs `
235251** documentation for different versions** of the software.
236252
253+ !!! tip
254+ You can easily add new pages (e.g. extended tutorials or topic-specific guides) to
255+ your documentation website by creating markdown files in the ` docs/ ` directory and
256+ adding them to the ` nav ` section in ` mkdocs.yml ` .
257+
237258### Online Documentation
238259
239260To avoid dependence on additional services such as [ readthedocs] ( https://readthedocs.org/ ) ,
@@ -243,19 +264,31 @@ The provided CI pipeline automatically generates the documentation for the lates
243264development version (i.e., current state of the ` main ` branch) as well as every released
244265version (i.e., marked by a version tag ` vX.Y.Z ` ).
245266
267+
268+ !!! tip
269+ Should anything go wrong and you need to manually access the data of the deployed
270+ website, you can find it in the ` gh-pages ` branch of the repository. Normally you
271+ should not need to use that branch directly, though.
272+
273+
246274### Offline Documentation
247275
248276You can manually generate a local and fully offline copy of the documentation, which
249277can be useful for e.g. previewing the results during active work on the documentation:
250278
251- ```
279+ ``` bash
252280poetry install --with docs
253281poetry run poe docs
254282```
255283
256284Once the documentation site is built, run ` mkdocs serve ` and
257285open ` https://localhost:8000 ` in your browser to see the local copy of the website.
258286
287+ !!! tip
288+ You probably should always check bigger website updates locally before it is publicly
289+ deployed. The automatic pipelines can only catch technical problems, but you still
290+ e.g. might want to do some proof-reading.
291+
259292## Releases
260293
261294From time to time the project is ready for a new ** release** for users.
@@ -315,4 +348,4 @@ in the `publish` job in `ci.yml` to enable the corresponding publication target.
315348
316349If the old and less secure token-based authentication method is needed or
317350the package should be published to a different PyPI-compatible package index, please
318- adapt ` release.yml ` [ accordingly] ( https://github.com/pypa/gh-action-pypi-publish ) ) .
351+ adapt ` release.yml ` [ accordingly] ( https://github.com/pypa/gh-action-pypi-publish ) .
0 commit comments