Skip to content

Commit

Permalink
build: Port from MANIFEST.in to setuptools_scm
Browse files Browse the repository at this point in the history
Using `setuptools_scm` allows us to reliably ensure that all files in
git are in the sdist, which avoids problems caused by occasionally
forgetting to update `MANIFEST.in` when adding a new directory.

`MANIFEST.in` still needs to be kept (in a reduced form) because there
are a few files needed by webpack and by kolibri-installer-android which
are only created at dist time, and exist outside setuptools.

References:
 - https://github.com/pypa/setuptools_scm#readme
 - https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/
 - pypa/setuptools-scm#190
 - https://packaging.python.org/en/latest/guides/using-manifest-in/

Signed-off-by: Philip Withnall <[email protected]>

#647
  • Loading branch information
pwithnall authored and dbnicholson committed Jul 7, 2023
1 parent 9d06539 commit bf95c00
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
27 changes: 9 additions & 18 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
include AUTHORS.rst
include CONTRIBUTING.rst
include CHANGELOG.rst
include LICENSE
include README.rst
include kolibri_explore_plugin/VERSION
include kolibri_explore_plugin/content_types.json
recursive-exclude kolibri_explore_plugin/* *pyc
recursive-exclude kolibri_explore_plugin/assets *
recursive-include kolibri_explore_plugin/migrations *
recursive-include kolibri_explore_plugin/management *
recursive-include kolibri_explore_plugin/templates *.*
recursive-include kolibri_explore_plugin/static *.*
recursive-exclude kolibri_explore_plugin/static/collections *
recursive-include kolibri_explore_plugin/build *.json
recursive-include kolibri_explore_plugin/locale *.mo
recursive-include kolibri_explore_plugin/locale *.json
recursive-include kolibri_explore_plugin/vendor *.py
# webpack build-info is needed at runtime, but it’s only built at build time
# by yarn, so setuptools doesn’t know about it.
include kolibri_explore_plugin/static/build-info.json

# This is the dist form of welcomeScreen, which is not committed to git (but its
# source in packages/welcome-screen, is). It needs to be in the dist tarball
# because it’s consumed by kolibri-installer-android to show a welcome screen,
# and kolibri-installer-android consumes the kolibri-explore-plugin wheel
# directly.
recursive-include kolibri_explore_plugin/welcomeScreen *.*
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
[build-system]
# As per https://peps.python.org/pep-0518, list only the minimal dependencies
# needed here to get the build started. All other dependencies and built
# dependencies should be listed in [packages]/[dev-packages] in Pipfile.
# If changing the requires list here, please also update it in [dev-packages]
# in Pipfile.
requires = ["build", "setuptools>=45", "setuptools_scm[toml]>=6.2"]

[tool.black]
line-length = 79
include = '\.pyi?$'
Expand Down

0 comments on commit bf95c00

Please sign in to comment.