Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 1 addition & 3 deletions backend/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include LICENSE.txt
include README.md
include requirements/base.in
include requirements/constraints.txt
recursive-include sample_plugin *.html *.png *.gif *.js *.css *.jpg *.jpeg *.svg
recursive-include src/sample_plugin *.html *.png *.gif *.js *.css *.jpg *.jpeg *.svg
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
1 change: 1 addition & 0 deletions backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ dev = [
readme = {file = ["README.md"], content-type = "text/markdown" }

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
exclude = ["sample_plugin.tests*"]

I think this exclude is not necessary when you have where = ["src"] and the tests are outside of the src folder.

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.

I'll remove include = ["sample_plugin*"] too, since the existence of a src folder makes me expect that anything within src should be included.


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.

Expand Down
File renamed without changes.
File renamed without changes.
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
Loading