Skip to content

poetry new silently transforms underscores to dashes #8848

@Gerrit-K

Description

@Gerrit-K
  • Poetry version: 1.7.1

  • Python version: 3.9.18

  • OS version and name: macOS 14.2.1 (23C71)

  • pyproject.toml: none, see repro steps below

  • I am on the latest stable Poetry version, installed using a recommended method.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • I have consulted the FAQ and blog for any relevant entries or release notes.

  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

Poetry doesn't handle underscores in package names really well. Two examples are:

  • poetry new test_package
    • prints Created package test_package in test_package
    • but cat test_package/pyproject.toml actually prints name = "test-package"
  • poetry version still prints test-package, even if you manually change pyproject.toml to name = "test_package"

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions