浏览代码

add back long description (#297)

Jet 2 年之前
父节点
当前提交
b409e23e8a
共有 1 个文件被更改,包括 16 次插入1 次删除
  1. 16 1
      setup.py

+ 16 - 1
setup.py

@@ -20,4 +20,19 @@ def get_version():
     raise RuntimeError("bad version data in __init__.py")
 
 
-setup(name="minigrid", version=get_version())
+def get_description():
+    """Gets the description from the readme."""
+    with open("README.md") as fh:
+        long_description = ""
+        header_count = 0
+        for line in fh:
+            if line.startswith("##"):
+                header_count += 1
+            if header_count < 2:
+                long_description += line
+            else:
+                break
+    return long_description
+
+
+setup(name="minigrid", version=get_version(), long_description=get_description())