Skip to content

Commit f8d5567

Browse files
committed
improve setup.py
1 parent c1c9d7f commit f8d5567

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

setup.cfg

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[bdist_wheel]
2+
universal = 1

setup.py

+25-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,38 @@
1+
import os
2+
import sys
3+
14
from setuptools import setup, find_packages
2-
from dj_elastictranscoder import __version__
35

46

7+
def get_version():
8+
code = None
9+
path = os.path.join(
10+
os.path.dirname(os.path.abspath(__file__)),
11+
'dj_elastictranscoder',
12+
'__init__.py',
13+
)
14+
with open(path) as f:
15+
for line in f:
16+
if line.startswith('__version__'):
17+
code = line[len('__version__ = '):]
18+
break
19+
return eval(code)
20+
21+
22+
if sys.argv[-1] == 'wheel':
23+
os.system('pip wheel .')
24+
sys.exit()
25+
526
setup(
627
name='django-elastic-transcoder',
7-
version=__version__,
28+
version=get_version(),
829
description="Django with AWS elastic transcoder",
9-
long_description=open("README.rst").read(),
30+
long_description=open('README.rst').read(),
1031
author='tzangms',
1132
author_email='tzangms@streetvoice.com',
1233
url='http://github.com/StreetVoice/django-elastic-transcoder',
1334
license='MIT',
14-
packages=find_packages(),
35+
packages=find_packages(exclude=('testsapp', )),
1536
include_package_data=True,
1637
zip_safe=False,
1738
install_requires=[

0 commit comments

Comments
 (0)