diff --git a/pyproject.toml b/pyproject.toml index 5e87664..b12deb3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", - "Topic :: Software Development :: Refactoring" + "Topic :: Software Development :: Quality Assurance" ] [project.scripts] diff --git a/src/p2pkg/__main__.py b/src/p2pkg/__main__.py index 2a3fdf0..26ab636 100644 --- a/src/p2pkg/__main__.py +++ b/src/p2pkg/__main__.py @@ -1,7 +1,6 @@ from __future__ import annotations import argparse -import os import pathlib import subprocess @@ -85,8 +84,16 @@ def main(argv: list[str] | None = None) -> int: prog="p2pkg", description="Migrate foo.py -> foo/__main__.py and generate foo/__init__.py that re-exports public API.", ) - parser.add_argument("files", nargs="+", help="Python module files to migrate (e.g. roles_list.py other.py).") - parser.add_argument("--no-git", action="store_true", help="Do not use `git mv` even if inside a git repo.") + parser.add_argument( + "files", + nargs="+", + help="Python module files to migrate (e.g. roles_list.py other.py).", + ) + parser.add_argument( + "--no-git", + action="store_true", + help="Do not use `git mv` even if inside a git repo.", + ) parser.add_argument( "--repo-root", default=".", diff --git a/tests/test_migration.py b/tests/test_migration.py index fa45556..a3d3fd6 100644 --- a/tests/test_migration.py +++ b/tests/test_migration.py @@ -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))