Skip to content
  1. Sep 10, 2024
    • Alexander Hess's avatar
      Run `nox -s lint` on GitHub actions · 3e318235
      Alexander Hess authored
      3e318235
    • Alexander Hess's avatar
      Run `nox -s docs` on GitHub actions · f98491a6
      Alexander Hess authored
      f98491a6
    • Alexander Hess's avatar
      Run `nox -s audit` on GitHub actions · c6763003
      Alexander Hess authored
      c6763003
    • Alexander Hess's avatar
      Set up pre-commit hooks · 7a524655
      Alexander Hess authored
      - 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
      7a524655
    • Alexander Hess's avatar
      Set up a documentation tool · c07a9ed1
      Alexander Hess authored
      - use sphinx to document the developed package
      - create nox session "docs" to build the docs
      c07a9ed1
    • Alexander Hess's avatar
      Set up a dependency auditing tool · 0a85e60b
      Alexander Hess authored
      - 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
      0a85e60b
    • Alexander Hess's avatar
      Add coverage reporting to the test suite · 6945cdef
      Alexander Hess authored
      - 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
      6945cdef
    • Alexander Hess's avatar
      Add doctests to the test suite · 01d270e3
      Alexander Hess authored
      - 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
      01d270e3
    • Alexander Hess's avatar
      Add `__version__` identifier · 4100a7f3
      Alexander Hess authored
      - `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
      4100a7f3
    • Alexander Hess's avatar
      Set up a test suite · b8ceee39
      Alexander Hess authored
      - 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
      b8ceee39
    • Alexander Hess's avatar
      Set up code linting tools · ecf14207
      Alexander Hess authored
      - 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
      ecf14207
    • Alexander Hess's avatar
      Set up code formatting tools · fb407631
      Alexander Hess authored
      - 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
      fb407631
    • Alexander Hess's avatar
      Set up nox as the task runner · ceabb00b
      Alexander Hess authored
      - base configuration for all nox sessions to come
      - add infos about nox in the README file
      - ignore [py]cache folders in git
      ceabb00b
    • Alexander Hess's avatar
      Initialize the project · e832333e
      Alexander Hess authored
      - 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
      e832333e
    • Alexander Hess's avatar
      Add README file · c7d8b7f2
      Alexander Hess authored
      - describe the project's goals
      - contributions are welcome
      - mention the GitFlow branching model
      c7d8b7f2
    • Alexander Hess's avatar
      Add open-source license · 8ebd6c9f
      Alexander Hess authored
      MIT license because the project is for everybody
      8ebd6c9f
    • Alexander Hess's avatar
      Math is the language of the universe. · 3416decc
      Alexander Hess authored
      3416decc
Loading