Skip to content
  1. Aug 05, 2020
  2. Aug 04, 2020
    • Alexander Hess's avatar
      Add security checks for the dependencies · 48fe2f68
      Alexander Hess authored
      - add a nox session "safety"
      48fe2f68
    • Alexander Hess's avatar
      Run type checks only against packaged *.py files · 8586db58
      Alexander Hess authored
      - for tests/ and the noxfile.py, type annotations are not strictly
        enforced any more
        + this simplifies the way test cases and nox sessions are written
        + for many pytest fixtures, no types are available via a public API
      - put fixtures inside the classes the corresponding test cases are
        grouped in
      8586db58
    • Alexander Hess's avatar
      Add CLI entry point `umd` · 97d714d9
      Alexander Hess authored
      - add the following file:
        + src/urban_meal_delivery/console.py => click-based CLI tools
        + tests/test_console.py => tests for the module above
      - add a CLI entry point `umd`:
        + implement the --version / -V option
          to show the installed package's version
        + rework to package's top-level:
          * add a __pkg_name__ variable to parameterize the package name
        + add unit and integration tests
      - fix that pylint cannot know the proper order of imports in the
        isolated nox session
      97d714d9
    • Alexander Hess's avatar
      Set up pre-commit hooks · da233e2e
      Alexander Hess authored
      - add pre-commit and pre-merge hooks:
        + run `poetry run nox -s pre-commit` on staged *.py files
        + run common pre-commit hooks for validations that could not be
          achieved with tools in the develop environment so easily
        + run `poetry run nox -s pre-merge` before merges and pushes
      - implement the "pre-commit" and "pre-merge" sessions in nox
        + include a little hack to deal with the positional arguments
          passed by the pre-commit framework
      - provide more documentation on the nox sessions
      da233e2e
    • Alexander Hess's avatar
      Add a testing tool chain · 9fc5b481
      Alexander Hess authored
      - 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
      9fc5b481
  3. Aug 03, 2020
    • Alexander Hess's avatar
      Add a code linting tool chain · c7989e00
      Alexander Hess authored
      - 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
      c7989e00
    • Alexander Hess's avatar
      Add a code formatting tool chain · bb6de057
      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
                   (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
      bb6de057
    • Alexander Hess's avatar
      Add nox as the task runner · 6754f04f
      Alexander Hess authored
      - 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
      6754f04f
    • Alexander Hess's avatar
      Initial commit · de8afa63
      Alexander Hess authored
      - add the following files:
        + .gitignore => ignore poetry's and pyenv's artifacts
        + LICENSE.txt => MIT license as the project is scientific research
        + README.md => rough description of the project
        + poetry.lock
        + pyproject.toml
        + src/urban_meal_delivery/__init__.py => source code package
      - use a "src" layout structure:
        + ensure that pytest runs the tests against a packaged and pip
          installed version of the source code, not the *.py files in the
          project directory
        + more info: https://hynek.me/articles/testing-packaging/
      de8afa63
Loading