Skip to content

Commit 158d12e

Browse files
committed
optimize setup.py
1 parent 6cbde71 commit 158d12e

File tree

5 files changed

+23
-12
lines changed

5 files changed

+23
-12
lines changed

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include requirements.txt
2+
include VERSION

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.0.4

doc/source/conf.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
import sys
1616
import os
1717

18+
try:
19+
with open(os.path.join("..", "..", "VERSION"), "r") as version:
20+
version_txt = version.read().rstrip()
21+
except:
22+
version_txt = "not_in_sphinx"
23+
1824
# If extensions (or modules to document with autodoc) are in another directory,
1925
# add these directories to sys.path here. If the directory is relative to the
2026
# documentation root, use os.path.abspath to make it absolute, like shown here.
@@ -59,9 +65,9 @@
5965
# built documents.
6066
#
6167
# The short X.Y version.
62-
version = '0.0.3'
68+
version = version_txt
6369
# The full version, including alpha/beta/rc tags.
64-
release = '0.0.3'
70+
release = version_txt
6571

6672
# The language for content autogenerated by Sphinx. Refer to documentation
6773
# for a list of supported languages.

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
pyexcel>=0.1.5
2+
pyexcel-webio>=0.0.4
3+
Flask>=0.10.1

setup.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@
88
with open("README.rst", 'r') as readme:
99
README_txt = readme.read()
1010

11-
dependencies = [
12-
'pyexcel>=0.1.5',
13-
'pyexcel-webio>=0.0.3',
14-
'Flask>=0.10.1'
15-
]
11+
with open("requirements.txt", 'r') as requirements_txt:
12+
lines = requirements_txt.readlines()
13+
lines = map(lambda x: x.rstrip(), lines)
14+
dependencies = lines
15+
16+
with open("VERSION", "r") as version:
17+
version_txt = version.read().rstrip()
18+
1619
extras = {
1720
'xls': ['pyexcel-xls>=0.0.7'],
1821
'xlsx': ['pyexcel-xlsx>=0.0.7'],
19-
'ods3': [
20-
'pyexcel-ods3>=0.0.8',
21-
'https://github.com/T0ha/ezodf/archive/2c69103e6c0715adb0e36562cb2e6325fd776112.zip',
22-
],
22+
'ods3': ['pyexcel-ods3>=0.0.10']
2323
}
2424

2525
setup(
2626
name='Flask-Excel',
2727
author="C. W.",
28-
version='0.0.3',
28+
version=version_txt,
2929
author_email="wangc_2011@hotmail.com",
3030
url="https://github.com/chfw/Flask-Excel",
3131
description='A flask extension that provides one application programming interface to read and write data in different excel file formats',

0 commit comments

Comments
 (0)