Skip to content

Commit af561b0

Browse files
feanilclaude
andcommitted
refactor: move package source to src/ layout
Moves sample_plugin/ into src/ to adopt the standard src-layout, which prevents accidental imports from the source tree during tests and fixes editable-install compatibility with mypy and other tools that rely on proper package discovery. - backend/sample_plugin/ moved to backend/src/sample_plugin/ - backend/pyproject.toml: add `where = ["src"]` to [tool.setuptools.packages.find] - backend/MANIFEST.in: update recursive-include path, remove stale requirements/ lines - backend/tox.ini: update quality tool invocations to use src/sample_plugin path Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 0884981 commit af561b0

19 files changed

Lines changed: 8 additions & 9 deletions

File tree

backend/MANIFEST.in

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
include LICENSE.txt
22
include README.md
3-
include requirements/base.in
4-
include requirements/constraints.txt
5-
recursive-include sample_plugin *.html *.png *.gif *.js *.css *.jpg *.jpeg *.svg
3+
recursive-include src/sample_plugin *.html *.png *.gif *.js *.css *.jpg *.jpeg *.svg

backend/docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,8 +522,8 @@ def on_init(app): # pylint: disable=unused-argument
522522
# If we are, assemble the path manually
523523
bin_path = os.path.abspath(os.path.join(sys.prefix, 'bin'))
524524
apidoc_path = os.path.join(bin_path, apidoc_path)
525-
check_call([apidoc_path, '-o', docs_path, os.path.join(root_path, 'sample_plugin'),
526-
os.path.join(root_path, 'sample_plugin/migrations')])
525+
check_call([apidoc_path, '-o', docs_path, os.path.join(root_path, 'src/sample_plugin'),
526+
os.path.join(root_path, 'src/sample_plugin/migrations')])
527527

528528

529529
def setup(app):

backend/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ dev = [
9595
readme = {file = ["README.md"], content-type = "text/markdown" }
9696

9797
[tool.setuptools.packages.find]
98+
where = ["src"]
9899
include = ["sample_plugin*"]
99100
exclude = ["sample_plugin.tests*"]
100101

File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)