@@ -40,22 +40,22 @@ python_package
4040
4141## Core packaging files
4242
43- We will first look at [ ` pyproject.toml ` ] ( pyproject.toml ) and its relation to the
44- [ ` src ` ] ( src ) directory. The
45- [ ` pyproject.toml ` ] ( pyproject.toml ) file is the main configuration file for the Python package
43+ We will first look at [ ` pyproject.toml ` ] ( ./ pyproject.toml) and its relation to the
44+ ` src ` directory. The
45+ [ ` pyproject.toml ` ] ( ./ pyproject.toml) file is the main configuration file for the Python package
4646and is used to specify the package metadata, dependencies, build tools and configurations.
47- The [ ` src ` ] ( src ) folder stores the actual source code of the package, where the package itself is
48- the subdirectories of the [ ` src ` ] ( src ) directory. The (e.g. ` src/python_package ` ).
47+ The ` src ` folder stores the actual source code of the package, where the package itself is
48+ the subdirectories of the ` src ` directory. The (e.g. ` src/python_package ` ).
4949
5050<details >
5151<summary >About <code >setup.py</code > and <code >setup.cfg</code > configuration files</summary >
5252
53- The [ ` setup.py ` ] ( setup.py ) file is an artefact for backward compatibility and should not
54- be changed. Everything that used to be in [ ` setup.py ` ] ( setup.py ) or
55- [ ` setup.cfg ` ] ( setup.cfg ) is now largely in [ ` pyproject.toml ` ] ( pyproject.toml ) .
53+ The [ ` setup.py ` ] ( ./ setup.py) file is an artefact for backward compatibility and should not
54+ be changed. Everything that used to be in [ ` setup.py ` ] ( ./ setup.py) or
55+ [ ` setup.cfg ` ] ( ./ setup.cfg) is now largely in [ ` pyproject.toml ` ] ( ./ pyproject.toml) .
5656The notable exception would be the desired maximum line length in ` setup.cfg ` for
5757the tool [ ` flake8 ` ] ( https://flake8.pycqa.org/ ) , which does not yet supported
58- [ ` pyproject.toml ` ] ( pyproject.toml ) configuration. As we use ` ruff ` as linter,
58+ [ ` pyproject.toml ` ] ( ./ pyproject.toml) configuration. As we use ` ruff ` as linter,
5959we left it empty, but in case you want to use ` flake8 ` , you can add:
6060
6161``` INI
@@ -116,13 +116,13 @@ dynamic = ["version"]
116116
117117means that the version is loaded dynamically using the extension
118118[ setuptools_scm] ( https://setuptools-scm.readthedocs.io/ )
119- we list under the ` [build-system] ` section in [ ` pyproject.toml ` ] ( pyproject.toml ) .
119+ we list under the ` [build-system] ` section in [ ` pyproject.toml ` ] ( ./ pyproject.toml) .
120120This is done to avoid having to manually update the version and integrate with automatic
121121versioning through releases on GitHub. It also
122122ensures that each commit has a unique version number, which is useful for attributing
123123errors to specific non-released versions. The dynamic version is picked up in the
124124` __version__ ` variable in the ` __init__.py ` file of the package, which is located in the
125- [ ` src/python_package ` ] ( src/python_package ) directory.
125+ ` src/python_package ` directory.
126126
127127``` toml
128128[build-system ]
@@ -182,7 +182,7 @@ in the same project under the `python_package` package (see example
182182```
183183
184184So you will need to rename the ` python_package ` directory to your package name,
185- e.g. ` my_package ` and specify the package name in the [ ` pyproject.toml ` ] ( pyproject.toml ) file
185+ e.g. ` my_package ` and specify the package name in the [ ` pyproject.toml ` ] ( ./ pyproject.toml) file
186186under the ` [project] ` section:
187187
188188``` toml
@@ -191,7 +191,7 @@ name = "my_package"
191191
192192Strictly speaking you can give different names in both places, but this will only confuse
193193potential users. Think of ` scikit-learn ` for an example of a package that uses a different
194- name in the [ ` pyproject.toml ` ] ( pyproject.toml ) file and the source code directory name,
194+ name in the [ ` pyproject.toml ` ] ( ./ pyproject.toml) file and the source code directory name,
195195leading to the ` sklearn ` package name when imported.
196196
197197## Documentation
@@ -200,8 +200,8 @@ The documentation is created using [Sphinx](https://www.sphinx-doc.org/en/master
200200which is common for Python documentation. It relies additionally on several extensions
201201enabling the use of ` markdown ` and ` jupyter ` notebooks.
202202
203- The documentation is located in the [ ` docs ` ] ( docs ) directory. Sphinx is configured via
204- the [ ` conf.py ` ] ( docs/conf.py ) file, where you can specify the extension you want:
203+ The documentation is located in the ` docs ` directory. Sphinx is configured via
204+ the [ ` conf.py ` ] ( ./ docs/conf.py) file, where you can specify the extension you want:
205205
206206``` python
207207# in docs/conf.py
@@ -237,7 +237,7 @@ docs = [
237237
238238### Required changes in ` conf.py `
239239
240- The required changes in [ ` conf.py ` ] ( docs/conf.py ) are at the following places:
240+ The required changes in [ ` conf.py ` ] ( ./ docs/conf.py) are at the following places:
241241
242242``` python
243243# in docs/conf.py
@@ -273,8 +273,8 @@ package on the fly. See the Read The Docs section below for more details.
273273
274274We build the documentation based on the template
275275[ sphinx_book_theme] ( https://sphinx-book-theme.readthedocs.io ) , which is set in the
276- [ ` conf.py ` ] ( docs/conf.py ) file and parts of our docs requirements in
277- [ ` pyproject.toml ` ] ( pyproject.toml ) :
276+ [ ` conf.py ` ] ( ./ docs/conf.py) file and parts of our docs requirements in
277+ [ ` pyproject.toml ` ] ( ./ pyproject.toml) :
278278
279279``` python
280280html_theme = " sphinx_book_theme"
@@ -308,8 +308,8 @@ like `pandas`, `scikit-learn`, or `matplotlib` to the mapping.
308308### Building the documentation locally (with integration tests)
309309
310310To build the documentation locally, you can follow the instructions in the
311- [ ` docs/README.md ` ] ( docs/README.md ) , which you should also update with your name changes.
312- In short, you can run the following commands in the [ ` docs ` ] ( docs ) directory:
311+ [ ` docs/README.md ` ] ( ./ docs/README.md) , which you should also update with your name changes.
312+ In short, you can run the following commands in the ` docs ` directory:
313313
314314``` bash
315315# in root of the project
@@ -320,7 +320,7 @@ sphinx-build -n -W --keep-going -b html ./ ./_build/
320320```
321321
322322this will create a ` reference ` directory with the API documentation of the Python package
323- ` python_package ` , a ` jupyter_execute ` for the tutorial in [ ` docs/tutorial ` ] ( docs/tutorial )
323+ ` python_package ` , a ` jupyter_execute ` for the tutorial in ` docs/tutorial `
324324 and a ` _build ` directory with an HTML version of the documentation. You can open the
325325` _build/index.html ` file in your browser to view the documentation built locally.
326326
@@ -356,15 +356,15 @@ You have to keep the files in sync using:
356356jupytext --sync docs/tutorial/* .ipynb
357357```
358358
359- The [ ` docs/tutorial/.jupytext ` ] ( docs/tutorial/.jupytext ) configuration sets the default
359+ The [ ` docs/tutorial/.jupytext ` ] ( ./ docs/tutorial/.jupytext) configuration sets the default
360360format to ` py:percent ` and automatically allows syncing of new notebooks.
361361
362362### Read The Docs
363363
364364To build the documentation on Read The Docs, you need to create a file called
365- [ ` .readthedocs.yaml ` ] ( .readthedocs.yaml ) , which is located in the root of the project and
365+ [ ` .readthedocs.yaml ` ] ( ./. readthedocs.yaml ) , which is located in the root of the project and
366366specifies which dependencies are needed. The core is the following specifying where the
367- [ ` conf.py ` ] ( docs/conf.py ) file is and from where to install the required dependencies:
367+ [ ` conf.py ` ] ( ./ docs/conf.py) file is and from where to install the required dependencies:
368368
369369``` yaml
370370# Build documentation in the "docs/" directory with Sphinx
@@ -384,7 +384,7 @@ You will need to manually register your project repository on
384384by the service. I recommend to activate builds for Pull Requests, so that
385385the documentation is built for each PR and you can see if the documentation is gradually
386386breaking, i.e. your integration test using the notebooks in
387- [ ` docs/tutorial`](docs/tutorial) fail. See their documentation
387+ ` docs/tutorial` fail. See their documentation
388388[on adding a project](https://docs.readthedocs.com/platform/stable/intro/add-project.html)
389389for instructions.
390390
@@ -414,7 +414,7 @@ read the next section to see how this is automated using `GitHub Actions`.
414414# # GitHub Actions
415415
416416We run these checks also on GitHub using GitHub Actions. The configuration
417- for the actions is located in the [ `.github/workflows`](.github/workflows) directory
417+ for the actions is located in the `.github/workflows` directory
418418and is specified in the `cdci.yml` file. See the biosustain dsp tutorial on GitHub Actions
419419for more details (or any other resource you find) :
420420[biosustain/dsp_actions_tutorial](https://github.com/biosustain/dsp_actions_tutorial)
0 commit comments