Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions backend/MANIFEST.in

This file was deleted.

4 changes: 2 additions & 2 deletions backend/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,8 @@ def on_init(app): # pylint: disable=unused-argument
# If we are, assemble the path manually
bin_path = os.path.abspath(os.path.join(sys.prefix, 'bin'))
apidoc_path = os.path.join(bin_path, apidoc_path)
check_call([apidoc_path, '-o', docs_path, os.path.join(root_path, 'sample_plugin'),
os.path.join(root_path, 'sample_plugin/migrations')])
check_call([apidoc_path, '-o', docs_path, os.path.join(root_path, 'src/sample_plugin'),
os.path.join(root_path, 'src/sample_plugin/migrations')])


def setup(app):
Expand Down
9 changes: 6 additions & 3 deletions backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ build-backend = "setuptools.build_meta"
name = "openedx-sample-plugin"
description = "A sample backend plugin for the Open edX Platform"
requires-python = ">=3.12"
license="Apache-2.0"
license = "Apache-2.0"
license-files = ["LICENSE*"]
authors = [
{name = "Open edX Project", email = "oscm@openedx.org"},
]
Expand Down Expand Up @@ -91,12 +92,14 @@ dev = [
"edx-i18n-tools",
]

[tool.setuptools]
include-package-data = true

[tool.setuptools.dynamic]
readme = {file = ["README.md"], content-type = "text/markdown" }

[tool.setuptools.packages.find]
include = ["sample_plugin*"]
exclude = ["sample_plugin.tests*"]
where = ["src"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nit: I think if you put the following in, you can delete MANIFEST.in:

Suggested change
[tool.setuptools.package-data]
# Include these data files when building the wheel, if any are present in src/
sample_plugin = ["**/*.html", "**/*.png", "**/*.gif", "**/*.js", "**/*.css", "**/*.jpg", "**/*.jpeg", "**/*.svg"]

Or, since we're using setuptools-scm, we could use:

[tool.setuptools]
include-package-data = true

to pull in all files in src tracked by git without needing to maintain this separate list of file extensions.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Also, whether using MANIFEST.in or package-data in pyproject.toml, I would recommend creating an empty py.typed file at src/sample_plugin/py.typed and then adding "py.typed", to this list, e.g. sample_plugin = ["py.typed", "**/*.html", "**/*.png", ... so that mypy will pick up any type definitions if other python projects are importing and using this code. Not so necessary for a plugin but very important for any reusable libraries.

[tool.semantic_release]
# We use SETUPTOOLS_SCM_PRETEND_VERSION to pull the version from python-semantic-release instead
Expand Down
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions backend/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ allowlist_externals =
touch
commands =
touch tests/__init__.py
pylint sample_plugin tests test_utils manage.py
pylint src/sample_plugin tests test_utils manage.py
rm tests/__init__.py
pycodestyle sample_plugin tests manage.py
pydocstyle sample_plugin tests manage.py
isort --check-only --diff tests test_utils sample_plugin manage.py test_settings.py
pycodestyle src/sample_plugin tests manage.py
pydocstyle src/sample_plugin tests manage.py
isort --check-only --diff tests test_utils src/sample_plugin manage.py test_settings.py
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nit: replace with ruff ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Will follow up #33

make selfcheck

[testenv:pii_check]
Expand Down
1 change: 1 addition & 0 deletions tutor/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ name = "tutor-contrib-sample-plugin"
description = "Tutor plugin for the Open edX Sample Plugin"
requires-python = ">=3.11"
license = "Apache-2.0"
license-files = ["LICENSE*"]
authors = [
{name = "Open edX Project", email = "oscm@openedx.org"},
]
Expand Down
Loading