diff --git a/doc/index.rst b/doc/index.rst index fa534d0d10..0f9c1a7f7e 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -11,7 +11,7 @@ Welcome to git-fleximod's documentation! :caption: Contents: .. module:: sphinxcontrib.autoprogram .. sphinx_argparse_cli:: - :module: classes.cli + :module: git_fleximod.cli :func: get_parser :prog: git-fleximod diff --git a/src/__init__.py b/git_fleximod/__init__.py similarity index 100% rename from src/__init__.py rename to git_fleximod/__init__.py diff --git a/src/classes/cli.py b/git_fleximod/cli.py similarity index 99% rename from src/classes/cli.py rename to git_fleximod/cli.py index 65f70cdd34..822b314387 100644 --- a/src/classes/cli.py +++ b/git_fleximod/cli.py @@ -3,7 +3,6 @@ __version__ = "0.5.0" - def find_root_dir(filename=".git"): d = Path.cwd() root = Path(d.root) diff --git a/src/git-fleximod b/git_fleximod/git-fleximod.py similarity index 98% rename from src/git-fleximod rename to git_fleximod/git-fleximod.py index 385515819c..9e4969d6c1 100755 --- a/src/git-fleximod +++ b/git_fleximod/git-fleximod.py @@ -4,10 +4,10 @@ import shutil import logging import textwrap -from classes import utils -from classes import cli -from classes.gitinterface import GitInterface -from classes.gitmodules import GitModules +from git_fleximod import utils +from git_fleximod import cli +from git_fleximod.gitinterface import GitInterface +from git_fleximod.gitmodules import GitModules from configparser import NoOptionError # logger variable is global @@ -343,7 +343,7 @@ def submodules_test(gitmodules, root_dir): return testfails + localmods -def _main_func(): +def main(): ( root_dir, file_name, @@ -393,4 +393,4 @@ def _main_func(): if __name__ == "__main__": - sys.exit(_main_func()) + sys.exit(main()) diff --git a/src/classes/gitinterface.py b/git_fleximod/gitinterface.py similarity index 98% rename from src/classes/gitinterface.py rename to git_fleximod/gitinterface.py index 35c593a095..eff155d54d 100644 --- a/src/classes/gitinterface.py +++ b/git_fleximod/gitinterface.py @@ -1,6 +1,5 @@ import os -from classes import utils - +from . import utils class GitInterface: def __init__(self, repo_path, logger): diff --git a/src/classes/gitmodules.py b/git_fleximod/gitmodules.py similarity index 98% rename from src/classes/gitmodules.py rename to git_fleximod/gitmodules.py index dd2e1fc948..ae0ebe121c 100644 --- a/src/classes/gitmodules.py +++ b/git_fleximod/gitmodules.py @@ -1,7 +1,7 @@ import os import shutil from configparser import ConfigParser -from classes.lstripreader import LstripReader +from .lstripreader import LstripReader class GitModules(ConfigParser): diff --git a/src/classes/lstripreader.py b/git_fleximod/lstripreader.py similarity index 100% rename from src/classes/lstripreader.py rename to git_fleximod/lstripreader.py diff --git a/src/classes/utils.py b/git_fleximod/utils.py similarity index 100% rename from src/classes/utils.py rename to git_fleximod/utils.py diff --git a/pyproject.toml b/pyproject.toml index 8b4246e256..17843e0b83 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,21 +9,22 @@ readme = "README.md" homepage = "https://github.com/jedwards4b/git-fleximod" keywords = ["git", "submodule", "sparse-checkout"] packages = [ - { include = "src/git-fleximod" }, - { include = "src/classes/*.py" }, - { include = "License" }, - { include = "tests" }, - { include = "doc/*.rst" }, - { include = "doc/Makefile" }, - { include = "doc/make.bat" }, - { include = "doc/conf.py" }, +{ include = "git_fleximod"}, +{ include = "doc"}, ] +[tool.poetry.scripts] +git-fleximod = "git_fleximod.git-fleximod:main" +fsspec = "fsspec.fuse:main" + [tool.poetry.dependencies] python = "^3.8" GitPython = "^3.1.0" +sphinx = "^5.0.0" +fsspec = "^2023.12.2" +wheel = "^0.42.0" -[tools.poetry.urls] +[tool.poetry.urls] "Bug Tracker" = "https://github.com/jedwards4b/git-fleximod/issues" [build-system] diff --git a/src/classes/__init__.py b/src/classes/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/test_import.py b/tests/test_import.py index becf751441..d5ca878de5 100644 --- a/tests/test_import.py +++ b/tests/test_import.py @@ -1,9 +1,8 @@ # pylint: disable=unused-import -from classes import utils -from classes.gitinterface import GitInterface -from classes.gitmodules import GitModules -from classes.version import __version__ - +from git_fleximod import cli +from git_fleximod import utils +from git_fleximod.gitinterface import GitInterface +from git_fleximod.gitmodules import GitModules def test_import(): print("here")