Skip to content

Commit 1da7741

Browse files
authored
Merge pull request #1337 from Yobmod/main
Import README.md into setup.py
2 parents cfcae1d + bc2edef commit 1da7741

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

Diff for: setup.py

+12-9
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
import fnmatch
66
import os
77
import sys
8-
from os import path
98

10-
with open(path.join(path.dirname(__file__), 'VERSION')) as v:
9+
with open(os.path.join(os.path.dirname(__file__), 'VERSION')) as v:
1110
VERSION = v.readline().strip()
1211

1312
with open('requirements.txt') as reqs_file:
@@ -16,12 +15,15 @@
1615
with open('test-requirements.txt') as reqs_file:
1716
test_requirements = reqs_file.read().splitlines()
1817

18+
with open('README.md') as rm_file:
19+
long_description = rm_file.read()
20+
1921

2022
class build_py(_build_py):
2123

2224
def run(self) -> None:
23-
init = path.join(self.build_lib, 'git', '__init__.py')
24-
if path.exists(init):
25+
init = os.path.join(self.build_lib, 'git', '__init__.py')
26+
if os.path.exists(init):
2527
os.unlink(init)
2628
_build_py.run(self)
2729
_stamp_version(init)
@@ -32,10 +34,10 @@ class sdist(_sdist):
3234

3335
def make_release_tree(self, base_dir: str, files: Sequence) -> None:
3436
_sdist.make_release_tree(self, base_dir, files)
35-
orig = path.join('git', '__init__.py')
36-
assert path.exists(orig), orig
37-
dest = path.join(base_dir, orig)
38-
if hasattr(os, 'link') and path.exists(dest):
37+
orig = os.path.join('git', '__init__.py')
38+
assert os.path.exists(orig), orig
39+
dest = os.path.join(base_dir, orig)
40+
if hasattr(os, 'link') and os.path.exists(dest):
3941
os.unlink(dest)
4042
self.copy_file(orig, dest)
4143
_stamp_version(dest)
@@ -82,7 +84,7 @@ def build_py_modules(basedir: str, excludes: Sequence = ()) -> Sequence:
8284
name="GitPython",
8385
cmdclass={'build_py': build_py, 'sdist': sdist},
8486
version=VERSION,
85-
description="Python Git Library",
87+
description="""GitPython is a python library used to interact with Git repositories""",
8688
author="Sebastian Thiel, Michael Trier",
8789
8890
license="BSD",
@@ -96,6 +98,7 @@ def build_py_modules(basedir: str, excludes: Sequence = ()) -> Sequence:
9698
tests_require=requirements + test_requirements,
9799
zip_safe=False,
98100
long_description="""GitPython is a python library used to interact with Git repositories""",
101+
long_description_content_type="text/markdown",
99102
classifiers=[
100103
# Picked from
101104
# http://pypi.python.org/pypi?:action=list_classifiers

0 commit comments

Comments
 (0)