New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move project setup to pyproject.toml and build package with "build". #1325
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1325 +/- ##
=======================================
Coverage 89.30% 89.30%
=======================================
Files 12 12
Lines 1010 1010
Branches 192 192
=======================================
Hits 902 902
Misses 78 78
Partials 30 30
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
url="https://github.com/django-crispy-forms/django-crispy-forms", | ||
license="MIT", | ||
packages=find_packages(exclude=["docs"]), | ||
include_package_data=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include_package_data
defaults to True
when using pyproject.toml
. Therefore no need to migrate this setting.
https://setuptools.pypa.io/en/latest/userguide/datafiles.html#include-package-data
license="MIT", | ||
packages=find_packages(exclude=["docs"]), | ||
include_package_data=True, | ||
zip_safe=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zip_safe
is obsolete, so no need to migrate this one.
https://setuptools.pypa.io/en/latest/deprecated/zip_safe.html
author_email="miguel.araujo.perez@gmail.com", | ||
url="https://github.com/django-crispy-forms/django-crispy-forms", | ||
license="MIT", | ||
packages=find_packages(exclude=["docs"]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://setuptools.pypa.io/en/latest/userguide/package_discovery.html
We have a standard package setup (docs in a docs, folder, tests in a tests folder) and therefore can rely on automatic discovery. This works testing locally where the output of the discovery is:
No `packages` or `py_modules` configuration, performing automatic discovery.
`flat-layout` detected -- analysing .
discovered packages -- ['crispy_forms', 'crispy_forms.templatetags']
Ha! broke the linter. One for another day. Happy New Year All! 🥳 |
When I first started working on this both
python -m build
andcheck-manifest
were raising multiple errors.I've now moved the setup to
pyproject.toml
inline with the current python packaging tutorial [1]. Updating themanifest.in
file was also needed to ensure that all the correct files are included, and also to exclude others (e.g.__pycache__
).Here is the output of running
python -m build
locally.[1] https://packaging.python.org/en/latest/tutorials/packaging-projects/