Skip to content

Commit

Permalink
Add a complete example.
Browse files Browse the repository at this point in the history
  • Loading branch information
domdfcoding committed Jun 28, 2021
1 parent f83b6cd commit 8cf58fa
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 0 deletions.
15 changes: 15 additions & 0 deletions doc-source/configuration.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _configuration:

=====================
Configuration
=====================
Expand Down Expand Up @@ -594,3 +596,16 @@ As a minimum, the table MUST contain the keys :conf:`name` and :conf:`version` [
"3.6",
"3.7",
]
Complete Example
------------------

This is an example of a complete ``pyproject.toml`` file for :pep:`621`.

For an explanation of each field, see the :ref:`configuration` section.


.. literalinclude:: pyproject.toml
:caption: :download:`pyproject.toml`
:language: toml
58 changes: 58 additions & 0 deletions doc-source/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
[build-system]
requires = [ "whey",]
build-backend = "whey"

[project]
name = "spam"
version = "2020.0.0"
description = "Lovely Spam! Wonderful Spam!"
readme = "README.rst"
requires-python = ">=3.8"
license = {file = "LICENSE.txt"}
keywords = [ "egg", "bacon", "sausage", "tomatoes", "Lobster Thermidor",]
authors = [
{name = "Dominic Davis-Foster", email = "dominic@davis-foster.co.uk"},
{name = "The pip developers", email = "distutils-sig@python.org"}
]
maintainers = [
{name = "Brett Cannon", email = "brett@python.org"}
]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python"
]

dependencies = [
"httpx",
"gidgethub[httpx]>4.0.0",
"django>2.1; os_name != 'nt'",
"django>2.0; os_name == 'nt'"
]

[project.optional-dependencies]
test = [
"pytest < 5.0.0",
"pytest-cov[all]"
]

[project.urls]
homepage = "https://example.com"
documentation = "https://readthedocs.org"
repository = "https://github.com"
changelog = "https://github.com/me/spam/blob/master/CHANGELOG.md"

[project.scripts]
spam-cli = "spam:main_cli"
# One which depends on extras:
foobar = "foomod:main_bar [bar,baz]"


[project.gui-scripts]
spam-gui = "spam:main_gui"

[project.entry-points."spam.magical"]
tomatoes = "spam:main_tomatoes"

# pytest plugins refer to a module, so there is no ':obj'
[project.entry-points.pytest11]
nbval = "nbval.plugin"
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ extensions = [
"sphinx_toolbox_experimental.needspace",
"sphinx_toolbox_experimental.peps",
"sphinx_toolbox_experimental.toml",
"sphinx_toolbox_experimental.download_icon",
]
sphinxemoji_style = "twemoji"
gitstamp_fmt = "%d %b %Y"
Expand Down
1 change: 1 addition & 0 deletions repo_helper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ extra_sphinx_extensions:
- sphinx_toolbox_experimental.needspace
- sphinx_toolbox_experimental.peps
- sphinx_toolbox_experimental.toml
- sphinx_toolbox_experimental.download_icon

classifiers:
- 'Development Status :: 3 - Alpha'
Expand Down

0 comments on commit 8cf58fa

Please sign in to comment.