Skip to content

Commit 98af35d

Browse files
committed
build: Move dynamic settings to pyproject.toml
Moving the necessary dynamic settings from setup.py to pyproject.toml A few settings were not migrated because their values are the default when a pyproject.toml file is used and a few were not moved because they were deprecated. Full list that I used for reference is here: https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html#setuptools-specific-configuration The constraint.txt reference is not PEP508 compliant so is not supported for the files that are read in by setuptools. So I moved the constraint into the makefile call for base.in so it could still serve as the source of truth for dependencies for this project.
1 parent b05fd84 commit 98af35d

4 files changed

Lines changed: 10 additions & 144 deletions

File tree

backend/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ compile-requirements: export CUSTOM_COMPILE_COMMAND=make upgrade
3939
compile-requirements: piptools ## compile the requirements/*.txt files with the latest packages satisfying requirements/*.in
4040
pip-compile -v ${PIP_COMPILE_OPTS} --allow-unsafe --rebuild -o requirements/pip-tools.txt requirements/pip-tools.in
4141
pip install -qr requirements/pip-tools.txt
42-
$(PIP_COMPILE) -o requirements/base.txt requirements/base.in
42+
$(PIP_COMPILE) -c requirements/constraints.txt -o requirements/base.txt requirements/base.in
4343
$(PIP_COMPILE) -o requirements/test.txt requirements/test.in
4444
$(PIP_COMPILE) -o requirements/doc.txt requirements/doc.in
4545
$(PIP_COMPILE) -o requirements/quality.txt requirements/quality.in

backend/pyproject.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,12 @@ sample_plugin = "sample_plugin.apps:SamplePluginConfig"
3434

3535
[project.urls]
3636
source = "https://openedx.org/openedx/sample-plugin"
37+
38+
[tool.setuptools.dynamic]
39+
version = {attr = "sample_plugin.__version__"}
40+
readme = {file = ["README.rst", "CHANGELOG.rst"]}
41+
dependencies = {file = "requirements/base.in"}
42+
43+
[tool.setuptools.packages.find]
44+
include = ["sample_plugin*"]
45+
exclude = ["sample_plugin.tests*"]

backend/requirements/base.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# Core requirements for using this application
2-
-c constraints.txt
3-
42
Django # Web application framework
53
djangorestframework # REST API framework
64
django-filter # Filtering for DRF

backend/setup.py

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

0 commit comments

Comments
 (0)