44from setuptools import setup , find_packages
55from setuptools .command .build_py import build_py as _build_py
66from setuptools .command .sdist import sdist as _sdist
7- import fnmatch
87import os
98import sys
109
@@ -62,24 +61,6 @@ def _stamp_version(filename: str) -> None:
6261 print ("WARNING: Couldn't find version line in file %s" % filename , file = sys .stderr )
6362
6463
65- def build_py_modules (basedir : str , excludes : Sequence = ()) -> Sequence :
66- # create list of py_modules from tree
67- res = set ()
68- _prefix = os .path .basename (basedir )
69- for root , _ , files in os .walk (basedir ):
70- for f in files :
71- _f , _ext = os .path .splitext (f )
72- if _ext not in [".py" ]:
73- continue
74- _f = os .path .join (root , _f )
75- _f = os .path .relpath (_f , basedir )
76- _f = "{}.{}" .format (_prefix , _f .replace (os .sep , "." ))
77- if any (fnmatch .fnmatch (_f , x ) for x in excludes ):
78- continue
79- res .add (_f )
80- return list (res )
81-
82-
8364setup (
8465 name = "GitPython" ,
8566 cmdclass = {"build_py" : build_py , "sdist" : sdist },
@@ -91,7 +72,6 @@ def build_py_modules(basedir: str, excludes: Sequence = ()) -> Sequence:
9172 url = "https://github.com/gitpython-developers/GitPython" ,
9273 packages = find_packages (exclude = ["test" , "test.*" ]),
9374 include_package_data = True ,
94- py_modules = build_py_modules ("./git" , excludes = ["git.ext.*" ]),
9575 package_dir = {"git" : "git" },
9676 python_requires = ">=3.7" ,
9777 install_requires = requirements ,
0 commit comments