@@ -78,9 +78,28 @@ supports both installing your ``project.dependencies`` as well as your
78
78
``project.optional-dependencies ``. Thanks to the fact that this is an
79
79
official standard, you can use ``pip-compile `` to pin the dependencies
80
80
in projects that use modern standards-adhering packaging tools like
81
- `Hatch <https://hatch.pypa.io/ >`_ or `flit <https://flit.pypa.io/ >`_.
81
+ `Setuptools <https://setuptools.pypa.io >`_ , `Hatch <https://hatch.pypa.io/ >`_
82
+ or `flit <https://flit.pypa.io/ >`_.
82
83
83
- Suppose you have a Django application that is packaged using ``Hatch ``, and you
84
+ Suppose you have a 'foobar' Python application that is packaged using ``Setuptools ``,
85
+ and you want to pin it for production. You can declare the project metadata as:
86
+
87
+ .. code-block :: toml
88
+
89
+ [build-system]
90
+ requires = ["setuptools", "setuptools-scm"]
91
+ build-backend = "setuptools.build_meta"
92
+
93
+ [project]
94
+ requires-python = ">=3.9"
95
+ name = "foobar"
96
+ dynamic = ["dependencies", "optional-dependencies"]
97
+
98
+ [tool.setuptools.dynamic]
99
+ dependencies = { file = ["requirements.in"] }
100
+ optional-dependencies.test = { file = ["requirements-test.txt"] }
101
+
102
+ If you have a Django application that is packaged using ``Hatch ``, and you
84
103
want to pin it for production. You also want to pin your development tools
85
104
in a separate pin file. You declare ``django `` as a dependency and create an
86
105
optional dependency ``dev `` that includes ``pytest ``:
0 commit comments