@@ -51,19 +51,29 @@ def run(self):
51
51
raise SystemExit (report .total_errors > 0 )
52
52
53
53
54
- with open ("README.md" , "r" ) as fh :
55
- long_description = fh .read ()
54
+ def long_description ():
55
+ # check if README.md exists
56
+ if not os .path .exists ("README.md" ):
57
+ return ""
58
+ with open ("README.md" , "r" ) as fh :
59
+ return fh .read ()
60
+
61
+
62
+ def requirements ():
63
+ # check if requirements.txt exists
64
+ if not os .path .exists ("requirements.txt" ):
65
+ return []
66
+ with open ("requirements.txt" ) as f :
67
+ return f .read ().splitlines ()
56
68
57
- with open ("requirements.txt" ) as fh :
58
- requirements = fh .read ().split ("\n " )
59
69
60
70
setup (
61
71
name = "table2ascii" ,
62
- version = "0.1.1 " ,
72
+ version = "0.1.2 " ,
63
73
author = "Jonah Lawrence" ,
64
74
65
75
description = "Convert 2D Python lists into Unicode/Ascii tables" ,
66
- long_description = long_description ,
76
+ long_description = long_description () ,
67
77
long_description_content_type = "text/markdown" ,
68
78
url = "https://github.com/DenverCoder1/table2ascii" ,
69
79
project_urls = {
@@ -78,7 +88,7 @@ def run(self):
78
88
"Topic :: Utilities" ,
79
89
],
80
90
python_requires = ">=3.6" ,
81
- install_requires = [requirements ],
91
+ install_requires = [requirements () ],
82
92
setup_requires = [
83
93
"flake8>=3.8,<4" ,
84
94
],
0 commit comments