You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
print(metadata.entrypoints) # same fields as defined in PEP 621
32
31
33
32
pkg_info = metadata.as_rfc822()
34
-
print(str(pkg_info)))# core metadata
33
+
print(str(pkg_info)) # core metadata
35
34
```
36
35
37
36
## SPDX licenses (METADATA 2.4+)
@@ -50,24 +49,25 @@ A backend is also expected to copy entries from `project.licence_files`, which
50
49
are paths relative to the project directory, into the `dist-info/licenses`
51
50
folder, preserving the original source structure.
52
51
53
-
54
52
## Modifying metadata
55
53
56
54
By default, `StandardMetadata` metadata fields are immutable unless a field is
57
55
listed in `dynaimc` (not to be confused with `dynamic_metadata`). If you want to
58
56
modify fields that are not dynamic, you can use the `dataclasses.replace` /
59
57
`copy.replace` (Python 3.13+) function.
60
58
61
-
62
59
## Dynamic Metadata (METADATA 2.2+)
63
60
64
-
Pyproject-metadata supports dynamic metadata. To use it, specify your METADATA fields in `dynamic_metadata`. If you want to convert `pyproject.toml` field names to METADATA field(s), use `pyproject_metadata.pyproject_to_metadata("field-name")`, which will return a frozenset of metadata names that are touched by that field.
65
-
61
+
Pyproject-metadata supports dynamic metadata. To use it, specify your METADATA
62
+
fields in `dynamic_metadata`. If you want to convert `pyproject.toml` field
63
+
names to METADATA field(s), use
64
+
`pyproject_metadata.pyproject_to_metadata("field-name")`, which will return a
65
+
frozenset of metadata names that are touched by that field.
66
66
67
67
## Adding extra fields
68
68
69
-
You can add extra fields to the Message returned by `to_rfc822()`, as long as they are valid metadata entries.
70
-
69
+
You can add extra fields to the Message returned by `to_rfc822()`, as long as
70
+
they are valid metadata entries.
71
71
72
72
## Collecting multiple errors
73
73
@@ -76,7 +76,6 @@ the metadata parse at once, instead of raising an exception on the first one.
76
76
The exception type will be `pyproject_metadata.errors.ExceptionGroup` (which is
77
77
just `ExceptionGroup` on Python 3.11+).
78
78
79
-
80
79
## Validating extra fields
81
80
82
81
By default, a warning (`pyproject_metadata.errors.ExtraKeyWarning`) will be
@@ -85,27 +84,35 @@ to either avoid the check (`True`) or hard error (`False`). If you want to
85
84
detect extra keys, you can get them with `pyproject_metadata.extra_top_level`
86
85
and `pyproject_metadata.extra_build_sytem`.
87
86
88
-
89
87
## Validating classifiers
90
88
91
-
If you want to validate classifiers, then install the `trove_classifiers` library (the canonical source for classifiers), and run:
89
+
If you want to validate classifiers, then install the `trove_classifiers`
90
+
library (the canonical source for classifiers), and run:
92
91
93
92
```python
94
93
import trove_classifiers
95
94
96
-
metadata_classifieres = {c for c in metadata.classifiers ifnot c.startswith("Private ::")}
95
+
metadata_classifieres = {
96
+
c for c in metadata.classifiers ifnot c.startswith("Private ::")
deprecated_classifiers = {k: trove_classifiers.deprecated_classifiers[k] for k in dep_names}
102
+
deprecated_classifiers = {
103
+
k: trove_classifiers.deprecated_classifiers[k] for k in dep_names
104
+
}
102
105
```
103
106
104
-
If you are writing a build backend, you should not validate classifiers with a`Private ::` prefix; these are only restricted for upload to PyPI (such as `Private :: Do Not Upload`).
105
-
106
-
Since classifiers are a moving target, it is probably best for build backends (which may be shipped by third party distributors like Debian or Fedora) to either ignore or have optional classifier validation.
107
+
If you are writing a build backend, you should not validate classifiers with a
108
+
`Private ::` prefix; these are only restricted for upload to PyPI (such as
109
+
`Private :: Do Not Upload`).
107
110
111
+
Since classifiers are a moving target, it is probably best for build backends
112
+
(which may be shipped by third party distributors like Debian or Fedora) to
113
+
either ignore or have optional classifier validation.
0 commit comments