Initialize the project

- describe how a local develop environment can be set up
- we use poetry to manage the project
  => add pyproject.toml and poetry.lock files
- add a package for the source code
  => "src" layout structure to ensure that pytest runs the tests
     against a packaged version installed in a virtual environment
     and not the *.py files in the project directory
     (Source: https://hynek.me/articles/testing-packaging/)
- ignore poetry's artifacts in git
This commit is contained in:
Alexander Hess 2024-09-10 01:15:36 +02:00
parent c7d8b7f283
commit e832333ed9
Signed by: alexander
GPG key ID: 344EA5AB10D868E0
5 changed files with 82 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.venv/

View file

@ -17,6 +17,34 @@ All contributions become open-source themselves, under the
[MIT license](https://github.com/webartifex/lalib/blob/main/LICENSE.txt). [MIT license](https://github.com/webartifex/lalib/blob/main/LICENSE.txt).
### Local Develop Environment
In order to play with the `lalib` codebase,
you need to set up a develop environment on your own computer.
First, get your own 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 packages and tools be installed
to ensure code quality during development.
These can be viewed in the
[pyproject.toml](https://github.com/webartifex/lalib/blob/main/pyproject.toml) file
and are managed with [poetry](https://python-poetry.org/docs/)
which needs to be installed as well.
`poetry` also creates and manages a
[virtual environment](https://docs.python.org/3/tutorial/venv.html)
with the develop tools,
and pins their exact installation versions in the
[poetry.lock](https://github.com/webartifex/lalib/blob/main/poetry.lock) file.
To replicate the project maintainer's develop environment, run:
`poetry install`
### Branching Strategy ### Branching Strategy
The branches in this repository follow the The branches in this repository follow the

6
poetry.lock generated Normal file
View file

@ -0,0 +1,6 @@
package = []
[metadata]
lock-version = "2.0"
python-versions = "^3.9"
content-hash = "0ef693f84017d54b0ea1d26b405d979fc57973167b307ccd9ed780ad9bdc1a3a"

46
pyproject.toml Normal file
View file

@ -0,0 +1,46 @@
[tool.poetry]
name = "lalib"
version = "0.4.2.dev0"
authors = [
"Alexander Hess <alexander@webartifex.biz>",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
description = "A Python library to study linear algebra"
license = "MIT"
readme = "README.md"
homepage = "https://github.com/webartifex/lalib"
repository = "https://github.com/webartifex/lalib"
[tool.poetry.dependencies]
python = "^3.9"
[tool.poetry.group.dev.dependencies]
[tool.poetry.urls]
"Issues Tracker" = "https://github.com/webartifex/lalib/issues"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

1
src/lalib/__init__.py Normal file
View file

@ -0,0 +1 @@
"""A Python library to study linear algebra."""