Skip to content

Commit

Permalink
Add more pyprojects.toml examples
Browse files Browse the repository at this point in the history
  • Loading branch information
shatakshiiii committed Apr 17, 2023
1 parent f965626 commit 5b9db00
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,34 @@ supports both installing your ``project.dependencies`` as well as your
``project.optional-dependencies``. Thanks to the fact that this is an
official standard, you can use ``pip-compile`` to pin the dependencies
in projects that use modern standards-adhering packaging tools like
`Hatch <https://hatch.pypa.io/>`_ or `flit <https://flit.pypa.io/>`_.
`Setuptools <https://setuptools.pypa.io>`_ , `Hatch <https://hatch.pypa.io/>`_
or `flit <https://flit.pypa.io/>`_.

Suppose you have a Django application that is packaged using ``Hatch``, and you
Suppose you have a 'foobar' Python application that is packaged using ``Setuptools``,
and you want to pin it for production. You can declare the project metadata as:

.. code-block:: toml
[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"
[project]
name = "foobar"
description = "foobar description"
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
]
dynamic = ["version", "dependencies"]
[project.urls]
homepage = "https://github.com/xyz/foobar"
[tool.setuptools.dynamic]
dependencies = { file = [".config/requirements.in"] }
If you have a Django application that is packaged using ``Hatch``, and you
want to pin it for production. You also want to pin your development tools
in a separate pin file. You declare ``django`` as a dependency and create an
optional dependency ``dev`` that includes ``pytest``:
Expand Down

0 comments on commit 5b9db00

Please sign in to comment.