From 8cedf782c3e5c4552f4900925c7ccd351083939b Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Fri, 4 Aug 2023 15:18:10 +0200 Subject: [PATCH 1/2] move git_archive_all.py to git_archive_all/__init__.py to fix distribution of py.typed and *.pyi --- Makefile | 2 +- git_archive_all.py => git_archive_all/__init__.py | 0 git_archive_all.pyi => git_archive_all/__init__.pyi | 0 py.typed => git_archive_all/py.typed | 0 setup.py | 4 ++-- 5 files changed, 3 insertions(+), 3 deletions(-) rename git_archive_all.py => git_archive_all/__init__.py (100%) rename git_archive_all.pyi => git_archive_all/__init__.pyi (100%) rename py.typed => git_archive_all/py.typed (100%) diff --git a/Makefile b/Makefile index a866e2b..9671bbb 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ prefix=/usr/local -SOURCE_FILE=git_archive_all.py +SOURCE_FILE=git_archive_all/__init__.py TARGET_DIR=$(prefix)/bin TARGET_FILE=$(TARGET_DIR)/git-archive-all diff --git a/git_archive_all.py b/git_archive_all/__init__.py similarity index 100% rename from git_archive_all.py rename to git_archive_all/__init__.py diff --git a/git_archive_all.pyi b/git_archive_all/__init__.pyi similarity index 100% rename from git_archive_all.pyi rename to git_archive_all/__init__.pyi diff --git a/py.typed b/git_archive_all/py.typed similarity index 100% rename from py.typed rename to git_archive_all/py.typed diff --git a/setup.py b/setup.py index 605b471..718ec21 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ from setuptools.command.test import test as TestCommand # Parse the version from the file. -verstrline = open('git_archive_all.py', "rt").read() +verstrline = open('git_archive_all/__init__.py', "rt").read() VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]" mo = re.search(VSRE, verstrline, re.M) if mo: @@ -33,7 +33,7 @@ def run_tests(self): setup( version=verstr, - py_modules=['git_archive_all'], + packages=['git_archive_all'], package_data={'git_archive_all': ['py.typed', '*.pyi']}, entry_points={'console_scripts': 'git-archive-all=git_archive_all:main'}, cmdclass={"test": PyTest}, From 7d81e3e4d1dce6ef94d9bc233267e48a994c182d Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Fri, 4 Aug 2023 15:42:27 +0200 Subject: [PATCH 2/2] type hints: add main --- git_archive_all/__init__.pyi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/git_archive_all/__init__.pyi b/git_archive_all/__init__.pyi index 710c1ea..8d1711b 100644 --- a/git_archive_all/__init__.pyi +++ b/git_archive_all/__init__.pyi @@ -68,3 +68,5 @@ class GitArchiver(object): @classmethod def list_repo_submodules(cls, repo_abspath: PathStr) -> Generator[PathStr, None, None]: ... + +def main(argv: Optional[List[str]]): ...