Skip to content

Commit

Permalink
List requirements in setup file.
Browse files Browse the repository at this point in the history
[resolves #39]
[supersedes #38]
[supersedes #37]
[supersedes #35]
[supersedes #32]
  • Loading branch information
jmcarp committed Apr 17, 2015
1 parent c15b5ff commit 4878ed3
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 25 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ python:
- "pypy"

# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
install:
- pip install -r requirements.txt
install:
- python setup.py install
- pip install -U -r dev-requirements.txt
- pip install coverage coveralls nose responses

# command to run tests, e.g. python setup.py test
Expand Down
2 changes: 0 additions & 2 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
-r requirements.txt

coverage
coveralls
docutils
Expand Down
4 changes: 0 additions & 4 deletions requirements.txt

This file was deleted.

41 changes: 24 additions & 17 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,38 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import re
import sys

from setuptools import setup, find_packages
from pip.req import parse_requirements
from setuptools import setup
from setuptools import find_packages


REQUIREMENTS = [
'beautifulsoup4>=4.3.2',
'requests>=2.6.0',
'six>=1.9.0',
'Werkzeug>=0.10.4',
]
TEST_REQUIREMENTS = [
'coverage',
'coveralls',
'docutils',
'mock',
'nose',
'sphinx',
'tox',
]


if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()


def find_version(fname):
"""Attempts to find the version number in the file names fname.
Raises RuntimeError if not found.
"""
version = ''
with open(fname, 'r') as fp:
Expand All @@ -29,29 +46,19 @@ def find_version(fname):
raise RuntimeError('Cannot find version information')
return version

__version__ = find_version('robobrowser/__init__.py')

readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')
requirements = [
str(requirement.req)
for requirement in parse_requirements('requirements.txt')
]

setup(
name='robobrowser',
version=__version__,
version=find_version('robobrowser/__init__.py'),
description='Your friendly neighborhood web scraper',
author='Joshua Carp',
author_email='jm.carp@gmail.com',
url='https://github.com/jmcarp/robobrowser',
packages=find_packages(),
package_dir={'robobrowser': 'robobrowser'},
include_package_data=True,
install_requires=requirements,
tests_require=[
'nose',
],
install_requires=REQUIREMENTS,
tests_require=TEST_REQUIREMENTS,
license='MIT',
zip_safe=False,
keywords='robobrowser',
Expand Down

0 comments on commit 4878ed3

Please sign in to comment.