Skip to content

Commit aeaa492

Browse files
committed
refactor setup.py and version string
1 parent 5edf9b4 commit aeaa492

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

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.
@@ -56,9 +62,9 @@
5662
# built documents.
5763
#
5864
# The short X.Y version.
59-
version = '0.0.3'
65+
version = version_txt
6066
# The full version, including alpha/beta/rc tags.
61-
release = '0.0.3'
67+
release = version_txt
6268

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

requirements.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
pyexcel>=0.1.4
22
pyexcel-webio>=0.0.2
3-
pyexcel-xls>=0.0.7
4-
pyexcel-xlsx>=0.0.6
5-
django>=1.7.1
3+
Django>=1.7.1

setup.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@
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.2',
14-
'Django>=1.7.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'],
@@ -22,7 +25,7 @@
2225
setup(
2326
name='django-excel',
2427
author="C. W.",
25-
version='0.0.3',
28+
version=version_txt,
2629
author_email="wangc_2011@hotmail.com",
2730
url="https://github.com/chfw/django-excel",
2831
description='A django middleware that provides one application programming interface to read and write data in different excel file formats',

0 commit comments

Comments
 (0)