-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Open
Labels
kind/featureFeature requests/implementationsFeature requests/implementationsstatus/triageThis issue needs to be triagedThis issue needs to be triaged
Description
Issue Kind
Change in current behaviour
Description
Using Poetry 2.0.1 on Windows 11.
When creating a poetry project with a + in the project name - might be the same for other invalid characters -, generation runs smoothly:
D:\Development\test> poetry init -v
This command will guide you through creating your pyproject.toml config.
Package name [test]: test+test
Version [0.1.0]:
Description []:
Author [Your Name <[email protected]>, n to skip]: n
License []:
Trying to detect current active python executable as specified in the config.
Found: D:\Program Files\Python313\python.EXE
Compatible Python versions [>=3.13]:
Would you like to define your main dependencies interactively? (yes/no) [yes] no
Would you like to define your development dependencies interactively? (yes/no) [yes] no
Generated file
[project]
name = "test+test"
version = "0.1.0"
description = ""
authors = [
{name = "Your Name",email = "[email protected]"}
]
readme = "README.md"
requires-python = ">=3.13"
dependencies = [
]
[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"
Do you confirm generation? (yes/no) [yes] yesThen, when trying to add a new dependency with poetry add, it fails due to an invalid project name:
D:\Development\test> poetry add requests
The Poetry configuration is invalid:
- project.name must match pattern ^([a-zA-Z\d]|[a-zA-Z\d][\w.-]*[a-zA-Z\d])$Impact
Prevent the user from creating projects with invalid names.
While the current behaviour is not in any way problematic or breaking, it's unexpected and should be improved in my opinion.
Workarounds
Use a project name with no + :)
Metadata
Metadata
Assignees
Labels
kind/featureFeature requests/implementationsFeature requests/implementationsstatus/triageThis issue needs to be triagedThis issue needs to be triaged