From af9b1da0f48dcae023be59d3dd31b37047b3a8c4 Mon Sep 17 00:00:00 2001 From: "finswimmer77@gmail.com" Date: Tue, 19 Nov 2019 23:57:56 +0100 Subject: [PATCH 1/2] fix: success message by `poetry new` now shows correct package name if it was automatically renamed --- poetry/console/commands/new.py | 4 +++- poetry/repositories/installed_repository.py | 1 + tests/repositories/test_installed_repository.py | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/poetry/console/commands/new.py b/poetry/console/commands/new.py index 29a1e040a73..5159f88bd30 100644 --- a/poetry/console/commands/new.py +++ b/poetry/console/commands/new.py @@ -3,6 +3,8 @@ from cleo import argument from cleo import option +from poetry.utils.helpers import module_name + from .command import Command @@ -76,6 +78,6 @@ def handle(self): self.line( "Created package {} in {}".format( - name, path.relative_to(Path.cwd()) + module_name(name), path.relative_to(Path.cwd()) ) ) diff --git a/poetry/repositories/installed_repository.py b/poetry/repositories/installed_repository.py index cb8cdf3f27c..a10d6936cc4 100644 --- a/poetry/repositories/installed_repository.py +++ b/poetry/repositories/installed_repository.py @@ -1,4 +1,5 @@ from importlib_metadata import distributions + from poetry.packages import Package from poetry.utils._compat import Path from poetry.utils.env import Env diff --git a/tests/repositories/test_installed_repository.py b/tests/repositories/test_installed_repository.py index 19d6c65cc98..f3a1af7c937 100644 --- a/tests/repositories/test_installed_repository.py +++ b/tests/repositories/test_installed_repository.py @@ -1,6 +1,7 @@ import zipp from importlib_metadata import PathDistribution + from poetry.repositories.installed_repository import InstalledRepository from poetry.utils._compat import Path from poetry.utils.env import MockEnv as BaseMockEnv From 609dd34d51e9a2d5fb38c62acae4cb7f5fc919cc Mon Sep 17 00:00:00 2001 From: "finswimmer77@gmail.com" Date: Wed, 20 Nov 2019 00:05:12 +0100 Subject: [PATCH 2/2] fix: revert isort changes --- poetry/repositories/installed_repository.py | 1 - tests/repositories/test_installed_repository.py | 1 - 2 files changed, 2 deletions(-) diff --git a/poetry/repositories/installed_repository.py b/poetry/repositories/installed_repository.py index a10d6936cc4..cb8cdf3f27c 100644 --- a/poetry/repositories/installed_repository.py +++ b/poetry/repositories/installed_repository.py @@ -1,5 +1,4 @@ from importlib_metadata import distributions - from poetry.packages import Package from poetry.utils._compat import Path from poetry.utils.env import Env diff --git a/tests/repositories/test_installed_repository.py b/tests/repositories/test_installed_repository.py index f3a1af7c937..19d6c65cc98 100644 --- a/tests/repositories/test_installed_repository.py +++ b/tests/repositories/test_installed_repository.py @@ -1,7 +1,6 @@ import zipp from importlib_metadata import PathDistribution - from poetry.repositories.installed_repository import InstalledRepository from poetry.utils._compat import Path from poetry.utils.env import MockEnv as BaseMockEnv