forked from astral-sh/uv
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't allow non-string email in authors (astral-sh#8520)
- Loading branch information
Showing
2 changed files
with
39 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -605,14 +605,19 @@ enum License { | |
/// The entry is derived from the email format of `John Doe <[email protected]>`. You need to | ||
/// provide at least name or email. | ||
#[derive(Deserialize, Debug, Clone)] | ||
#[serde(untagged, expecting = "a table with 'name' and/or 'email' keys")] | ||
// deny_unknown_fields prevents using the name field when the email is not a string. | ||
#[serde( | ||
untagged, | ||
deny_unknown_fields, | ||
expecting = "a table with 'name' and/or 'email' keys" | ||
)] | ||
enum Contact { | ||
/// TODO(konsti): RFC 822 validation. | ||
NameEmail { name: String, email: String }, | ||
/// TODO(konsti): RFC 822 validation. | ||
Name { name: String }, | ||
/// TODO(konsti): RFC 822 validation. | ||
Email { email: String }, | ||
/// TODO(konsti): RFC 822 validation. | ||
NameEmail { name: String, email: String }, | ||
} | ||
|
||
/// The `[build-system]` section of a pyproject.toml as specified in PEP 517. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,35 +104,37 @@ fn valid() { | |
let metadata = pyproject_toml.to_metadata(temp_dir.path()).unwrap(); | ||
|
||
assert_snapshot!(metadata.core_metadata_format(), @r###" | ||
Metadata-Version: 2.3 | ||
Name: hello-world | ||
Version: 0.1.0 | ||
Summary: A Python package | ||
Keywords: demo,example,package | ||
Author: Ferris the crab | ||
License: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, | ||
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A | ||
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF | ||
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE | ||
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
Classifier: Development Status :: 6 - Mature | ||
Classifier: License :: OSI Approved :: MIT License | ||
Classifier: License :: OSI Approved :: Apache Software License | ||
Classifier: Programming Language :: Python | ||
Requires-Dist: flask>=3,<4 | ||
Requires-Dist: sqlalchemy[asyncio]>=2.0.35,<3 | ||
Maintainer: Konsti | ||
Project-URL: Homepage, https://github.com/astral-sh/uv | ||
Project-URL: Repository, https://astral.sh | ||
Provides-Extra: mysql | ||
Provides-Extra: postgres | ||
Description-Content-Type: text/markdown | ||
# Foo | ||
This is the foo library. | ||
"###); | ||
Metadata-Version: 2.3 | ||
Name: hello-world | ||
Version: 0.1.0 | ||
Summary: A Python package | ||
Keywords: demo,example,package | ||
Author: Ferris the crab | ||
Author-email: Ferris the crab <[email protected]> | ||
License: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, | ||
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A | ||
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF | ||
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE | ||
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
Classifier: Development Status :: 6 - Mature | ||
Classifier: License :: OSI Approved :: MIT License | ||
Classifier: License :: OSI Approved :: Apache Software License | ||
Classifier: Programming Language :: Python | ||
Requires-Dist: flask>=3,<4 | ||
Requires-Dist: sqlalchemy[asyncio]>=2.0.35,<3 | ||
Maintainer: Konsti | ||
Maintainer-email: Konsti <[email protected]> | ||
Project-URL: Homepage, https://github.com/astral-sh/uv | ||
Project-URL: Repository, https://astral.sh | ||
Provides-Extra: mysql | ||
Provides-Extra: postgres | ||
Description-Content-Type: text/markdown | ||
# Foo | ||
This is the foo library. | ||
"###); | ||
|
||
assert_snapshot!(pyproject_toml.to_entry_points().unwrap().unwrap(), @r###" | ||
[console_scripts] | ||
|