Skip to content

Commit 7e323d3

Browse files
committed
Packaging - in setup.py, pull requirements from requirements files so we don't have the requirements declared in two places that will get out of sync.
Add docs, AUTHORS, LICENSE, README, requirements files to package.
1 parent e131330 commit 7e323d3

5 files changed

Lines changed: 12 additions & 8 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
*~
44
docs/_build
55
*.egg-info
6+
*.egg
7+
dist

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include LICENSE AUTHORS README.rst requirements* docs/*

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
## We're using the best maintained fork of python-oauth2
2-
https://github.com/dgouldin/python-oauth2/tarball/master
2+
https://github.com/dgouldin/python-oauth2/tarball/master#egg=oauth2
33
requests==0.14.0
44
python-dateutil==1.5

requirements_dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
-r requirements.txt
22

33
Sphinx==1.1.3
4+
mock==0.8.0

setup.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33

44
import re
55

6-
try:
7-
from setuptools import setup
8-
except ImportError:
9-
from distutils.core import setup
6+
from setuptools import setup
107

11-
required = ['requests==0.14.0', 'python-dateutil==1.5']
8+
required = [line for line in open('requirements.txt').read().split("\n") if not line.startswith("http")]
9+
dependency_links = [line for line in open('requirements.txt').read().split("\n") if line.startswith("http")]
10+
required_dev = [line for line in open('requirements_dev.txt').read().split("\n") if not line.startswith("-r")]
1211
fbinit = open('fitbit/__init__.py').read()
1312
author = re.search("__author__ = '([^']+)'", fbinit).group(1)
1413
version = re.search("__version__ = '([^']+)'", fbinit).group(1)
@@ -24,10 +23,11 @@
2423
packages=['fitbit'],
2524
package_data={'': ['LICENSE']},
2625
include_package_data=True,
27-
install_requires=required,
26+
install_requires=["distribute"] + required,
27+
dependency_links=dependency_links,
2828
license='Apache 2.0',
2929
test_suite='tests.all_tests',
30-
tests_require=['mock==0.8.0'],
30+
tests_require=required_dev,
3131
classifiers=(
3232
'Intended Audience :: Developers',
3333
'Natural Language :: English',

0 commit comments

Comments
 (0)