Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omit py_modules in setup #1665

Merged
merged 1 commit into from
Sep 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from setuptools import setup, find_packages
from setuptools.command.build_py import build_py as _build_py
from setuptools.command.sdist import sdist as _sdist
import fnmatch
import os
import sys

Expand Down Expand Up @@ -62,24 +61,6 @@ def _stamp_version(filename: str) -> None:
print("WARNING: Couldn't find version line in file %s" % filename, file=sys.stderr)


def build_py_modules(basedir: str, excludes: Sequence = ()) -> Sequence:
# create list of py_modules from tree
res = set()
_prefix = os.path.basename(basedir)
for root, _, files in os.walk(basedir):
for f in files:
_f, _ext = os.path.splitext(f)
if _ext not in [".py"]:
continue
_f = os.path.join(root, _f)
_f = os.path.relpath(_f, basedir)
_f = "{}.{}".format(_prefix, _f.replace(os.sep, "."))
if any(fnmatch.fnmatch(_f, x) for x in excludes):
continue
res.add(_f)
return list(res)


setup(
name="GitPython",
cmdclass={"build_py": build_py, "sdist": sdist},
Expand All @@ -91,7 +72,6 @@ def build_py_modules(basedir: str, excludes: Sequence = ()) -> Sequence:
url="https://github.com/gitpython-developers/GitPython",
packages=find_packages(exclude=["test", "test.*"]),
include_package_data=True,
py_modules=build_py_modules("./git", excludes=["git.ext.*"]),
package_dir={"git": "git"},
python_requires=">=3.7",
install_requires=requirements,
Expand Down