1
+ # Guide (user-friendly):
2
+ # https://packaging.python.org/en/latest/guides/writing-pyproject-toml/
3
+
4
+ # Specification (technical, formal):
5
+ # https://packaging.python.org/en/latest/specifications/pyproject-toml/
6
+
7
+
8
+ # Choosing a build backend:
9
+ # https://packaging.python.org/en/latest/tutorials/packaging-projects/#choosing-a-build-backend
10
+ [build-system ]
11
+ # A list of packages that are needed to build your package:
12
+ requires = [" setuptools" ] # REQUIRED if [build-system] table is used
13
+ # The name of the Python object that frontends will use to perform the build:
14
+ build-backend = " setuptools.build_meta" # If not defined, then legacy behavior can happen.
15
+
16
+
1
17
[project ]
2
18
# This is the name of your project. The first time you publish this
3
19
# package, this name will be registered for you. It will determine how
10
26
# There are some restrictions on what makes a valid project name
11
27
# specification here:
12
28
# https://packaging.python.org/specifications/core-metadata/#name
13
- name = " sampleproject" # Required
29
+ name = " sampleproject" # REQUIRED, is the only field that cannot be marked as dynamic.
14
30
15
31
# Versions should comply with PEP 440:
16
32
# https://www.python.org/dev/peps/pep-0440/
17
33
#
18
34
# For a discussion on single-sourcing the version, see
19
35
# https://packaging.python.org/guides/single-sourcing-package-version/
20
- version = " 3.0.0" # Required
36
+ version = " 3.0.0" # REQUIRED, although can be dynamic
21
37
22
38
# This is a one-line description or tagline of what your project does. This
23
39
# corresponds to the "Summary" metadata field:
24
40
# https://packaging.python.org/specifications/core-metadata/#summary
25
- description = " A sample Python project" # Optional
41
+ description = " A sample Python project"
26
42
27
43
# This is an optional longer description of your project that represents
28
44
# the body of text which users will see when they visit PyPI.
@@ -32,45 +48,45 @@ description = "A sample Python project" # Optional
32
48
#
33
49
# This field corresponds to the "Description" metadata field:
34
50
# https://packaging.python.org/specifications/core-metadata/#description-optional
35
- readme = " README.md" # Optional
51
+ readme = " README.md"
36
52
37
53
# Specify which Python versions you support. In contrast to the
38
- # 'Programming Language' classifiers, 'pip install' will check this
54
+ # 'Programming Language' classifiers in this file , 'pip install' will check this
39
55
# and refuse to install the project if the version does not match. See
40
56
# https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires
41
- requires-python = " >=3.8" # Optional
57
+ requires-python = " >=3.8"
42
58
43
59
# This is either text indicating the license for the distribution, or a file
44
60
# that contains the license.
45
61
# https://packaging.python.org/en/latest/specifications/core-metadata/#license
46
- license = {file = " LICENSE.txt" } # Optional
62
+ license = {file = " LICENSE.txt" }
47
63
48
64
# This field adds keywords for your project which will appear on the
49
65
# project page. What does your project relate to?
50
66
#
51
67
# Note that this is a list of additional keywords, separated
52
68
# by commas, to be used to assist searching for the distribution in a
53
69
# larger catalog.
54
- keywords = [" sample" , " setuptools" , " development" ] # Optional
70
+ keywords = [" sample" , " setuptools" , " development" ]
55
71
56
72
# This should be your name or the name of the organization who originally
57
73
# authored the project, and a valid email address corresponding to the name
58
74
# listed.
59
75
authors = [
60
- {
name =
" A. Random Developer" ,
email =
" [email protected] " }
# Optional
76
+ {
name =
" A. Random Developer" ,
email =
" [email protected] " }
61
77
]
62
78
63
79
# This should be your name or the names of the organization who currently
64
80
# maintains the project, and a valid email address corresponding to the name
65
81
# listed.
66
82
maintainers = [
67
- {
name =
" A. Great Maintainer" ,
email =
" [email protected] " }
# Optional
83
+ {
name =
" A. Great Maintainer" ,
email =
" [email protected] " }
68
84
]
69
85
70
86
# Classifiers help users find your project by categorizing it.
71
87
#
72
88
# For a list of valid classifiers, see https://pypi.org/classifiers/
73
- classifiers = [ # Optional
89
+ classifiers = [
74
90
# How mature is this project? Common values are
75
91
# 3 - Alpha
76
92
# 4 - Beta
@@ -86,7 +102,7 @@ classifiers = [ # Optional
86
102
87
103
# Specify the Python versions you support here. In particular, ensure
88
104
# that you indicate you support Python 3. These classifiers are *not*
89
- # checked by "pip install". See instead "requires-python".
105
+ # checked by "pip install". See instead "requires-python" key in this file .
90
106
" Programming Language :: Python :: 3" ,
91
107
" Programming Language :: Python :: 3.8" ,
92
108
" Programming Language :: Python :: 3.9" ,
@@ -102,7 +118,7 @@ classifiers = [ # Optional
102
118
#
103
119
# For an analysis of this field vs pip's requirements files see:
104
120
# https://packaging.python.org/discussions/install-requires-vs-requirements/
105
- dependencies = [ # Optional
121
+ dependencies = [
106
122
" peppercorn"
107
123
]
108
124
@@ -112,9 +128,10 @@ dependencies = [ # Optional
112
128
#
113
129
# $ pip install sampleproject[dev]
114
130
#
115
- # Similar to `dependencies` above, these must be valid existing
116
- # projects.
117
- [project .optional-dependencies ] # Optional
131
+ # Optional dependencies the project provides. These are commonly
132
+ # referred to as "extras". For a more extensive definition see:
133
+ # https://packaging.python.org/en/latest/specifications/dependency-specifiers/#extras
134
+ [project .optional-dependencies ]
118
135
dev = [" check-manifest" ]
119
136
test = [" coverage" ]
120
137
@@ -128,7 +145,7 @@ test = ["coverage"]
128
145
# issues, where the source is hosted, where to say thanks to the package
129
146
# maintainers, and where to support the project financially. The key is
130
147
# what's used to render the link text on PyPI.
131
- [project .urls ] # Optional
148
+ [project .urls ]
132
149
"Homepage" = " https://github.com/pypa/sampleproject"
133
150
"Bug Reports" = " https://github.com/pypa/sampleproject/issues"
134
151
"Funding" = " https://donate.pypi.org"
@@ -137,18 +154,13 @@ test = ["coverage"]
137
154
138
155
# The following would provide a command line executable called `sample`
139
156
# which executes the function `main` from this package when invoked.
140
- [project .scripts ] # Optional
157
+ [project .scripts ]
141
158
sample = " sample:main"
142
159
160
+
143
161
# This is configuration specific to the `setuptools` build backend.
144
162
# If you are using a different build backend, you will need to change this.
145
163
[tool .setuptools ]
146
164
# If there are data files included in your packages that need to be
147
165
# installed, specify them here.
148
166
package-data = {"sample" = [" *.dat" ]}
149
-
150
- [build-system ]
151
- # These are the assumed default build requirements from pip:
152
- # https://pip.pypa.io/en/stable/reference/pip/#pep-517-and-518-support
153
- requires = [" setuptools>=43.0.0" , " wheel" ]
154
- build-backend = " setuptools.build_meta"
0 commit comments