- Added more Systems.
- Added new Lyapunov spectrum measure.
- Added new simulation backend.
- Added example folder.
- Added static folder to generate animation in readme.
- Changed plotly dependency to matplotlib.
- More smaller improvements...
- First release of
lorenzpy
- Now using pre-commit as an automatic CI tool.
- pre-commit runs some standard hooks, black, ruff and mypy.
- The config for black, ruff and mypy is still in
pyproject.toml
- To run the pre-commit manual, run
pre-commit run --all-files
- To reinstall the pre-commits, run
pre-commit install
- My pre-commit GH action is running on ubuntu on python3.9
- Note: There is some redundancy, as I have to specify the versions of
black, ruff and mypy twice. Once in the
.pre-commit-config.yaml
and once in thepyproject.toml
. Maybe I am only specifying which hook to use in the.pre-commit-config.yaml
. - Q:
- Should I add the tests also to pre-commit?
- When to test?
Development features:
-
Use Black for formatting the code.
- Local terminal usage:
black .
- Config in
pyproject.toml
- Set line-length to
88
, set python versions topy8
topy11
- Set line-length to
- GitHub Actions:
- Just check with black by running:
black --check .
- Just check with black by running:
- Local terminal usage:
-
Use Ruff as the Python linter.
- Local terminal usage:
ruff check .
- Config in
pyproject.toml
- set line-length, the Rules (pycodestyle, pyflakes, pydocstyle, isort),
the source files, and to ignore rule F401 to not complain about unused imports
in
__init__
files.
- set line-length, the Rules (pycodestyle, pyflakes, pydocstyle, isort),
the source files, and to ignore rule F401 to not complain about unused imports
in
- GitHub Actions:
- run
ruff check --format=github .
- run
- Local terminal usage:
-
Use MyPy as for type checking.
- Local terminal usage:
mypy
- Config in
pyproject.toml
- Specify files:
src/lorenzpy/
- Ignore missing imports for
plotly
- Specify files:
- GitHub Actions:
- Just running
mypy
- Just running
- Local terminal usage:
-
Testing with pytest-cov
- Local terminal usage:
pytest
- Config in
pyproject.toml
- automatically add the following options when
pytest
is run:--verbose --cov-config=pyproject.toml --cov-report term-missing --cov=lorenzpy
- Note: This is somehow important for GitHub actions to work fine...
- Omit the
plot
folder for the coverage.
- automatically add the following options when
- GitHub Actions:
- simply running
pytest
and then uploading the coverage reports to Codecov using the GitHub action: codecov-action
- simply running
- Local terminal usage:
-
Generating docs with mkdocs:
- Following this tutorial
- Generate the docs with
mkdocs gh-deploy
- Use the plugin mkdocstrings to automatically use the code-docstrings in the documentation.
Deployment on PyPI with GitHub Actions:
- Following the PyPA tutorial
- Also use this PyPA tutorial to manually upload the package to test PyPI.
- This uses
build
andtwine
- This uses
Resources: Taking inspiration from: https://github.com/dkmiller/modern-python-package, and https://github.com/denkiwakame/py-tiny-pkg.