diff options
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 34 |
1 files changed, 17 insertions, 17 deletions
@@ -6,23 +6,22 @@ import fnmatch import os import sys -with open(os.path.join(os.path.dirname(__file__), 'VERSION')) as v: +with open(os.path.join(os.path.dirname(__file__), "VERSION")) as v: VERSION = v.readline().strip() -with open('requirements.txt') as reqs_file: +with open("requirements.txt") as reqs_file: requirements = reqs_file.read().splitlines() -with open('test-requirements.txt') as reqs_file: +with open("test-requirements.txt") as reqs_file: test_requirements = reqs_file.read().splitlines() -with open('README.md') as rm_file: +with open("README.md") as rm_file: long_description = rm_file.read() class build_py(_build_py): - def run(self) -> None: - init = os.path.join(self.build_lib, 'git', '__init__.py') + init = os.path.join(self.build_lib, "git", "__init__.py") if os.path.exists(init): os.unlink(init) _build_py.run(self) @@ -31,13 +30,12 @@ class build_py(_build_py): class sdist(_sdist): - def make_release_tree(self, base_dir: str, files: Sequence) -> None: _sdist.make_release_tree(self, base_dir, files) - orig = os.path.join('git', '__init__.py') + orig = os.path.join("git", "__init__.py") assert os.path.exists(orig), orig dest = os.path.join(base_dir, orig) - if hasattr(os, 'link') and os.path.exists(dest): + if hasattr(os, "link") and os.path.exists(dest): os.unlink(dest) self.copy_file(orig, dest) _stamp_version(dest) @@ -46,9 +44,9 @@ class sdist(_sdist): def _stamp_version(filename: str) -> None: found, out = False, [] try: - with open(filename, 'r') as f: + with open(filename, "r") as f: for line in f: - if '__version__ =' in line: + if "__version__ =" in line: line = line.replace("'git'", "'%s'" % VERSION) found = True out.append(line) @@ -56,10 +54,12 @@ def _stamp_version(filename: str) -> None: print("Couldn't find file %s to stamp version" % filename, file=sys.stderr) if found: - with open(filename, 'w') as f: + with open(filename, "w") as f: f.writelines(out) else: - print("WARNING: Couldn't find version line in file %s" % filename, file=sys.stderr) + print( + "WARNING: Couldn't find version line in file %s" % filename, file=sys.stderr + ) def build_py_modules(basedir: str, excludes: Sequence = ()) -> Sequence: @@ -82,7 +82,7 @@ def build_py_modules(basedir: str, excludes: Sequence = ()) -> Sequence: setup( name="GitPython", - cmdclass={'build_py': build_py, 'sdist': sdist}, + cmdclass={"build_py": build_py, "sdist": sdist}, version=VERSION, description="""GitPython is a python library used to interact with Git repositories""", author="Sebastian Thiel, Michael Trier", @@ -92,8 +92,8 @@ setup( 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', + package_dir={"git": "git"}, + python_requires=">=3.7", install_requires=requirements, tests_require=requirements + test_requirements, zip_safe=False, @@ -123,5 +123,5 @@ setup( "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", - ] + ], ) |