aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGertjan van den Burg <gertjanvandenburg@gmail.com>2020-03-06 22:57:41 +0000
committerGertjan van den Burg <gertjanvandenburg@gmail.com>2020-03-06 22:57:41 +0000
commite66fd034bdea1461a9deb6dd00e8e60ce464134f (patch)
treea938b86f84dd0dcdd21adc2585b9e12c4868a930
parentAllow continuing release script (diff)
downloadpygensvm-e66fd034bdea1461a9deb6dd00e8e60ce464134f.tar.gz
pygensvm-e66fd034bdea1461a9deb6dd00e8e60ce464134f.zip
Set content type of readme
-rw-r--r--setup.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/setup.py b/setup.py
index 885a5f9..503cc45 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
+import io
import os
from distutils.command.sdist import sdist
@@ -322,6 +323,10 @@ def check_requirements():
raise ImportError(numpy_instructions)
+class mysdist(sdist):
+ READMES = ("README", "README.txt", "README.rst", "README.md")
+
+
if __name__ == "__main__":
check_requirements()
@@ -334,12 +339,18 @@ if __name__ == "__main__":
else:
about["__version__"] = VERSION
+ try:
+ with io.open(os.path.join(here, "README.md"), encoding="utf-8") as fp:
+ long_description = "\n" + fp.read()
+ except FileNotFoundError:
+ long_description = DESCRIPTION
+
attr = configuration().todict()
attr["version"] = about["__version__"]
attr["description"] = DESCRIPTION
- attr["long_description"] = read("README.md")
- attr["long_description"] = "text/markdown"
+ attr["long_description"] = long_description
+ attr["long_description_content_type"] = "text/markdown"
attr["packages"] = [NAME]
attr["url"] = URL
attr["author"] = AUTHOR
@@ -347,7 +358,7 @@ if __name__ == "__main__":
attr["license"] = LICENSE
attr["install_requires"] = REQUIRED
attr["extras_require"] = EXTRAS
- attr["cmdclass"] = {"sdist": sdist}
+ attr["cmdclass"] = {"sdist": mysdist}
from numpy.distutils.core import setup