-
Couldn't load subscription status.
- Fork 2.2k
Warn when trying to uv sync a package without build configuration
#7420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
4cf007d
2e976e7
9e410d7
ad900be
5161c52
76b2956
591e4a6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,7 +44,7 @@ pub struct PyProjectToml { | |
| #[serde(skip)] | ||
| pub raw: String, | ||
|
|
||
| /// Used to determine whether a `build-system` is present. | ||
| /// Used to determine whether a `build-system` section is present. | ||
| #[serde(default, skip_serializing)] | ||
| build_system: Option<serde::de::IgnoredAny>, | ||
| } | ||
|
|
@@ -82,6 +82,15 @@ impl PyProjectToml { | |
| // Otherwise, a project is assumed to be a package if `build-system` is present. | ||
| self.build_system.is_some() | ||
| } | ||
|
|
||
| /// Returns whether the project manifest contains any script table. | ||
| pub fn has_scripts(&self) -> bool { | ||
| if let Some(ref project) = self.project { | ||
| project.gui_scripts.is_some() || project.scripts.is_some() | ||
| } else { | ||
| false | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // Ignore raw document in comparison. | ||
|
|
@@ -102,7 +111,7 @@ impl AsRef<[u8]> for PyProjectToml { | |
| /// PEP 621 project metadata (`project`). | ||
| /// | ||
| /// See <https://packaging.python.org/en/latest/specifications/pyproject-toml>. | ||
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] | ||
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note: |
||
| #[serde(rename_all = "kebab-case")] | ||
| pub struct Project { | ||
| /// The name of the project | ||
|
|
@@ -113,6 +122,13 @@ pub struct Project { | |
| pub requires_python: Option<VersionSpecifiers>, | ||
| /// The optional dependencies of the project. | ||
| pub optional_dependencies: Option<BTreeMap<ExtraName, Vec<String>>>, | ||
|
|
||
| /// Used to determine whether a `gui-scripts` section is present. | ||
| #[serde(default, skip_serializing)] | ||
| pub(crate) gui_scripts: Option<serde::de::IgnoredAny>, | ||
| /// Used to determine whether a `scripts` section is present. | ||
| #[serde(default, skip_serializing)] | ||
| pub(crate) scripts: Option<serde::de::IgnoredAny>, | ||
| } | ||
|
|
||
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.