Skip to content

Commit 5b9db00

Browse files
committed
Add more pyprojects.toml examples
1 parent f965626 commit 5b9db00

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

README.rst

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,34 @@ supports both installing your ``project.dependencies`` as well as your
7878
``project.optional-dependencies``. Thanks to the fact that this is an
7979
official standard, you can use ``pip-compile`` to pin the dependencies
8080
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/>`_.
8283

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+
name = "foobar"
95+
description = "foobar description"
96+
classifiers = [
97+
"Programming Language :: Python",
98+
"Programming Language :: Python :: 3",
99+
]
100+
dynamic = ["version", "dependencies"]
101+
102+
[project.urls]
103+
homepage = "https://github.com/xyz/foobar"
104+
105+
[tool.setuptools.dynamic]
106+
dependencies = { file = [".config/requirements.in"] }
107+
108+
If you have a Django application that is packaged using ``Hatch``, and you
84109
want to pin it for production. You also want to pin your development tools
85110
in a separate pin file. You declare ``django`` as a dependency and create an
86111
optional dependency ``dev`` that includes ``pytest``:

0 commit comments

Comments
 (0)