Commit graph

29 commits

Author SHA1 Message Date
351146dbe9
Release v0.4.2
Some checks failed
audit / audit (push) Has been cancelled
docs / docs (push) Has been cancelled
lint / lint (push) Has been cancelled
test-coverage / test-coverage (push) Has been cancelled
test-docstrings / test-docstrings (push) Has been cancelled
tests / test-3.10 (push) Has been cancelled
tests / test-3.11 (push) Has been cancelled
tests / test-3.12 (push) Has been cancelled
tests / test-3.9 (push) Has been cancelled
2024-09-10 03:46:29 +02:00
fbc9b5f134
Prepare release v0.4.2 2024-09-10 03:39:30 +02:00
d77e96c426
Merge branch 'set-up-project' into 'develop' 2024-09-10 03:33:50 +02:00
0b5cc56925
Drop nox-poetry support
Whereas nox-poetry is a nice project,
it is not (yet) widely supported.

The `install_pinned()` function inside the "noxfile.py"
achieves most of its functionality.

Also, there is a chance poetry will be replaced in this project.

So, we no longer drag nox-poetry along.
2024-09-10 03:28:17 +02:00
97b91c676e
Add a "clean-cwd" task
- add nox session "clean-cwd" to clean the working directory
- the task is roughly `git clean -X` with minor exceptions
2024-09-10 03:26:06 +02:00
dd868cce4d
Run poetry publish on GitHub actions 2024-09-10 03:22:52 +02:00
b92d871acf
Integrate readthedocs.io
We publish the docs to readthedocs.io
2024-09-10 03:12:22 +02:00
3f8b5cb146
Integrate codecov.io
We publish the test coverage reporting to codecov.io
2024-09-10 03:10:26 +02:00
5518837cbc
Run nox -s test-docstrings on GitHub actions
The xdoctest integration in pytest (see tests/test_docstrings.py)
is prone to miss docstrings in new source files as they must be
included in the test case explicitly.

So, to play it safe, we run the nox session "test-docstrings" on CI.
2024-09-10 03:00:56 +02:00
9c6cae3593
Run nox -s test-coverage on GitHub actions 2024-09-10 02:53:35 +02:00
62f7a79abf
Run nox -s test on GitHub actions 2024-09-10 02:50:06 +02:00
3e3182353e
Run nox -s lint on GitHub actions 2024-09-10 02:47:46 +02:00
f98491a6b5
Run nox -s docs on GitHub actions 2024-09-10 02:45:58 +02:00
c6763003db
Run nox -s audit on GitHub actions 2024-09-10 02:36:10 +02:00
7a5246556a
Set up pre-commit hooks
- add pre-commit hooks:
  + run `nox -s lint` on staged *.py files
  + run common pre-commit hooks for validations that could not be
    achieved with tools in the develop environment so easily
- add pre-merge hook:
  + run `nox -s _pre-commit-test-hook` before merges
    * ignores the paths to staged files
      passed in by the pre-commit framework
    * runs all test cases instead
2024-09-10 02:32:56 +02:00
c07a9ed19f
Set up a documentation tool
- use sphinx to document the developed package
- create nox session "docs" to build the docs
2024-09-10 02:09:09 +02:00
0a85e60b51
Set up a dependency auditing tool
- use pip-audit to check the project's dependencies for known
  security vulnerabilities and exploits
- add nox sessions "audit" and "audit-updates" to run
  the above checks against the pinned and unpinned dependencies
2024-09-10 02:03:01 +02:00
6945cdef0a
Add coverage reporting to the test suite
- the nox session "test-coverage" triggers further nox sessions
  that run the test suite for all supported Python versions
- the nox session "_test-coverage-run" runs the test suite for
  a particular Python version using the coverage tool
- the nox session "_test-coverage-report" combines the individual
  coverage reports
2024-09-10 02:01:23 +02:00
01d270e39c
Add doctests to the test suite
- use xdoctest to validate code snippets in docstrings
- make xdoctest part of the nox session "test" via
  the new `test_docstrings()` test case
- add nox session "test-docstrings" for convenience;
  also, `xdoctest.doctest_module()` does not discover
  docstrings that are imported at the root of the package
  => each new module with docstrings must be added to
     `test_docstrings()` by hand, which is likely forgotten
  => the nox session "test-docstrings" should run on CI
2024-09-10 01:57:02 +02:00
4100a7f3f5
Add __version__ identifier
- `lalib.__version__` is dynamically assigned
- the format is "x.y.z[.dev0|aN|bN|rcN|.postM]"
  where x, y, z, M, and N are non-negative integers
  + x, y, and z model the "major", "minor", and "patch"
    parts of semantic versioning
    (See: https://semver.org/#semantic-versioning-200)
  + M is a single digit and N either 1 or 2
  => This complies with (a strict subset of) PEP440
- add unit tests for the `__version__` identifier
2024-09-10 01:45:47 +02:00
b8ceee39c5
Set up a test suite
- use pytest as the test suite and
  measure test coverage with coverage.py
- add package for the test suite under tests/
- add nox session "test" to run the test suite
  for all supported Python versions
- use flake8 to lint pytest for consistent style
2024-09-10 01:38:26 +02:00
ecf1420742
Set up code linting tools
- use flake8 as the main linting tool with the following plug-ins:
  + flake8-annotations
  + flake8-bandit
  + flake8-black
  + flake8-broken-line
  + flake8-bugbear
  + flake8-commas
  + flake8-comprehensions
  + flake8-debugger
  + flake8-docstrings
  + flake8-eradicate
  + flake8-isort
  + flake8-quotes
  + flake8-string-format
  + flake8-pyproject
  + pep8-naming
  + pydoclint
- use mypy for static type checking
- use ruff for linting for future compatibility
- add nox session "lint" to run these tools
- add `ruff check --fix ...` in nox session "format"
- lint all source files => no errors found
2024-09-10 01:33:54 +02:00
fb407631d9
Set up code formatting tools
- auto-format code with:
  + autoflake => * remove unused imports and variables
                 * remove duplicate dict keys
                 * expand star imports
  + black => enforce an uncompromising code style
  + isort => enforce a consistent import style
             compliant with Google's Python style guide
- add nox session "format" to run these tools
2024-09-10 01:27:34 +02:00
ceabb00bab
Set up nox as the task runner
- base configuration for all nox sessions to come
- add infos about nox in the README file
- ignore [py]cache folders in git
2024-09-10 01:21:37 +02:00
e832333ed9
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
2024-09-10 01:15:36 +02:00
c7d8b7f283
Add README file
- describe the project's goals
- contributions are welcome
- mention the GitFlow branching model
2024-09-10 01:02:32 +02:00
8ebd6c9f71
Add open-source license
MIT license because the project is for everybody
2024-09-10 00:45:24 +02:00
3416deccb9
Math is the language of the universe. 2024-09-10 00:43:00 +02:00
9241b363b5
Reinventing the wheel. Again. 2024-09-10 00:32:55 +02:00