Skip to content

Commit eded354

Browse files
Minor Fixes
1 parent 921f001 commit eded354

File tree

4 files changed

+63
-50
lines changed

4 files changed

+63
-50
lines changed

.github/workflows/cookiecutter_docs.yml renamed to .github/workflows/deployment_workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Documentation
1+
name: Deployment Workflow
22
on:
33
push:
44
branches:

docs/source/conf.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
# conf.py
22
# Configuration file for the Sphinx documentation builder.
3+
import setuptools_scm
4+
5+
36
project = "python-cookiecutter"
47
copyright = "2025, University College London"
58
author = "Neuroinformatics Unit"
9+
try:
10+
full_version = setuptools_scm.get_version(root="../..", relative_to=__file__)
11+
# Splitting the release on '+' to remove the commit hash
12+
release = full_version.split('+', 1)[0]
13+
except LookupError:
14+
# if git is not initialised, still allow local build
15+
# with a dummy version
16+
release = "0.0.0"
617

718
# -- General configuration ---------------------------------------------------
819
extensions = [
@@ -73,7 +84,7 @@
7384
},
7485
],
7586
"logo": {
76-
"text": f"{project}",
87+
"text": f"{project} v{release}",
7788
},
7889
"footer_start": ["footer_start"],
7990
"footer_end": ["footer_end"],
@@ -107,7 +118,7 @@ def setup(app):
107118
108119
<p>Sorry, we couldn't find that page.</p>
109120
110-
<p>We occasionally restructure the cookiecutter website, and some links may have broken.</p>
121+
<p>We occasionally restructure the python-cookiecutter website, and some links may have broken.</p>
111122
112123
<p>Try using the search box or go to the homepage.</p>
113124
""",

docs/source/infrastructure.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,53 @@
11
# Infrastructure
22

3-
## Pre-commit hooks
3+
## Tests
4+
5+
Write your test methods and classes in the `test` folder. We are using [pytest](https://docs.pytest.org/en/7.2.x/getting-started.html).
6+
In your test module you can call your methods in a simple way:
7+
8+
```python
9+
# filename: test_math.py
10+
from my_awesome_software import math
11+
12+
# here your test function
13+
```
14+
15+
If you're testing a small piece of code, make it a unit test. If you want to test whether two or more software units work well together, create an integration test.
16+
17+
:::{important}
18+
Before committing your changes
19+
:::
20+
21+
### Run the tests
22+
23+
Be sure that you have installed pytest and run it
24+
```bash
25+
pip install pytest
26+
pytest
27+
```
28+
You should also see coverage information.
29+
30+
### Install your package locally
31+
32+
For a local, editable install, in the project directory, run:
33+
```bash
34+
pip install -e .
35+
```
36+
37+
For a local, editable install with all the development tools (e.g. testing, formatting etc.) run:
38+
```bash
39+
pip install -e '.[dev]'
40+
```
41+
42+
You might want to install your package in an _ad hoc_ environment.
43+
44+
To test if the installation works, try to call your modules with python in another folder from the same environment.
45+
```python
46+
from my_awesome_sofware.math import add_two_integers
47+
add_two_integers(1, 2)
48+
```
49+
50+
# Pre-commit hooks
451

552
Running `pre-commit install` will set up [pre-commit hooks](https://pre-commit.com/) to ensure the code is
653
formatted correctly. Currently, these are:

docs/source/project_setup.md

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ git push --set-upstream origin main
174174
```
175175
That\'s it! Your project is now set up and ready to go. 🚀
176176

177-
# Modules and Tests
177+
# Modules
178178

179179
Your methods and classes would live inside the folder `my_awesome_software`. Split the functionalities into modules, and save them as `.py` files, e.g.:
180180
```
@@ -204,48 +204,3 @@ the `[project]` heading:
204204
```toml
205205
dependencies = ["numpy", "pandas"]
206206
```
207-
208-
## Write tests
209-
210-
Write your test methods and classes in the `test` folder. We are using [pytest](https://docs.pytest.org/en/7.2.x/getting-started.html).
211-
In your test module you can call your methods in a simple way:
212-
```python
213-
# filename: test_math.py
214-
from my_awesome_software import math
215-
216-
# here your test function
217-
```
218-
219-
If you're testing a small piece of code, make it a unit test. If you want to test whether two or more software units work well together, create an integration test.
220-
221-
:::{important}
222-
Before committing your changes
223-
:::
224-
### Run the tests
225-
226-
Be sure that you have installed pytest and run it
227-
```bash
228-
pip install pytest
229-
pytest
230-
```
231-
You should also see coverage information.
232-
233-
### Install your package locally
234-
235-
For a local, editable install, in the project directory, run:
236-
```bash
237-
pip install -e .
238-
```
239-
240-
For a local, editable install with all the development tools (e.g. testing, formatting etc.) run:
241-
```bash
242-
pip install -e '.[dev]'
243-
```
244-
245-
You might want to install your package in an _ad hoc_ environment.
246-
247-
To test if the installation works, try to call your modules with python in another folder from the same environment.
248-
```python
249-
from my_awesome_sofware.math import add_two_integers
250-
add_two_integers(1, 2)
251-
```

0 commit comments

Comments
 (0)