Commit graph

4 commits

Author SHA1 Message Date
9fc5b4816a
Add a testing tool chain
- use pytest as the base, measure coverage with pytest-cov
  + configure coverage to include branches and specify source locations
  + configure pytest to enforce explicit markers
- add a package for the test suite under tests/
- add a `__version__` identifier at the package's root
  + it is dynamically assigned the version of the installed package
  + the version is PEP440 compliant and follows a strict subset of
    semantic versioning: x.y.z[.devN] where x, y, z, and N are all
    non-negative integers
  + add module with tests for the __version__
- add a nox session "test" that runs the test suite
- use flake8 to lint pytest for consistent style
2020-08-04 00:09:29 +02:00
c7989e0040
Add a code linting tool chain
- use flake8 as the main and pylint as the auxiliary linter
- install flake8 with the following plug-ins:
  + flake8-annotations => enforce type annotations for functions/classes
  + flake8-black => ensure black would not make any changes
  + flake8-expression-complexity
  + wemake-python-styleguide, which packages the following:
    * darglint         * flake8-bandit         * flake8-broken-line
    * flake8-bugbear   * flake8-commas         * flake8-comprehensions
    * flake8-debugger  * flake8-docstrings     * flake8-eradicate
    * flake8-isort     * flake8-rst-docstrings * flake8-string-format
    * flake8-quotes    * pep8-naming
- configure flake8 & friends in a rather explicit and strict way
- isort needed to be downgraded to ^4.3.21 due to a conflict with
  pylint and wemake-python-styleguide:
  + provide TODO's to remove the parts that "fix" isort
- use mypy for static type checking
- add a nox session "lint" that runs flake8, mypy, and pylint
- lint all source files
2020-08-03 23:12:12 +02:00
bb6de05709
Add a code formatting tool chain
- (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
             (complying with Google's Python Style Guide)
- implement the nox session "format" that runs all these tools
- add the following file:
  + setup.cfg => holds configurations for the develop tools
2020-08-03 21:39:49 +02:00
6754f04fcd
Add nox as the task runner
- set up skeletons for all planned nox sessions
- provide a base configuration for all nox sessions
- create two utility functions:
  + _begin() => run commands common to all sessions
  + _install_packages() => install dependencies in nox sessions
                           respecting the versions pinned in poetry.lock
- add the following file:
  + noxfile.py
2020-08-03 21:24:06 +02:00