Skip to content

Commit

Permalink
Set private classifier for non-package application
Browse files Browse the repository at this point in the history
  • Loading branch information
j178 committed Sep 28, 2024
1 parent 313612d commit edceabb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions crates/uv/src/commands/project/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ impl InitProjectKind {
package: bool,
) -> Result<()> {
// Create the `pyproject.toml`
let mut pyproject = pyproject_project(name, requires_python, no_readme);
let mut pyproject = pyproject_project(name, requires_python, package, no_readme);

// Include additional project configuration for packaged applications
if package {
Expand Down Expand Up @@ -678,7 +678,7 @@ impl InitProjectKind {
}

// Create the `pyproject.toml`
let mut pyproject = pyproject_project(name, requires_python, no_readme);
let mut pyproject = pyproject_project(name, requires_python, true, no_readme);

// Always include a build system if the project is packaged.
pyproject.push('\n');
Expand Down Expand Up @@ -732,18 +732,20 @@ impl InitProjectKind {
fn pyproject_project(
name: &PackageName,
requires_python: &RequiresPython,
package: bool,
no_readme: bool,
) -> String {
indoc::formatdoc! {r#"
[project]
name = "{name}"
version = "0.1.0"
description = "Add your description here"{readme}
requires-python = "{requires_python}"
requires-python = "{requires_python}"{classifiers}
dependencies = []
"#,
readme = if no_readme { "" } else { "\nreadme = \"README.md\"" },
requires_python = requires_python.specifiers(),
classifiers = if package { "" } else { "\nclassifiers = [ \"Private :: Do Not Upload\" ]" },
}
}

Expand Down

0 comments on commit edceabb

Please sign in to comment.