Skip to content

Commit c197961

Browse files
feanilclaudekdmccormick
authored
refactor: move package source to src/ layout (#32)
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> Co-authored-by: Kyle D McCormick <kyle@axim.org>
1 parent 0884981 commit c197961

21 files changed

Lines changed: 13 additions & 14 deletions

File tree

backend/MANIFEST.in

Lines changed: 0 additions & 5 deletions
This file was deleted.

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: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ build-backend = "setuptools.build_meta"
66
name = "openedx-sample-plugin"
77
description = "A sample backend plugin for the Open edX Platform"
88
requires-python = ">=3.12"
9-
license="Apache-2.0"
9+
license = "Apache-2.0"
10+
license-files = ["LICENSE*"]
1011
authors = [
1112
{name = "Open edX Project", email = "oscm@openedx.org"},
1213
]
@@ -91,12 +92,14 @@ dev = [
9192
"edx-i18n-tools",
9293
]
9394

95+
[tool.setuptools]
96+
include-package-data = true
97+
9498
[tool.setuptools.dynamic]
9599
readme = {file = ["README.md"], content-type = "text/markdown" }
96100

97101
[tool.setuptools.packages.find]
98-
include = ["sample_plugin*"]
99-
exclude = ["sample_plugin.tests*"]
102+
where = ["src"]
100103

101104
[tool.semantic_release]
102105
# We use SETUPTOOLS_SCM_PRETEND_VERSION to pull the version from python-semantic-release instead
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)