Commit 0f747917 by Branch Vincent

test: address deprecation warnings

parent f9936e3a
......@@ -29,7 +29,7 @@ if sys.platform == "darwin":
auth_toml = _LEGACY_CONFIG_DIR / "auth.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"
" moving configuration to %s, as support for the legacy directory will be"
" removed in an upcoming release.",
......
......@@ -10,6 +10,7 @@ import re
import subprocess
import sys
import sysconfig
import warnings
from contextlib import contextmanager
from copy import deepcopy
......@@ -1538,6 +1539,8 @@ class SystemEnv(Env):
d = Distribution()
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.finalize_options()
......
......@@ -32,8 +32,8 @@ class ManagerFactory(Protocol):
class MyPlugin(Plugin):
def activate(self, poetry: Poetry, io: BufferedIO) -> None:
io.write_line("Setting readme")
poetry.package.readme = "README.md"
io.write_line("Setting readmes")
poetry.package.readmes = ("README.md",)
class MyCommandPlugin(ApplicationPlugin):
......@@ -95,8 +95,8 @@ def test_load_plugins_and_activate(
manager.load_plugins()
manager.activate(poetry, io)
assert poetry.package.readme == "README.md"
assert io.fetch_output() == "Setting readme\n"
assert poetry.package.readmes == ("README.md",)
assert io.fetch_output() == "Setting readmes\n"
def test_load_plugins_with_invalid_plugin(
......
......@@ -28,8 +28,8 @@ fixtures_dir = Path(__file__).parent / "fixtures"
class MyPlugin(Plugin):
def activate(self, poetry: Poetry, io: IO) -> None:
io.write_line("Setting readme")
poetry.package.readme = "README.md"
io.write_line("Setting readmes")
poetry.package.readmes = ("README.md",)
def test_create_poetry():
......@@ -343,4 +343,4 @@ def test_create_poetry_with_plugins(mocker: MockerFixture):
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