Skip to content

fix: make dashes underscores in python package names - #2073

Merged
ruben-arts merged 3 commits into
prefix-dev:mainfrom
ruben-arts:fix/pixi_init_dashed_py_package
Sep 18, 2024
Merged

fix: make dashes underscores in python package names#2073
ruben-arts merged 3 commits into
prefix-dev:mainfrom
ruben-arts:fix/pixi_init_dashed_py_package

Conversation

@ruben-arts

Copy link
Copy Markdown
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

Comment thread src/cli/init.rs Outdated
// 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
Copy Markdown
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
Copy Markdown
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
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