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

build: adopt src layout #62

Merged
merged 2 commits into from
Oct 23, 2024
Merged

build: adopt src layout #62

merged 2 commits into from
Oct 23, 2024

Conversation

bonjourmauko
Copy link
Member

@bonjourmauko bonjourmauko commented Oct 22, 2024

Depends on #61

  • Technical improvement
  • Impacted areas: all
  • Details:
    • Adopt src layout to avoid importing bugs and properly testing built versions

From: https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/

The src layout involves an additional step in the development workflow of a
project (typically, an editable installation is used for development and a
regular installation is used for testing).

(...)

The src layout helps enforce that an editable installation is only able to
import files that were meant to be importable.

(...)

This is especially relevant when the editable installation is implemented
using a path configuration file that adds the directory to the import path.

@bonjourmauko bonjourmauko added the kind:build Changes that affect the build system or external dependencies label Oct 22, 2024
@bonjourmauko bonjourmauko requested review from a team October 22, 2024 15:37
@bonjourmauko bonjourmauko self-assigned this Oct 22, 2024
@bonjourmauko bonjourmauko force-pushed the build/adopt-src-layout branch from 91f4cbf to 0f27393 Compare October 22, 2024 17:53
Copy link
Contributor

@benoit-cty benoit-cty left a comment

Choose a reason for hiding this comment

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

Reading the doc you provide, I see The src layout requires installation of the project to be able to run its code, and the flat layout does not. does this done automatically by Poetry or does the developer needs to do something about it ?

@bonjourmauko
Copy link
Member Author

Reading the doc you provide, I see The src layout requires installation of the project to be able to run its code, and the flat layout does not. does this done automatically by Poetry or does the developer needs to do something about it ?

Poetry does it automatically. This just helps to avoid accidentally testing in dev mode.

Base automatically changed from build/add-shellcheck to master October 23, 2024 08:28
From: https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/

The src layout involves an additional step in the development workflow of a
project (typically, an editable installation is used for development and a
regular installation is used for testing).

(...)

The src layout helps enforce that an editable installation is only able to
import files that were meant to be importable.

(...)

This is especially relevant when the editable installation is implemented
using a path configuration file that adds the directory to the import path.
@bonjourmauko bonjourmauko force-pushed the build/adopt-src-layout branch from 0f27393 to 1b1da9d Compare October 23, 2024 08:31
@bonjourmauko bonjourmauko merged commit be8fd8a into master Oct 23, 2024
7 checks passed
@bonjourmauko bonjourmauko deleted the build/adopt-src-layout branch October 23, 2024 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:build Changes that affect the build system or external dependencies
Projects
Development

Successfully merging this pull request may close these issues.

2 participants