Skip to content

Commit b8d4034

Browse files
authored
Merge pull request #14 from DenverCoder1/remove-requirements
2 parents a6a5641 + 190bcca commit b8d4034

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ Module for converting 2D Python lists to fancy ASCII/Unicode tables
2323
- [Terminal outputs](#terminal-outputs)
2424
- [🧰 Development](#-development)
2525

26-
2726
## 📥 Installation
2827

2928
``pip install table2ascii``
3029

30+
**Requirements:** `Python 3.7+`
31+
32+
(For Python 3.6, installing `dataclasses` is required)
3133

3234
## 🧑‍💻 Usage
3335

requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

setup.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,29 @@ def run(self):
5151
raise SystemExit(report.total_errors > 0)
5252

5353

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()
5668

57-
with open("requirements.txt") as fh:
58-
requirements = fh.read().split("\n")
5969

6070
setup(
6171
name="table2ascii",
62-
version="0.1.1",
72+
version="0.1.2",
6373
author="Jonah Lawrence",
6474
author_email="[email protected]",
6575
description="Convert 2D Python lists into Unicode/Ascii tables",
66-
long_description=long_description,
76+
long_description=long_description(),
6777
long_description_content_type="text/markdown",
6878
url="https://github.com/DenverCoder1/table2ascii",
6979
project_urls={
@@ -78,7 +88,7 @@ def run(self):
7888
"Topic :: Utilities",
7989
],
8090
python_requires=">=3.6",
81-
install_requires=[requirements],
91+
install_requires=[requirements()],
8292
setup_requires=[
8393
"flake8>=3.8,<4",
8494
],

0 commit comments

Comments
 (0)