Skip to content

Commit

Permalink
Fix requirements files chaos.
Browse files Browse the repository at this point in the history
It should be much easier to maintain and use now.
* use - what httpretty requires to run
* test - what CI/Tox would use
* dev - what contributors should install
  • Loading branch information
syndbg committed Mar 13, 2015
1 parent 2471cd1 commit e7595fe
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 32 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Expand Up @@ -14,7 +14,8 @@ env:
- TEST_TYPE=functional

install:
- pip install -r requirements.txt -r test-requirements.txt
- pip install -r requirements/use.txt
- pip install -r requirements/test.txt

script:
- make $TEST_TYPE
4 changes: 1 addition & 3 deletions MANIFEST.in
@@ -1,6 +1,4 @@
include requirements.txt
include test-requirements.txt
include dev-requirements.txt
recursive-include requirements *.txt
recursive-include tests *.py
include tests/functional/fixtures/playback-*.json
include COPYING
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -449,7 +449,7 @@ mkvirtualenv --distribute --no-site-packages HTTPretty
#### install the dependencies

```console
pip install -r requirements.txt
pip install -r requirements/dev.txt
```

#### next steps:
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -462,7 +462,7 @@ install the dependencies

.. code:: console
pip install -r requirements.txt
pip install -r requirements/dev.txt
next steps:
^^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing.md
Expand Up @@ -12,7 +12,7 @@ mkvirtualenv --distribute --no-site-packages HTTPretty
## installing the dependencies

```console
pip install -r requirements.txt
pip install -r requirements/dev.txt
```

## next steps
Expand Down
4 changes: 2 additions & 2 deletions dev-requirements.txt → requirements/dev.txt
@@ -1,9 +1,9 @@
-r requirements.txt
-r use.txt
coverage
tox
markment
steadymark
nose
rednose
mock
sure
sure
File renamed without changes.
File renamed without changes.
42 changes: 21 additions & 21 deletions setup.py
@@ -1,4 +1,4 @@
# #!/usr/bin/env python
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# <HTTPretty - HTTP client mock for Python>
Expand Down Expand Up @@ -48,7 +48,7 @@ def read_version():


def parse_requirements(path):
"""Rudimentary parser for the `requirements.txt` file
"""Rudimentary parser for the `requirements/use.txt` file
We just want to separate regular packages from links to pass them to the
`install_requires` and `dependency_links` params of the `setup()`
Expand All @@ -57,7 +57,7 @@ def parse_requirements(path):
try:
requirements = map(str.strip, local_file(path).splitlines())
except IOError:
raise RuntimeError("Couldn't find the `requirements.txt' file :(")
raise RuntimeError("Couldn't find the `requirements/use.txt' file :(")

links = []
pkgs = []
Expand All @@ -79,24 +79,24 @@ def parse_requirements(path):


install_requires, dependency_links = \
parse_requirements('requirements.txt')
parse_requirements('requirements/use.txt')


setup(name='httpretty',
version=read_version(),
description='HTTP client mock for Python',
long_description=local_file('README.rst'),
author='Gabriel Falcao',
author_email='gabriel@nacaolivre.org',
url='http://github.com/gabrielfalcao/httpretty',
zip_safe=False,
packages=find_packages(exclude=['*tests*']),
tests_require=parse_requirements('test-requirements.txt'),
install_requires=install_requires,
dependency_links=dependency_links,
license='MIT',
test_suite='nose.collector',
classifiers=["Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Topic :: Software Development :: Testing"],
)
version=read_version(),
description='HTTP client mock for Python',
long_description=local_file('README.rst'),
author='Gabriel Falcao',
author_email='gabriel@nacaolivre.org',
url='http://github.com/gabrielfalcao/httpretty',
zip_safe=False,
packages=find_packages(exclude=['*tests*']),
tests_require=parse_requirements('requirements/test.txt'),
install_requires=install_requires,
dependency_links=dependency_links,
license='MIT',
test_suite='nose.collector',
classifiers=["Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Topic :: Software Development :: Testing"],
)
4 changes: 2 additions & 2 deletions tox.ini
Expand Up @@ -2,8 +2,8 @@
envlist = py26, py27, py34

[testenv]
deps = -r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
deps = -r{toxinidir}/requirements/use.txt
-r{toxinidir}/requirements/test.txt
commands = nosetests -s tests/unit

[testenv:functional]
Expand Down

0 comments on commit e7595fe

Please sign in to comment.