From 0c45c55480b95ddf4d8d063b71eadebda5652aba Mon Sep 17 00:00:00 2001 From: David Hotham Date: Wed, 1 Nov 2023 19:41:09 +0000 Subject: [PATCH 1/2] remove fancy bullets, just use hyphens --- src/poetry/console/commands/add.py | 2 +- .../console/commands/self/show/plugins.py | 2 +- src/poetry/installation/executor.py | 28 ++--- src/poetry/puzzle/provider.py | 26 ++--- .../console/commands/self/test_add_plugins.py | 26 ++--- .../commands/self/test_remove_plugins.py | 6 +- .../commands/self/test_show_plugins.py | 6 +- tests/console/commands/self/test_update.py | 4 +- tests/console/commands/test_add.py | 102 +++++++++--------- tests/console/commands/test_remove.py | 2 +- tests/installation/test_executor.py | 43 ++++---- 11 files changed, 124 insertions(+), 123 deletions(-) diff --git a/src/poetry/console/commands/add.py b/src/poetry/console/commands/add.py index 37277c94514..fc13f6fc1c4 100644 --- a/src/poetry/console/commands/add.py +++ b/src/poetry/console/commands/add.py @@ -298,5 +298,5 @@ def notify_about_existing_packages(self, existing_packages: list[str]) -> None: " be skipped:\n" ) for name in existing_packages: - self.line(f" • {name}") + self.line(f" - {name}") self.line(self._hint_update_packages) diff --git a/src/poetry/console/commands/self/show/plugins.py b/src/poetry/console/commands/self/show/plugins.py index 15c98548a9e..9f8299a35fa 100644 --- a/src/poetry/console/commands/self/show/plugins.py +++ b/src/poetry/console/commands/self/show/plugins.py @@ -88,7 +88,7 @@ def _system_project_handle(self) -> int: package = info.package description = " " + package.description if package.description else "" self.line("") - self.line(f" • {name} ({package.version}){description}") + self.line(f" - {name} ({package.version}){description}") provide_line = " " if info.plugins: diff --git a/src/poetry/installation/executor.py b/src/poetry/installation/executor.py index 0d4ca0575c4..263a3fc1095 100644 --- a/src/poetry/installation/executor.py +++ b/src/poetry/installation/executor.py @@ -248,18 +248,18 @@ def _execute_operation(self, operation: Operation) -> None: with self._lock: self._sections[id(operation)] = self._io.section() self._sections[id(operation)].write_line( - f" • {op_message}:" + f" - {op_message}:" " Pending..." ) else: if self._should_write_operation(operation): if not operation.skipped: self._io.write_line( - f" • {op_message}" + f" - {op_message}" ) else: self._io.write_line( - f" • {op_message}: " + f" - {op_message}: " "Skipped " "for the following reason: " f"{operation.skip_reason}" @@ -287,7 +287,7 @@ def _execute_operation(self, operation: Operation) -> None: io = self._io else: message = ( - " " + " -" f" {self.get_operation_message(operation, error=True)}:" " Failed" ) @@ -343,7 +343,7 @@ def _execute_operation(self, operation: Operation) -> None: except KeyboardInterrupt: try: message = ( - " " + " -" f" {self.get_operation_message(operation, warning=True)}:" " Cancelled" ) @@ -363,7 +363,7 @@ def _do_execute_operation(self, operation: Operation) -> int: if self.supports_fancy_output(): self._write( operation, - f" • {operation_message}: " + f" - {operation_message}: " "Skipped " "for the following reason: " f"{operation.skip_reason}", @@ -382,7 +382,7 @@ def _do_execute_operation(self, operation: Operation) -> int: return result operation_message = self.get_operation_message(operation, done=True) - message = f" • {operation_message}" + message = f" - {operation_message}" self._write(operation, message) self._increment_operations_count(operation, True) @@ -516,7 +516,7 @@ def _execute_update(self, operation: Install | Update) -> int: def _execute_uninstall(self, operation: Uninstall) -> int: op_msg = self.get_operation_message(operation) - message = f" • {op_msg}: Removing..." + message = f" - {op_msg}: Removing..." self._write(operation, message) return self._remove(operation.package) @@ -543,7 +543,7 @@ def _install(self, operation: Install | Update) -> int: operation_message = self.get_operation_message(operation) message = ( - f" • {operation_message}:" + f" - {operation_message}:" " Installing..." ) self._write(operation, message) @@ -591,7 +591,7 @@ def _prepare_archive( operation_message = self.get_operation_message(operation) message = ( - f" • {operation_message}:" + f" - {operation_message}:" " Preparing..." ) self._write(operation, message) @@ -630,7 +630,7 @@ def _prepare_git_archive(self, operation: Install | Update) -> Path: operation_message = self.get_operation_message(operation) message = ( - f" • {operation_message}: Cloning..." + f" - {operation_message}: Cloning..." ) self._write(operation, message) @@ -673,7 +673,7 @@ def _install_directory_without_wheel_installer( operation_message = self.get_operation_message(operation) message = ( - f" • {operation_message}:" + f" - {operation_message}:" " Building..." ) self._write(operation, message) @@ -773,7 +773,7 @@ def _download_link(self, operation: Install | Update, link: Link) -> Path: if archive.suffix != ".whl": message = ( - f" • {self.get_operation_message(operation)}:" + f" - {self.get_operation_message(operation)}:" " Preparing..." ) self._write(operation, message) @@ -814,7 +814,7 @@ def _download_archive( operation_message = self.get_operation_message(operation) message = ( - f" • {operation_message}: Downloading..." + f" - {operation_message}: Downloading..." ) progress = None if self.supports_fancy_output(): diff --git a/src/poetry/puzzle/provider.py b/src/poetry/puzzle/provider.py index c7fc3ff527b..624522de8af 100644 --- a/src/poetry/puzzle/provider.py +++ b/src/poetry/puzzle/provider.py @@ -580,18 +580,18 @@ def complete_package( # the requirements will be merged. # # For instance: - # • enum34; python_version=="2.7" - # • enum34; python_version=="3.3" + # - enum34; python_version=="2.7" + # - enum34; python_version=="3.3" # # will become: - # • enum34; python_version=="2.7" or python_version=="3.3" + # - enum34; python_version=="2.7" or python_version=="3.3" # # If the duplicate dependencies have different constraints # we have to split the dependency graph. # # An example of this is: - # • pypiwin32 (220); sys_platform == "win32" and python_version >= "3.6" - # • pypiwin32 (219); sys_platform == "win32" and python_version < "3.6" + # - pypiwin32 (220); sys_platform == "win32" and python_version >= "3.6" + # - pypiwin32 (219); sys_platform == "win32" and python_version < "3.6" duplicates: dict[str, list[Dependency]] = defaultdict(list) for dep in dependencies: duplicates[dep.complete_name].append(dep) @@ -617,13 +617,13 @@ def complete_package( # tell the solver to make new resolutions with specific overrides. # # For instance, if the foo (1.2.3) package has the following dependencies: - # • bar (>=2.0) ; python_version >= "3.6" - # • bar (<2.0) ; python_version < "3.6" + # - bar (>=2.0) ; python_version >= "3.6" + # - bar (<2.0) ; python_version < "3.6" # # then the solver will need to make two new resolutions # with the following overrides: - # • {=2.0)>} - # • {} + # - {=2.0)>} + # - {} def fmt_warning(d: Dependency) -> str: dependency_marker = d.marker if not d.marker.is_any() else "*" @@ -915,10 +915,10 @@ def _resolve_overlapping_markers( # This is an edge case where the dependency is not required # for the resulting marker. However, we have to consider it anyway # in order to not miss other dependencies later, for instance: - # • foo (1.0) ; python == 3.7 - # • foo (2.0) ; python == 3.8 - # • bar (2.0) ; python == 3.8 - # • bar (3.0) ; python == 3.9 + # - foo (1.0) ; python == 3.7 + # - foo (2.0) ; python == 3.8 + # - bar (2.0) ; python == 3.8 + # - bar (3.0) ; python == 3.9 # the last dependency would be missed without this, # because the intersection with both foo dependencies is empty. diff --git a/tests/console/commands/self/test_add_plugins.py b/tests/console/commands/self/test_add_plugins.py index 07b0c905b1f..78627afa066 100644 --- a/tests/console/commands/self/test_add_plugins.py +++ b/tests/console/commands/self/test_add_plugins.py @@ -57,7 +57,7 @@ def test_add_no_constraint( Package operations: 1 install, 0 updates, 0 removals - • Installing poetry-plugin (0.1.0) + - Installing poetry-plugin (0.1.0) Writing lock file """ @@ -79,7 +79,7 @@ def test_add_with_constraint( Package operations: 1 install, 0 updates, 0 removals - • Installing poetry-plugin (0.2.0) + - Installing poetry-plugin (0.2.0) Writing lock file """ @@ -101,8 +101,8 @@ def test_add_with_git_constraint( Package operations: 2 installs, 0 updates, 0 removals - • Installing pendulum (2.0.5) - • Installing poetry-plugin (0.1.2 9cf87a2) + - Installing pendulum (2.0.5) + - Installing poetry-plugin (0.1.2 9cf87a2) Writing lock file """ @@ -127,9 +127,9 @@ def test_add_with_git_constraint_with_extras( Package operations: 3 installs, 0 updates, 0 removals - • Installing pendulum (2.0.5) - • Installing tomlkit (0.7.0) - • Installing poetry-plugin (0.1.2 9cf87a2) + - Installing pendulum (2.0.5) + - Installing tomlkit (0.7.0) + - Installing poetry-plugin (0.1.2 9cf87a2) Writing lock file """ @@ -167,8 +167,8 @@ def test_add_with_git_constraint_with_subdirectory( Package operations: 2 installs, 0 updates, 0 removals - • Installing pendulum (2.0.5) - • Installing poetry-plugin (0.1.2 9cf87a2) + - Installing pendulum (2.0.5) + - Installing poetry-plugin (0.1.2 9cf87a2) Writing lock file """ @@ -220,7 +220,7 @@ def test_add_existing_plugin_warns_about_no_operation( The following packages are already present in the pyproject.toml and will be\ skipped: - • poetry-plugin + - poetry-plugin {tester.command._hint_update_packages} Nothing to add. """ @@ -264,7 +264,7 @@ def test_add_existing_plugin_updates_if_requested( Package operations: 0 installs, 1 update, 0 removals - • Updating poetry-plugin (1.2.3 -> 2.3.4) + - Updating poetry-plugin (1.2.3 -> 2.3.4) Writing lock file """ @@ -300,8 +300,8 @@ def test_adding_a_plugin_can_update_poetry_dependencies_if_needed( Package operations: 1 install, 1 update, 0 removals - • Updating tomlkit (0.7.1 -> 0.7.2) - • Installing poetry-plugin (1.2.3) + - Updating tomlkit (0.7.1 -> 0.7.2) + - Installing poetry-plugin (1.2.3) Writing lock file """ diff --git a/tests/console/commands/self/test_remove_plugins.py b/tests/console/commands/self/test_remove_plugins.py index 8000f2cead1..be5e44f6130 100644 --- a/tests/console/commands/self/test_remove_plugins.py +++ b/tests/console/commands/self/test_remove_plugins.py @@ -74,7 +74,7 @@ def test_remove_installed_package(tester: CommandTester) -> None: Package operations: 0 installs, 0 updates, 1 removal - • Removing poetry-plugin (1.2.3) + - Removing poetry-plugin (1.2.3) Writing lock file """ @@ -95,8 +95,8 @@ def test_remove_installed_package_dry_run(tester: CommandTester) -> None: Package operations: 0 installs, 0 updates, 1 removal, 1 skipped - • Removing poetry-plugin (1.2.3) - • Installing poetry ({__version__}): Skipped for the following reason: Already \ + - Removing poetry-plugin (1.2.3) + - Installing poetry ({__version__}): Skipped for the following reason: Already \ installed """ diff --git a/tests/console/commands/self/test_show_plugins.py b/tests/console/commands/self/test_show_plugins.py index 20ae7f5d930..e80afa82730 100644 --- a/tests/console/commands/self/test_show_plugins.py +++ b/tests/console/commands/self/test_show_plugins.py @@ -163,7 +163,7 @@ def test_show_displays_installed_plugins( tester.execute("") expected = """ - • poetry-plugin (1.2.3) + - poetry-plugin (1.2.3) 1 plugin and 1 application plugin """ @@ -189,7 +189,7 @@ def test_show_displays_installed_plugins_with_multiple_plugins( tester.execute("") expected = """ - • poetry-plugin (1.2.3) + - poetry-plugin (1.2.3) 2 plugins and 2 application plugins """ @@ -215,7 +215,7 @@ def test_show_displays_installed_plugins_with_dependencies( tester.execute("") expected = """ - • poetry-plugin (1.2.3) + - poetry-plugin (1.2.3) 1 plugin and 1 application plugin Dependencies diff --git a/tests/console/commands/self/test_update.py b/tests/console/commands/self/test_update.py index d2c6ef0c933..808a7663a06 100644 --- a/tests/console/commands/self/test_update.py +++ b/tests/console/commands/self/test_update.py @@ -71,8 +71,8 @@ def test_self_update_can_update_from_recommended_installation( Package operations: 0 installs, 2 updates, 0 removals - • Updating cleo (0.8.2 -> 1.0.0) - • Updating poetry ({__version__} -> {new_version}) + - Updating cleo (0.8.2 -> 1.0.0) + - Updating poetry ({__version__} -> {new_version}) Writing lock file """ diff --git a/tests/console/commands/test_add.py b/tests/console/commands/test_add.py index c8fd87a5766..f334f586582 100644 --- a/tests/console/commands/test_add.py +++ b/tests/console/commands/test_add.py @@ -85,7 +85,7 @@ def test_add_no_constraint( Package operations: 1 install, 0 updates, 0 removals - • Installing cachy (0.2.0) + - Installing cachy (0.2.0) Writing lock file """ @@ -117,7 +117,7 @@ def test_add_replace_by_constraint( Package operations: 1 install, 0 updates, 0 removals - • Installing cachy (0.2.0) + - Installing cachy (0.2.0) Writing lock file """ @@ -138,7 +138,7 @@ def test_add_replace_by_constraint( Package operations: 1 install, 0 updates, 0 removals - • Installing cachy (0.1.0) + - Installing cachy (0.1.0) Writing lock file """ @@ -189,7 +189,7 @@ def test_add_equal_constraint(repo: TestRepository, tester: CommandTester) -> No Package operations: 1 install, 0 updates, 0 removals - • Installing cachy (0.1.0) + - Installing cachy (0.1.0) Writing lock file """ @@ -212,7 +212,7 @@ def test_add_greater_constraint(repo: TestRepository, tester: CommandTester) -> Package operations: 1 install, 0 updates, 0 removals - • Installing cachy (0.2.0) + - Installing cachy (0.2.0) Writing lock file """ @@ -246,8 +246,8 @@ def test_add_constraint_with_extras( Package operations: 2 installs, 0 updates, 0 removals - • Installing msgpack-python (0.5.3) - • Installing cachy (0.1.0) + - Installing msgpack-python (0.5.3) + - Installing cachy (0.1.0) Writing lock file """ @@ -277,8 +277,8 @@ def test_add_constraint_dependencies( Package operations: 2 installs, 0 updates, 0 removals - • Installing msgpack-python (0.5.3) - • Installing cachy (0.2.0) + - Installing msgpack-python (0.5.3) + - Installing cachy (0.2.0) Writing lock file """ @@ -309,8 +309,8 @@ def test_add_git_constraint( Package operations: 2 installs, 0 updates, 0 removals - • Installing pendulum (1.4.4) - • Installing demo (0.1.2 9cf87a2) + - Installing pendulum (1.4.4) + - Installing demo (0.1.2 9cf87a2) Writing lock file """ @@ -346,8 +346,8 @@ def test_add_git_constraint_with_poetry( Package operations: 2 installs, 0 updates, 0 removals - • Installing pendulum (1.4.4) - • Installing demo (0.1.2 9cf87a2) + - Installing pendulum (1.4.4) + - Installing demo (0.1.2 9cf87a2) Writing lock file """ @@ -380,10 +380,10 @@ def test_add_git_constraint_with_extras( Package operations: 4 installs, 0 updates, 0 removals - • Installing cleo (0.6.5) - • Installing pendulum (1.4.4) - • Installing tomlkit (0.5.5) - • Installing demo (0.1.2 9cf87a2) + - Installing cleo (0.6.5) + - Installing pendulum (1.4.4) + - Installing tomlkit (0.5.5) + - Installing demo (0.1.2 9cf87a2) Writing lock file """ @@ -425,7 +425,7 @@ def test_add_git_constraint_with_subdirectory( Package operations: 1 install, 0 updates, 0 removals - • Installing two (2.0.0 9cf87a2) + - Installing two (2.0.0 9cf87a2) Writing lock file """ @@ -472,8 +472,8 @@ def test_add_git_ssh_constraint( Package operations: 2 installs, 0 updates, 0 removals - • Installing pendulum (1.4.4) - • Installing demo (0.1.2 9cf87a2) + - Installing pendulum (1.4.4) + - Installing demo (0.1.2 9cf87a2) Writing lock file """ @@ -521,8 +521,8 @@ def test_add_directory_constraint( Package operations: 2 installs, 0 updates, 0 removals - • Installing pendulum (1.4.4) - • Installing demo (0.1.2 {demo_path}) + - Installing pendulum (1.4.4) + - Installing demo (0.1.2 {demo_path}) Writing lock file """ @@ -565,8 +565,8 @@ def test_add_directory_with_poetry( Package operations: 2 installs, 0 updates, 0 removals - • Installing pendulum (1.4.4) - • Installing demo (0.1.2 {demo_path}) + - Installing pendulum (1.4.4) + - Installing demo (0.1.2 {demo_path}) Writing lock file """ @@ -598,8 +598,8 @@ def test_add_file_constraint_wheel( Package operations: 2 installs, 0 updates, 0 removals - • Installing pendulum (1.4.4) - • Installing demo (0.1.0 {demo_path}) + - Installing pendulum (1.4.4) + - Installing demo (0.1.0 {demo_path}) Writing lock file """ @@ -637,8 +637,8 @@ def test_add_file_constraint_sdist( Package operations: 2 installs, 0 updates, 0 removals - • Installing pendulum (1.4.4) - • Installing demo (0.1.0 {demo_path}) + - Installing pendulum (1.4.4) + - Installing demo (0.1.0 {demo_path}) Writing lock file """ @@ -679,8 +679,8 @@ def test_add_constraint_with_extras_option( Package operations: 2 installs, 0 updates, 0 removals - • Installing msgpack-python (0.5.3) - • Installing cachy (0.2.0) + - Installing msgpack-python (0.5.3) + - Installing cachy (0.2.0) Writing lock file """ @@ -721,8 +721,8 @@ def test_add_url_constraint_wheel( Package operations: 2 installs, 0 updates, 0 removals - • Installing pendulum (1.4.4) - • Installing demo\ + - Installing pendulum (1.4.4) + - Installing demo\ (0.1.0 https://python-poetry.org/distributions/demo-0.1.0-py2.py3-none-any.whl) Writing lock file @@ -764,10 +764,10 @@ def test_add_url_constraint_wheel_with_extras( Package operations: 4 installs, 0 updates, 0 removals - • Installing cleo (0.6.5) - • Installing pendulum (1.4.4) - • Installing tomlkit (0.5.5) - • Installing demo\ + - Installing cleo (0.6.5) + - Installing pendulum (1.4.4) + - Installing tomlkit (0.5.5) + - Installing demo\ (0.1.0 https://python-poetry.org/distributions/demo-0.1.0-py2.py3-none-any.whl) Writing lock file @@ -837,7 +837,7 @@ def test_add_constraint_with_python( Package operations: 1 install, 0 updates, 0 removals - • Installing cachy (0.2.0) + - Installing cachy (0.2.0) Writing lock file """ @@ -876,7 +876,7 @@ def test_add_constraint_with_platform( Package operations: 1 install, 0 updates, 0 removals - • Installing cachy (0.2.0) + - Installing cachy (0.2.0) Writing lock file """ @@ -924,7 +924,7 @@ def test_add_constraint_with_source( Package operations: 1 install, 0 updates, 0 removals - • Installing cachy (0.2.0) + - Installing cachy (0.2.0) Writing lock file """ @@ -985,7 +985,7 @@ def test_add_to_section_that_does_not_exist_yet( Package operations: 1 install, 0 updates, 0 removals - • Installing cachy (0.2.0) + - Installing cachy (0.2.0) Writing lock file """ @@ -1034,7 +1034,7 @@ def test_add_to_dev_section_deprecated( Package operations: 1 install, 0 updates, 0 removals - • Installing cachy (0.2.0) + - Installing cachy (0.2.0) Writing lock file """ @@ -1067,7 +1067,7 @@ def test_add_should_not_select_prereleases( Package operations: 1 install, 0 updates, 0 removals - • Installing pyyaml (3.13) + - Installing pyyaml (3.13) Writing lock file """ @@ -1097,7 +1097,7 @@ def test_add_should_skip_when_adding_existing_package_with_no_constraint( expected = """\ The following packages are already present in the pyproject.toml and will be skipped: - • foo + - foo If you want to update it to the latest compatible version,\ you can use `poetry update package`. @@ -1122,7 +1122,7 @@ def test_add_should_skip_when_adding_canonicalized_existing_package_with_no_cons expected = """\ The following packages are already present in the pyproject.toml and will be skipped: - • Foo_Bar + - Foo_Bar If you want to update it to the latest compatible version,\ you can use `poetry update package`. @@ -1203,7 +1203,7 @@ def test_add_should_work_when_adding_existing_package_with_latest_constraint( Package operations: 1 install, 0 updates, 0 removals - • Installing foo (1.1.2) + - Installing foo (1.1.2) Writing lock file """ @@ -1233,7 +1233,7 @@ def test_add_chooses_prerelease_if_only_prereleases_are_available( Package operations: 1 install, 0 updates, 0 removals - • Installing foo (1.2.3b1) + - Installing foo (1.2.3b1) Writing lock file """ @@ -1256,7 +1256,7 @@ def test_add_prefers_stable_releases( Package operations: 1 install, 0 updates, 0 removals - • Installing foo (1.2.3) + - Installing foo (1.2.3) Writing lock file """ @@ -1303,7 +1303,7 @@ def test_add_to_section_that_does_no_exist_yet( Package operations: 1 install, 0 updates, 0 removals - • Installing cachy (0.2.0) + - Installing cachy (0.2.0) Writing lock file """ @@ -1462,9 +1462,9 @@ def test_add_extras_are_parsed_and_included( Package operations: 3 installs, 0 updates, 0 removals - • Installing msgpack-python (0.5.1) - • Installing redis (3.4.0) - • Installing cachy (0.2.0) + - Installing msgpack-python (0.5.1) + - Installing redis (3.4.0) + - Installing cachy (0.2.0) Writing lock file """ diff --git a/tests/console/commands/test_remove.py b/tests/console/commands/test_remove.py index 8cb0650e776..5fbff275172 100644 --- a/tests/console/commands/test_remove.py +++ b/tests/console/commands/test_remove.py @@ -327,7 +327,7 @@ def test_remove_performs_uninstall_op( Package operations: 0 installs, 0 updates, 1 removal - • Removing docker (4.3.1) + - Removing docker (4.3.1) Writing lock file """ diff --git a/tests/installation/test_executor.py b/tests/installation/test_executor.py index 3b2aec4e315..7ce8596cc52 100644 --- a/tests/installation/test_executor.py +++ b/tests/installation/test_executor.py @@ -256,13 +256,13 @@ def test_execute_executes_a_batch_of_operations( expected = f""" Package operations: 4 installs, 2 updates, 1 removal - • Installing pytest (3.5.1) - • Removing attrs (17.4.0) - • Updating requests (2.18.3 -> 2.18.4) - • Downgrading pytest (3.5.1 -> 3.5.0) - • Installing demo (0.1.0 {file_package.source_url}) - • Installing simple-project (1.2.3 {directory_package.source_url}) - • Installing demo (0.1.0 master) + - Installing pytest (3.5.1) + - Removing attrs (17.4.0) + - Updating requests (2.18.3 -> 2.18.4) + - Downgrading pytest (3.5.1 -> 3.5.0) + - Installing demo (0.1.0 {file_package.source_url}) + - Installing simple-project (1.2.3 {directory_package.source_url}) + - Installing demo (0.1.0 master) """ expected_lines = set(expected.splitlines()) @@ -419,7 +419,7 @@ def test_execute_shows_skipped_operations_if_verbose( expected = """ Package operations: 0 installs, 0 updates, 0 removals, 1 skipped - • Removing clikit (0.2.3): Skipped for the following reason: Not currently installed + - Removing clikit (0.2.3): Skipped for the following reason: Not currently installed """ assert io.fetch_output() == expected assert len(env.executed) == 0 @@ -442,7 +442,7 @@ def test_execute_should_show_errors( expected = """ Package operations: 1 install, 0 updates, 0 removals - • Installing clikit (0.2.3) + - Installing clikit (0.2.3) Exception @@ -473,10 +473,10 @@ def test_execute_works_with_ansi_output( # fmt: off expected = [ "\x1b[39;1mPackage operations\x1b[39;22m: \x1b[34m1\x1b[39m install, \x1b[34m0\x1b[39m updates, \x1b[34m0\x1b[39m removals", - "\x1b[34;1m•\x1b[39;22m \x1b[39mInstalling \x1b[39m\x1b[36mcleo\x1b[39m\x1b[39m (\x1b[39m\x1b[39;1m1.0.0a5\x1b[39;22m\x1b[39m)\x1b[39m: \x1b[34mPending...\x1b[39m", - "\x1b[34;1m•\x1b[39;22m \x1b[39mInstalling \x1b[39m\x1b[36mcleo\x1b[39m\x1b[39m (\x1b[39m\x1b[39;1m1.0.0a5\x1b[39;22m\x1b[39m)\x1b[39m: \x1b[34mDownloading...\x1b[39m", - "\x1b[34;1m•\x1b[39;22m \x1b[39mInstalling \x1b[39m\x1b[36mcleo\x1b[39m\x1b[39m (\x1b[39m\x1b[39;1m1.0.0a5\x1b[39;22m\x1b[39m)\x1b[39m: \x1b[34mInstalling...\x1b[39m", - "\x1b[32;1m•\x1b[39;22m \x1b[39mInstalling \x1b[39m\x1b[36mcleo\x1b[39m\x1b[39m (\x1b[39m\x1b[32m1.0.0a5\x1b[39m\x1b[39m)\x1b[39m", # finished + "\x1b[34;1m-\x1b[39;22m \x1b[39mInstalling \x1b[39m\x1b[36mcleo\x1b[39m\x1b[39m (\x1b[39m\x1b[39;1m1.0.0a5\x1b[39;22m\x1b[39m)\x1b[39m: \x1b[34mPending...\x1b[39m", + "\x1b[34;1m-\x1b[39;22m \x1b[39mInstalling \x1b[39m\x1b[36mcleo\x1b[39m\x1b[39m (\x1b[39m\x1b[39;1m1.0.0a5\x1b[39;22m\x1b[39m)\x1b[39m: \x1b[34mDownloading...\x1b[39m", + "\x1b[34;1m-\x1b[39;22m \x1b[39mInstalling \x1b[39m\x1b[36mcleo\x1b[39m\x1b[39m (\x1b[39m\x1b[39;1m1.0.0a5\x1b[39;22m\x1b[39m)\x1b[39m: \x1b[34mInstalling...\x1b[39m", + "\x1b[32;1m-\x1b[39;22m \x1b[39mInstalling \x1b[39m\x1b[36mcleo\x1b[39m\x1b[39m (\x1b[39m\x1b[32m1.0.0a5\x1b[39m\x1b[39m)\x1b[39m", # finished ] # fmt: on @@ -510,7 +510,7 @@ def test_execute_works_with_no_ansi_output( expected = """ Package operations: 1 install, 0 updates, 0 removals - • Installing cleo (1.0.0a5) + - Installing cleo (1.0.0a5) """ expected_lines = set(expected.splitlines()) output_lines = set(io_not_decorated.fetch_output().splitlines()) @@ -536,8 +536,8 @@ def test_execute_should_show_operation_as_cancelled_on_subprocess_keyboard_inter expected = """ Package operations: 1 install, 0 updates, 0 removals - • Installing clikit (0.2.3) - • Installing clikit (0.2.3): Cancelled + - Installing clikit (0.2.3) + - Installing clikit (0.2.3): Cancelled """ assert io.fetch_output() == expected @@ -557,6 +557,7 @@ def test_execute_should_gracefully_handle_io_error( def write_line(string: str, **kwargs: Any) -> None: # Simulate UnicodeEncodeError + string = string.replace("-", "•") string.encode("ascii") original_write_line(string, **kwargs) @@ -1228,7 +1229,7 @@ def test_executor_fallback_on_poetry_create_error_without_wheel_installer( expected = f""" Package operations: 1 install, 0 updates, 0 removals - • Installing simple-project (1.2.3 {directory_package.source_url}) + - Installing simple-project (1.2.3 {directory_package.source_url}) """ expected_lines = set(expected.splitlines()) @@ -1290,7 +1291,7 @@ def test_build_backend_errors_are_reported_correctly_if_caused_by_subprocess( expected_start = f""" Package operations: 1 install, 0 updates, 0 removals - • Installing {package_name} ({package_version} {package_url}) + - Installing {package_name} ({package_version} {package_url}) ChefBuildError @@ -1392,7 +1393,7 @@ def test_build_system_requires_not_available( expected_start = f"""\ Package operations: 1 install, 0 updates, 0 removals - • Installing {package_name} ({package_version} {package_url}) + - Installing {package_name} ({package_version} {package_url}) SolveFailure @@ -1439,7 +1440,7 @@ def test_build_system_requires_install_failure( expected_start = f"""\ Package operations: 1 install, 0 updates, 0 removals - • Installing {package_name} ({package_version} {package_url}) + - Installing {package_name} ({package_version} {package_url}) ChefInstallError @@ -1491,7 +1492,7 @@ def test_other_error( expected_start = f"""\ Package operations: 1 install, 0 updates, 0 removals - • Installing {package_name} ({package_version} {package_url}) + - Installing {package_name} ({package_version} {package_url}) FileNotFoundError """ From ee017c07847f478e1dbbf1632630fbf22b90cf43 Mon Sep 17 00:00:00 2001 From: David Hotham Date: Wed, 1 Nov 2023 19:47:15 +0000 Subject: [PATCH 2/2] appease ruff --- src/poetry/puzzle/provider.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/poetry/puzzle/provider.py b/src/poetry/puzzle/provider.py index 624522de8af..c7fc3ff527b 100644 --- a/src/poetry/puzzle/provider.py +++ b/src/poetry/puzzle/provider.py @@ -580,18 +580,18 @@ def complete_package( # the requirements will be merged. # # For instance: - # - enum34; python_version=="2.7" - # - enum34; python_version=="3.3" + # • enum34; python_version=="2.7" + # • enum34; python_version=="3.3" # # will become: - # - enum34; python_version=="2.7" or python_version=="3.3" + # • enum34; python_version=="2.7" or python_version=="3.3" # # If the duplicate dependencies have different constraints # we have to split the dependency graph. # # An example of this is: - # - pypiwin32 (220); sys_platform == "win32" and python_version >= "3.6" - # - pypiwin32 (219); sys_platform == "win32" and python_version < "3.6" + # • pypiwin32 (220); sys_platform == "win32" and python_version >= "3.6" + # • pypiwin32 (219); sys_platform == "win32" and python_version < "3.6" duplicates: dict[str, list[Dependency]] = defaultdict(list) for dep in dependencies: duplicates[dep.complete_name].append(dep) @@ -617,13 +617,13 @@ def complete_package( # tell the solver to make new resolutions with specific overrides. # # For instance, if the foo (1.2.3) package has the following dependencies: - # - bar (>=2.0) ; python_version >= "3.6" - # - bar (<2.0) ; python_version < "3.6" + # • bar (>=2.0) ; python_version >= "3.6" + # • bar (<2.0) ; python_version < "3.6" # # then the solver will need to make two new resolutions # with the following overrides: - # - {=2.0)>} - # - {} + # • {=2.0)>} + # • {} def fmt_warning(d: Dependency) -> str: dependency_marker = d.marker if not d.marker.is_any() else "*" @@ -915,10 +915,10 @@ def _resolve_overlapping_markers( # This is an edge case where the dependency is not required # for the resulting marker. However, we have to consider it anyway # in order to not miss other dependencies later, for instance: - # - foo (1.0) ; python == 3.7 - # - foo (2.0) ; python == 3.8 - # - bar (2.0) ; python == 3.8 - # - bar (3.0) ; python == 3.9 + # • foo (1.0) ; python == 3.7 + # • foo (2.0) ; python == 3.8 + # • bar (2.0) ; python == 3.8 + # • bar (3.0) ; python == 3.9 # the last dependency would be missed without this, # because the intersection with both foo dependencies is empty.