A library in core Python to study linear algebra
Project description
lalib
- A library to study linear algebra
The goal of this project is to create a library written solely in core Python (incl. the standard library) to learn about linear algebra.
Contributing & Development
Local Develop Environment
Get a copy of this repository:
git clone git@github.com:webartifex/lalib.git
While lalib
comes without any dependencies except core Python
and the standard library for the user,
we assume a couple of mainstream packages to be installed
to ensure code quality during development.
These can be viewed in the pyproject.toml file.
To replicate the project maintainer's develop environment, install the pinned dependencies from the poetry.lock file with the poetry dependency manager:
poetry install
This automatically creates and uses a virtual environment.
Testing & Maintenance Tasks
We use nox to run the test suite
in an isolated environment
and to invoke the prepared maintenance tasks during development
(nox
is quite similar to tox).
It is configured in the noxfile.py file.
To list all available tasks, called sessions in nox
, simply run:
poetry run nox --list
To execute all sessions that the CI server would run, invoke:
poetry run nox
That runs the test suite for all supported Python versions.
Code Formatting & Linting
We follow Google's Python Style Guide and include type hints where possible.
During development, poetry run nox -s format
and poetry run nox -s lint
may
be helpful.
The first task formats all source code files with
autoflake,
black, and
isort.
black
keeps single quotes '
unchanged to minimize visual noise
(single quotes are enforced by wemake-python-styleguide
; see next).
The second task lints all source code files with
flake8,
mypy, and
pylint.
flake8
is configured with a couple of plug-ins,
most notably wemake-python-styleguide.
You may want to install the local pre-commit hooks that come with the project:
poetry run nox -s init-project
That automates the formatting and linting before every commit. Also, the test suite is run before every merge.
Branching Strategy
The branches in this repository follow the GitFlow model.
It is assumed that a feature branch is rebased before it is merged into develop
.
Whereas after a rebase a simple fast-forward merge is possible,
all merges are made with explicit and empty merge commits
(i.e., the merge itself does not change a single line of code).
This ensures that past branches remain visible in the logs,
for example, with git log --graph
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.