@@ -170,27 +170,50 @@ Add the following to your table:
170
170
- package ** authors**
171
171
- package ** maintainers**
172
172
173
- When you add authors and maintainers you need to use a format that will look like a Python list with a dictionary within it:
173
+ The ` description ` is just a string like the other values you've set:
174
+
175
+ ``` toml
176
+ # you can use """ for multiline strings like in python!
174
177
175
- ` authors = [{ name = "Firstname lastname", email = "[email protected] " }] `
178
+ description = """
179
+ Tools that update the pyOpenSci contributor and review metadata
180
+ that is posted on our website
181
+ """
182
+ ```
176
183
177
- If you have two authors you can add them like this:
184
+ When you add authors and maintainers you need to use a format that will look like a Python list with a dictionary within it:
185
+
186
+ ``` toml
187
+ authors = [
188
+ {
name =
" Firstname Lastname" ,
email =
" [email protected] " },
189
+ {
name =
" Secondperson Fullname" ,
email =
" [email protected] " }
190
+ ]
178
191
179
- ` authors = [{ name = "Firstname lastname", email = "[email protected] " }, { name = "Firstname lastname", email = "[email protected] " }] `
192
+ maintainers = [
193
+ {
name =
" Secondperson Fullname" ,
email =
" [email protected] " },
194
+ {
name =
" New Friend" ,
email =
" [email protected] " }
195
+ ]
196
+ ```
180
197
181
198
:::{admonition} Author names & emails
182
199
:class: note
183
200
184
201
There is a quirk with PyPI for authors that have names but not emails in the pyproject.toml. If you are missing the email for one or more authors or maintainers, like this:
185
202
186
203
``` toml
187
- maintainers = [{
name =
" Firstname lastname" ,
email =
" [email protected] " }, {
name =
" Firstname lastname" }]
204
+ maintainers = [
205
+ {
name =
" Firstname lastname" ,
email =
" [email protected] " },
206
+ { name = " Firstname lastname" }
207
+ ]
188
208
```
189
209
190
210
Then we suggest that you only provide names in your list of names to ensure that everything renders properly on your PyPI page - like this:
191
211
192
212
``` toml
193
- maintainers = [{ name = " Firstname lastname" }, { name = " Firstname lastname" }]
213
+ maintainers = [
214
+ { name = " Firstname lastname" },
215
+ { name = " Firstname lastname" }
216
+ ]
194
217
```
195
218
196
219
don't have emails for everyone, we suggest that you only add names.
@@ -199,7 +222,7 @@ don't have emails for everyone, we suggest that you only add names.
199
222
200
223
Your ` pyproject.toml ` file now should look like the example below. It is OK if you only have 1 author and the same author is also maintainer of your package:
201
224
202
- {emphasize-lines="8-10 "}
225
+ {emphasize-lines="8-19 "}
203
226
``` toml
204
227
[build-system ]
205
228
requires = [" hatchling" ]
@@ -208,9 +231,18 @@ build-backend = "hatchling.build"
208
231
[project ]
209
232
name = " pyospackage"
210
233
version = " 0.1.0"
211
- description = " Tools that update the pyOpenSci contributor and review metadata that is posted on our website"
212
- authors = [{
name =
" Firstname lastname" ,
email =
" [email protected] " }]
213
- maintainers = [{
name =
" Firstname lastname" ,
email =
" [email protected] " }, {
name =
" Firstname lastname" ,
email =
" [email protected] " }]
234
+ description = """
235
+ Tools that update the pyOpenSci contributor and review metadata
236
+ that is posted on our website
237
+ """
238
+ authors = [
239
+ {
name =
" Firstname Lastname" ,
email =
" [email protected] " },
240
+ {
name =
" Secondperson Fullname" ,
email =
" [email protected] " }
241
+ ]
242
+ maintainers = [
243
+ {
name =
" Secondperson Fullname" ,
email =
" [email protected] " },
244
+ {
name =
" New Friend" ,
email =
" [email protected] " }
245
+ ]
214
246
```
215
247
216
248
:::{dropdown} Learn More: What's the difference between author and maintainer in open source?
@@ -238,7 +270,7 @@ In the previous lessons, you added both a [README.md](add-readme) file and a [LI
238
270
Once you have those files, you can add them to your pyproject.toml file as
239
271
links following the example below.
240
272
241
- {emphasize-lines="11-12 "}
273
+ {emphasize-lines="20-21 "}
242
274
``` toml
243
275
[build-system ]
244
276
requires = [" hatchling" ]
@@ -247,18 +279,27 @@ build-backend = "hatchling.build"
247
279
[project ]
248
280
name = " pyospackage"
249
281
version = " 0.1.0"
250
- description = " Tools that update the pyOpenSci contributor and review metadata that is posted on our website"
251
- authors = [{
name =
" Firstname lastname" ,
email =
" [email protected] " }]
252
- maintainers = [{
name =
" Firstname lastname" ,
email =
" [email protected] " }, {
name =
" Firstname lastname" ,
email =
" [email protected] " }]
282
+ description = """
283
+ Tools that update the pyOpenSci contributor and review metadata
284
+ that is posted on our website
285
+ """
286
+ authors = [
287
+ {
name =
" Firstname Lastname" ,
email =
" [email protected] " },
288
+ {
name =
" Secondperson Fullname" ,
email =
" [email protected] " }
289
+ ]
290
+ maintainers = [
291
+ {
name =
" Secondperson Fullname" ,
email =
" [email protected] " },
292
+ {
name =
" New Friend" ,
email =
" [email protected] " }
293
+ ]
253
294
readme = " README.md"
254
- license = {file = ' LICENSE' }
295
+ license = {file = " LICENSE" }
255
296
```
256
297
### Step 3: Specify Python version with ` requires-python `
257
298
258
299
Finally, add the ` requires-python ` field to your ` pyproject.toml ` ` [project] ` table. The ` requires-python ` field, helps pip understand the lowest version of Python that you package supports when it's installed. It is thus a single value.
259
300
260
301
261
- {emphasize-lines="13 "}
302
+ {emphasize-lines="22 "}
262
303
``` toml
263
304
[build-system ]
264
305
requires = [" hatchling" ]
@@ -267,9 +308,18 @@ build-backend = "hatchling.build"
267
308
[project ]
268
309
name = " pyospackage"
269
310
version = " 0.1.0"
270
- description = " Tools that update the pyOpenSci contributor and review metadata that is posted on our website"
271
- authors = [{
name =
" Firstname lastname" ,
email =
" [email protected] " }]
272
- maintainers = [{
name =
" Firstname lastname" ,
email =
" [email protected] " }, {
name =
" Firstname lastname" ,
email =
" [email protected] " }]
311
+ description = """
312
+ Tools that update the pyOpenSci contributor and review metadata
313
+ that is posted on our website
314
+ """
315
+ authors = [
316
+ {
name =
" Firstname Lastname" ,
email =
" [email protected] " },
317
+ {
name =
" Secondperson Fullname" ,
email =
" [email protected] " }
318
+ ]
319
+ maintainers = [
320
+ {
name =
" Secondperson Fullname" ,
email =
" [email protected] " },
321
+ {
name =
" New Friend" ,
email =
" [email protected] " }
322
+ ]
273
323
readme = " README.md"
274
324
license = {file = ' LICENSE' }
275
325
requires-python = " >=3.10"
@@ -287,7 +337,7 @@ requires = ["hatchling"] # this is an array (or list) of requirements
287
337
dependencies are added in an array (similar to a Python list) structure.
288
338
289
339
290
- {emphasize-lines="15 "}
340
+ {emphasize-lines="24 "}
291
341
``` toml
292
342
[build-system ]
293
343
requires = [" hatchling" ]
@@ -296,9 +346,18 @@ build-backend = "hatchling.build"
296
346
[project ]
297
347
name = " pyospackage"
298
348
version = " 0.1.0"
299
- description = " Tools that update the pyOpenSci contributor and review metadata that is posted on our website"
300
- authors = [{
name =
" Firstname lastname" ,
email =
" [email protected] " }]
301
- maintainers = [{
name =
" Firstname lastname" ,
email =
" [email protected] " }, {
name =
" Firstname lastname" ,
email =
" [email protected] " }]
349
+ description = """
350
+ Tools that update the pyOpenSci contributor and review metadata
351
+ that is posted on our website
352
+ """
353
+ authors = [
354
+ {
name =
" Firstname Lastname" ,
email =
" [email protected] " },
355
+ {
name =
" Secondperson Fullname" ,
email =
" [email protected] " }
356
+ ]
357
+ maintainers = [
358
+ {
name =
" Secondperson Fullname" ,
email =
" [email protected] " },
359
+ {
name =
" New Friend" ,
email =
" [email protected] " }
360
+ ]
302
361
readme = " README.md"
303
362
license = {file = ' LICENSE' }
304
363
requires-python = " >=3.10"
@@ -354,7 +413,7 @@ The classifier key should look something like the example below. A few notes:
354
413
- Your classifier values might be different depending upon the license you have selected for your package, your intended audience, development status of your package and the Python versions that you support
355
414
- You can add as many classifiers as you wish as long as you use the [ designated PyPI classifier values] ( https://PyPI.org/classifiers/ ) .
356
415
357
- {emphasize-lines="17-24 "}
416
+ {emphasize-lines="26-34 "}
358
417
``` toml
359
418
[build-system ]
360
419
requires = [" hatchling" ]
@@ -363,9 +422,18 @@ build-backend = "hatchling.build"
363
422
[project ]
364
423
name = " pyospackage"
365
424
version = " 0.1.0"
366
- description = " Tools that update the pyOpenSci contributor and review metadata that is posted on our website"
367
- authors = [{
name =
" Firstname lastname" ,
email =
" [email protected] " }]
368
- maintainers = [{
name =
" Firstname lastname" ,
email =
" [email protected] " }, {
name =
" Firstname lastname" ,
email =
" [email protected] " }]
425
+ description = """
426
+ Tools that update the pyOpenSci contributor and review metadata
427
+ that is posted on our website
428
+ """
429
+ authors = [
430
+ {
name =
" Firstname Lastname" ,
email =
" [email protected] " },
431
+ {
name =
" Secondperson Fullname" ,
email =
" [email protected] " }
432
+ ]
433
+ maintainers = [
434
+ {
name =
" Secondperson Fullname" ,
email =
" [email protected] " },
435
+ {
name =
" New Friend" ,
email =
" [email protected] " }
436
+ ]
369
437
readme = " README.md"
370
438
license = {file = ' LICENSE' }
371
439
requires-python = " >=3.10"
@@ -379,7 +447,8 @@ classifiers = [
379
447
" License :: OSI Approved :: MIT License" ,
380
448
" Programming Language :: Python :: 3 :: Only" ,
381
449
" Programming Language :: Python :: 3.10" ,
382
- " Programming Language :: Python :: 3.11" ,]
450
+ " Programming Language :: Python :: 3.11" ,
451
+ ]
383
452
```
384
453
385
454
Note that while classifiers are not required in your ` pyproject.toml ` file, they will help users find your package. As such we strongly recommend that you add them.
@@ -394,7 +463,7 @@ Finally, add the project.urls table to your pyproject.toml file.
394
463
- ** Bug reports:** a link to your issues / discussions or wherever you want users to report bugs.
395
464
- ** Source:** the GitHub / GitLab link for your project.
396
465
397
- {emphasize-lines="27-30 "}
466
+ {emphasize-lines="36-39 "}
398
467
``` toml
399
468
[build-system ]
400
469
requires = [" hatchling" ]
@@ -403,9 +472,18 @@ build-backend = "hatchling.build"
403
472
[project ]
404
473
name = " pyospackage"
405
474
version = " 0.1.0"
406
- description = " Tools that update the pyOpenSci contributor and review metadata that is posted on our website"
407
- authors = [{
name =
" Firstname lastname" ,
email =
" [email protected] " }]
408
- maintainers = [{
name =
" Firstname lastname" ,
email =
" [email protected] " }, {
name =
" Firstname lastname" ,
email =
" [email protected] " }]
475
+ description = """
476
+ Tools that update the pyOpenSci contributor and review metadata
477
+ that is posted on our website
478
+ """
479
+ authors = [
480
+ {
name =
" Firstname Lastname" ,
email =
" [email protected] " },
481
+ {
name =
" Secondperson Fullname" ,
email =
" [email protected] " }
482
+ ]
483
+ maintainers = [
484
+ {
name =
" Secondperson Fullname" ,
email =
" [email protected] " },
485
+ {
name =
" New Friend" ,
email =
" [email protected] " }
486
+ ]
409
487
readme = " README.md"
410
488
license = {file = ' LICENSE' }
411
489
requires-python = " >=3.10"
@@ -445,9 +523,18 @@ build-backend = "hatchling.build"
445
523
[project ]
446
524
name = " pyospackage"
447
525
version = " 0.1.0"
448
- description = " Tools that update the pyOpenSci contributor and review metadata that is posted on our website"
449
- authors = [{
name =
" Firstname lastname" ,
email =
" [email protected] " }]
450
- maintainers = [{
name =
" Firstname lastname" ,
email =
" [email protected] " }, {
name =
" Firstname lastname" ,
email =
" [email protected] " }]
526
+ description = """
527
+ Tools that update the pyOpenSci contributor and review metadata
528
+ that is posted on our website
529
+ """
530
+ authors = [
531
+ {
name =
" Firstname Lastname" ,
email =
" [email protected] " },
532
+ {
name =
" Secondperson Fullname" ,
email =
" [email protected] " }
533
+ ]
534
+ maintainers = [
535
+ {
name =
" Secondperson Fullname" ,
email =
" [email protected] " },
536
+ {
name =
" New Friend" ,
email =
" [email protected] " }
537
+ ]
451
538
readme = " README.md"
452
539
license = {file = ' LICENSE' }
453
540
requires-python = " >=3.10"
0 commit comments