Skip to content

Commit

Permalink
build: adapt /src layout
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bonjourmauko committed Oct 22, 2024
1 parent cddbb82 commit 0f27393
Show file tree
Hide file tree
Showing 12 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
graft openfisca_extension_template
graft src
global-exclude *~ *.py[cod] *.so
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ lint: clean
poetry run shellcheck `git ls-files | grep "\.sh$$"`

test: clean
poetry run openfisca test --country-package=openfisca_country_template --extensions=openfisca_extension_template openfisca_extension_template/tests
poetry run openfisca test --country-package=openfisca_country_template --extensions=openfisca_extension_template tests
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering :: Information Analysis",
]
packages = [ { include = "openfisca_extension_template", from = "." } ]
packages = [ { include = "openfisca_extension_template", from = "src" } ]

[tool.poetry.dependencies]
python = "~3.9 || ~3.10 || ~3.11"
Expand Down Expand Up @@ -116,9 +116,9 @@ commands = [
[
"openfisca",
"test",
"tests",
"--country-package=openfisca_country_template",
"--extensions=openfisca_extension_template",
"openfisca_extension_template/tests",
]
]
commands_pre = [
Expand Down
File renamed without changes.

0 comments on commit 0f27393

Please sign in to comment.