Skip to content
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

fix: make dashes underscores in python package names #2073

Merged

Conversation

ruben-arts
Copy link
Contributor

fixes: #2066

$ pixi init --format pyproject test-project
$ tree test-project
test-project/
├── pyproject.toml
└── src
    └── test_project # <<<< This is now an underscore
        └── __init__.py

src/cli/init.rs Outdated
@@ -334,12 +334,16 @@ pub async fn execute(args: Args) -> miette::Result<()> {

// Create a 'pyproject.toml' manifest
} else if pyproject {
// Python package names cannot contain '-', so we replace them with '_'
let pypi_package_name = default_name.replace("-", "_");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps better to parse the name as PackageName and use the dist info name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed it!

@ruben-arts ruben-arts enabled auto-merge (squash) September 18, 2024 11:22
@ruben-arts ruben-arts merged commit 5bfb111 into prefix-dev:main Sep 18, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using - in pixi project name with pixi init --format pyproject will cause error on pixi install.
2 participants