Commit 0f747917 by Branch Vincent

test: address deprecation warnings

parent f9936e3a
...@@ -29,7 +29,7 @@ if sys.platform == "darwin": ...@@ -29,7 +29,7 @@ if sys.platform == "darwin":
auth_toml = _LEGACY_CONFIG_DIR / "auth.toml" auth_toml = _LEGACY_CONFIG_DIR / "auth.toml"
if any(file.exists() for file in (auth_toml, config_toml)): if any(file.exists() for file in (auth_toml, config_toml)):
logger.warn( logger.warning(
"Configuration file exists at %s, reusing this directory.\n\nConsider" "Configuration file exists at %s, reusing this directory.\n\nConsider"
" moving configuration to %s, as support for the legacy directory will be" " moving configuration to %s, as support for the legacy directory will be"
" removed in an upcoming release.", " removed in an upcoming release.",
......
...@@ -10,6 +10,7 @@ import re ...@@ -10,6 +10,7 @@ import re
import subprocess import subprocess
import sys import sys
import sysconfig import sysconfig
import warnings
from contextlib import contextmanager from contextlib import contextmanager
from copy import deepcopy from copy import deepcopy
...@@ -1538,6 +1539,8 @@ class SystemEnv(Env): ...@@ -1538,6 +1539,8 @@ class SystemEnv(Env):
d = Distribution() d = Distribution()
d.parse_config_files() d.parse_config_files()
with warnings.catch_warnings():
warnings.filterwarnings("ignore", "setup.py install is deprecated")
obj = d.get_command_obj("install", create=True) obj = d.get_command_obj("install", create=True)
obj.finalize_options() obj.finalize_options()
......
...@@ -32,8 +32,8 @@ class ManagerFactory(Protocol): ...@@ -32,8 +32,8 @@ class ManagerFactory(Protocol):
class MyPlugin(Plugin): class MyPlugin(Plugin):
def activate(self, poetry: Poetry, io: BufferedIO) -> None: def activate(self, poetry: Poetry, io: BufferedIO) -> None:
io.write_line("Setting readme") io.write_line("Setting readmes")
poetry.package.readme = "README.md" poetry.package.readmes = ("README.md",)
class MyCommandPlugin(ApplicationPlugin): class MyCommandPlugin(ApplicationPlugin):
...@@ -95,8 +95,8 @@ def test_load_plugins_and_activate( ...@@ -95,8 +95,8 @@ def test_load_plugins_and_activate(
manager.load_plugins() manager.load_plugins()
manager.activate(poetry, io) manager.activate(poetry, io)
assert poetry.package.readme == "README.md" assert poetry.package.readmes == ("README.md",)
assert io.fetch_output() == "Setting readme\n" assert io.fetch_output() == "Setting readmes\n"
def test_load_plugins_with_invalid_plugin( def test_load_plugins_with_invalid_plugin(
......
...@@ -28,8 +28,8 @@ fixtures_dir = Path(__file__).parent / "fixtures" ...@@ -28,8 +28,8 @@ fixtures_dir = Path(__file__).parent / "fixtures"
class MyPlugin(Plugin): class MyPlugin(Plugin):
def activate(self, poetry: Poetry, io: IO) -> None: def activate(self, poetry: Poetry, io: IO) -> None:
io.write_line("Setting readme") io.write_line("Setting readmes")
poetry.package.readme = "README.md" poetry.package.readmes = ("README.md",)
def test_create_poetry(): def test_create_poetry():
...@@ -343,4 +343,4 @@ def test_create_poetry_with_plugins(mocker: MockerFixture): ...@@ -343,4 +343,4 @@ def test_create_poetry_with_plugins(mocker: MockerFixture):
poetry = Factory().create_poetry(fixtures_dir / "sample_project") poetry = Factory().create_poetry(fixtures_dir / "sample_project")
assert poetry.package.readme == "README.md" assert poetry.package.readmes == ("README.md",)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment