Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to src layout #23

Merged
merged 1 commit into from
Feb 16, 2022
Merged

Move to src layout #23

merged 1 commit into from
Feb 16, 2022

Conversation

V02460
Copy link
Contributor

@V02460 V02460 commented Feb 12, 2022

Moves the project to a src layout, which means that all regular modules reside inside the src folder. For this project, this moves only the matrix_common module.

The most important aspect of this change is the tests module now being separated from the regular modules. Separating the two types of modules allows them to be put (and not put!) on the Python path individually, which is not simply possible otherwise. This enables the use case of testing actually installed modules, which means running tests without mandatorily having the nearby modules overshadow the Python path.

Closes #16.

(Should be the last nickpicky PR for a while)

Signed-off-by: Kai A. Hiller <[email protected]>
@V02460 V02460 requested a review from a team as a code owner February 12, 2022 01:42
Copy link
Contributor

@squahtx squahtx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does pyproject.toml need updating too? It has these lines:

known_first_party = [
    "matrix_common",
    "tests"
]

@squahtx squahtx self-assigned this Feb 16, 2022
@DMRobertson
Copy link
Contributor

Does pyproject.toml need updating too? It has these lines:

known_first_party = [
    "matrix_common",
    "tests"
]

IIRC that's isort configuration. It's listing module names, not their paths---I think it's correct both before and after this change.

@squahtx squahtx merged commit c734157 into matrix-org:main Feb 16, 2022
babolivier added a commit to matrix-org/python-canonicaljson that referenced this pull request Sep 23, 2022
Package canonicaljson as a proper module rather than a single-file module. The main motivation is to expose the py.typed marker file so other projects can use the typing annotations.

I've decided to go with an src/ layout for the module's source rather than the solution proposed in #50 (comment) to avoid a repeat of matrix-org/matrix-python-common#23.

Fixes #50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make it easier to run tests for installed package
3 participants