Skip to content

Add pip compatibility

Vodstrčil, Jan requested to merge vodstja1/kui-maze2:main into main

Add a [tool.setuptools] entry to pyproject.toml so that the repository can be installed as a pip package in one of the following ways:

  • running pip install -e git+https://gitlab.fel.cvut.cz/kui-student-materials/kui-maze2#egg=kuimaze
  • adding one of the following lines to requirements.txt and running pip install -r requirements.txt:
    • -e git+https://gitlab.fel.cvut.cz/kui-student-materials/kui-maze2#egg=kuimaze
    • kuimaze @ git+https://gitlab.fel.cvut.cz/kui-student-materials/kui-maze2 (pip 20.1 or newer, see here)

Without this addition, attempting any of the above results in the following error:

error: Multiple top-level packages discovered in a flat-layout: ['maps', 'kuimaze2', 'maps_difficult']
[...]
consider the following options:
      
      1. set up custom discovery (`find` directive with `include` or `exclude`)
      2. use a `src-layout`
      3. explicitly set `py_modules` or `packages` with a list of names

This MR implements option 3 suggested by the error message. It was also inspired by this StackOverflow comment.

Since this repository is public, no additional authentication would be required for students to install the packages in this way.

Merge request reports