Allow for setuptools to automatically discover new modules under src/matrix_common
#27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While trying to add a Python module at
src/matrix_common/types, I ran into the issue thatpip install -e .would not actually find the new module! This would result in calls totox -e pyto fail as my new module wouldn't be included in the source distribution ofmatrix_common(which tox builds and installs when creating its own virtualenv for testing). My tests needed to import from this new module in order to test it.So, running down the rabbit hole of python packaging I eventually found that our existing
setup.cfgwas not making use of setuptools' autodiscovery features, but instead required manually specifying each package. See the documentation here.Adding my new module to
packagesindeed worked, but as the documentation says, it is tiresome and likely going to confuse new contributors as it did me.This PR removes the
package_dirandpackagesoptions insetup.cfgto allow setuptools to switch to Automatic Discovery mode for packages; specifically the one forsrc-layout.With this, running
pip install -e .allowed mysrc/matrix_common/typesmodule to be discovered and my tests which import the module to pass with when runningtox.Related: #23 (which moved us to a src-based file hierarchy initially).