fix: use valid trove classifier and clean up unused imports
Some checks failed
CI (tests + ruff) and stable tag / unittest (py3.10) (push) Has been cancelled
CI (tests + ruff) and stable tag / unittest (py3.11) (push) Has been cancelled
CI (tests + ruff) and stable tag / unittest (py3.12) (push) Has been cancelled
CI (tests + ruff) and stable tag / unittest (py3.13) (push) Has been cancelled
CI (tests + ruff) and stable tag / ruff (py3.12) (push) Has been cancelled
CI (tests + ruff) and stable tag / Tag stable (if version commit) (push) Has been cancelled

https://chatgpt.com/share/69468609-0584-800f-a3e0-9d58210fb0e8
This commit is contained in:
2025-12-20 14:45:07 +01:00
parent d8e5fdff26
commit 8ae9e9f08a
3 changed files with 20 additions and 10 deletions

View File

@@ -1,7 +1,5 @@
from __future__ import annotations
import importlib.util
import os
import sys
import tempfile
import textwrap
@@ -16,7 +14,8 @@ class TestMigration(unittest.TestCase):
with tempfile.TemporaryDirectory() as td:
root = Path(td)
mod = root / "roles_list.py"
mod.write_text(textwrap.dedent("""\
mod.write_text(
textwrap.dedent("""\
__all__ = ["add", "PUBLIC_CONST"]
PUBLIC_CONST = 123
_PRIVATE_CONST = 999
@@ -29,7 +28,8 @@ class TestMigration(unittest.TestCase):
if __name__ == "__main__":
print("running as script")
"""),encoding="utf-8",
"""),
encoding="utf-8",
)
migrate_one(mod, use_git=False, repo_root=root)
@@ -61,7 +61,8 @@ class TestMigration(unittest.TestCase):
with tempfile.TemporaryDirectory() as td:
root = Path(td)
mod = root / "foo.py"
mod.write_text(textwrap.dedent("""\
mod.write_text(
textwrap.dedent("""\
VALUE = "ok"
def hello() -> str:
@@ -69,7 +70,9 @@ class TestMigration(unittest.TestCase):
def _private() -> str:
return "no"
"""), encoding="utf-8")
"""),
encoding="utf-8",
)
migrate_one(mod, use_git=False, repo_root=root)
sys.path.insert(0, str(root))