Skip to content

Commit 9aceb7f

Browse files
enryHCopilot
andauthored
Document (#1) (#8)
* 🎨 add flake8 and ruff line length default (to 90 characters) * 🎨 add formatting of jupyter notebooks per default * 📝 highlight that also a folder has to be renamed * 📝 document what extension are used for * 📝 document debian (ubuntu) package adding which might be needed * 🎨 use PyPI and GitHub integration instead of secret api token * 🙈 hide folders creating when locally building the documentation website * 📝 document desing choices and layout of Python package * 🎨 add copy button for code blocks per default * 🎨 small corrections after proof-reading * 🎨 make name generic and document it. Choose a Licence hint * 🎨 add design document to Sphinx documentation * 🎨 add some more common error checking - set line-length to black default of 88 characters * Apply suggestions from code review * 🐛 correct python pkg configuration file * 🐛 add missing changes for requirments.txt As noted by Angel using requirements.txt needed one additional change: - add dependencies to the dynamic field Add hint to section with dependencies * 📝 Add hint to GitHub Releases and Source distribution testing * 🎨 follow Pasquale's advices (.gitignore + unnecessary config) - add more to .gitignore and link template - remove line-length configuration as it is already on the default 88 of black formatter * 📝 add sebastians hints on other ressources * 🎨 add license key and remove from classifiers as suggested by Sebastian * 📝 docstring and src layout hints (noted by sebastian) * 🐛 add missing key to pyproject.toml --------- Co-authored-by: Copilot <[email protected]>
1 parent dc33c98 commit 9aceb7f

File tree

12 files changed

+648
-25
lines changed

12 files changed

+648
-25
lines changed

.github/workflows/cicd.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Lint with ruff
3535
run: |
3636
# stop the build if there are Python syntax errors or undefined names
37-
ruff check .
37+
ruff check src
3838
test:
3939
name: Test
4040
runs-on: ubuntu-latest
@@ -119,10 +119,9 @@ jobs:
119119
with:
120120
name: artifact
121121
path: ./dist
122-
122+
# register PyPI integration:
123+
# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
123124
- uses: pypa/gh-action-pypi-publish@release/v1
124125
with:
125126
# remove repository key to set the default to pypi (not test.pypi.org)
126127
repository-url: https://test.pypi.org/legacy/
127-
user: __token__
128-
password: ${{ secrets.PYPI_API_TOKEN }}

.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# find more examples here:
2+
# https://github.com/github/gitignore/blob/main/Python.gitignore
13
# Binaries (object files) produced by a compiler
24
*.so
35
*.o
@@ -27,3 +29,28 @@ _templates
2729

2830
# VSCode may create a config file with this name
2931
**.vscode
32+
33+
# Ruff stuff:
34+
.ruff_cache/
35+
36+
# Environments
37+
.env
38+
.envrc
39+
.venv
40+
env/
41+
venv/
42+
43+
# Unit test / coverage reports
44+
htmlcov/
45+
.tox/
46+
.nox/
47+
.coverage
48+
.coverage.*
49+
.cache
50+
nosetests.xml
51+
coverage.xml
52+
*.cover
53+
*.py.cover
54+
.hypothesis/
55+
.pytest_cache/
56+
cover/

.readthedocs.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ build:
1414
# nodejs: "19"
1515
# rust: "1.64"
1616
# golang: "1.19"
17+
# apt_packages:
18+
# - some_package
19+
1720

1821
# Build documentation in the "docs/" directory with Sphinx
1922
sphinx:

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023: Jakob Nybo Nissen.
3+
Copyright (c) 2025: First Last.
44

55
Permission is hereby granted, free of charge, to any person obtaining
66
a copy of this software and associated documentation files (the

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Example Python package
22

3+
All design principles are explained in the [developing.md](developing.md) file.
4+
The Python package template was created by Jakob Nybo Nissen and Henry Webel.
5+
36
## How to use
47

58
Can be used as GitHub template repository,
@@ -8,10 +11,15 @@ see [GitHub documentation](https://docs.github.com/en/repositories/creating-and-
811
You will need to find and replace occurences of
912

1013
- `python_package` -> `your_package_name`
14+
- also the folder `src/python_package`
1115
- `RasmussenLab` -> `GitHub_user_name` (or `organization`)
12-
1316
with the name of your package and GitHub user name (or organization).
1417

18+
- look for `First Last` to see where to replace with your name
19+
- choose a license, see [GitHub documentation](https://docs.github.com/en/repositories/creating-and-managing-repositories/licensing-a-repository)
20+
and [Creative Commons](https://creativecommons.org/chooser/).
21+
Replace [`LICENSE`](LICENSE) file with the license you choose.
22+
1523
## Development environment
1624

1725
Install package so that new code is picked up in a restared python interpreter:
@@ -22,6 +30,8 @@ pip install -e ".[dev]"
2230

2331
## Basic usage
2432

33+
> works using this template
34+
2535
```python
2636
from python_package import hello_world
2737
print (python_package.__version__)
@@ -31,8 +41,9 @@ print(hello_world(4))
3141
## Readthedocs
3242

3343
The documentation can be build using readthedocs automatically. See
34-
[project on Readthedocs](https://readthedocs.org/projects/rasmussenlab-python-package/) for the project. A new project needs
35-
to be registered.
44+
[project on Readthedocs](https://readthedocs.org/projects/rasmussenlab-python-package/)
45+
for the project based on this template. A new project needs
46+
to [be registered on ReadTheDocs](https://docs.readthedocs.com/platform/stable/intro/add-project.html).
3647

3748
- make sure to enable build from PRs in the settings (advanded settings)
3849
- checkout configuration file: [`.readthedocs.yaml`](.readthedocs.yaml)

0 commit comments

Comments
 (0)