Skip to content

Commit eb2cd85

Browse files
committed
move requirements to dedicated file
1 parent 3db2ca1 commit eb2cd85

File tree

6 files changed

+63
-61
lines changed

6 files changed

+63
-61
lines changed

.travis.yml

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,30 @@ services:
1818
- PostgreSQL
1919

2020
env:
21-
- py27-d18-pg
22-
- py27-d18-sqlite
23-
- py27-d18-mysql
24-
- py27-d19-pg
25-
- py27-d19-sqlite
26-
- py27-d19-mysql
27-
- py33-d18-pg
28-
- py33-d18-sqlite
29-
- py34-d18-pg
30-
- py34-d18-sqlite
31-
- py34-d19-pg
32-
- py34-d19-sqlite
33-
- py35-d18-pg
34-
- py35-d18-sqlite
35-
- py35-d19-pg
36-
- py35-d19-sqlite
37-
- pypy-d18-pg
38-
- pypy-d18-sqlite
39-
- pypy-d19-pg
40-
- pypy-d19-sqlite
21+
- TOXENV=py27-d18-pg
22+
- TOXENV=py27-d18-sqlite
23+
- TOXENV=py27-d18-mysql
24+
- TOXENV=py27-d19-pg
25+
- TOXENV=py27-d19-sqlite
26+
- TOXENV=py27-d19-mysql
27+
28+
- TOXENV=py33-d18-pg
29+
- TOXENV=py33-d18-sqlite
30+
31+
- TOXENV=py34-d18-pg
32+
- TOXENV=py34-d18-sqlite
33+
- TOXENV=py34-d19-pg
34+
- TOXENV=py34-d19-sqlite
35+
36+
- TOXENV=py35-d18-pg
37+
- TOXENV=py35-d18-sqlite
38+
- TOXENV=py35-d19-pg
39+
- TOXENV=py35-d19-sqlite
40+
41+
- TOXENV=pypy-d18-pg
42+
- TOXENV=pypy-d18-sqlite
43+
- TOXENV=pypy-d19-pg
44+
- TOXENV=pypy-d19-sqlite
4145

4246

4347
install:

setup.py

Lines changed: 12 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,22 @@
1515

1616
reqs = 'install.py%d.pip' % sys.version_info[0]
1717

18-
# if sys.version_info[0] == 2:
19-
# reqs = 'install.py2.pip'
20-
# app = imp.load_source('concurrency', init)
21-
# elif sys.version_info[0] == 3:
22-
# reqs = 'install.py3.pip'
23-
# if sys.version_info[1] in [3,4]:
24-
# from importlib.machinery import SourceFileLoader
25-
# app = SourceFileLoader("adminactions", init).load_module()
26-
# elif sys.version_info[1] in [5]:
27-
# import importlib.util
28-
# spec = importlib.util.spec_from_file_location("concurrency", init)
29-
# app = importlib.util.module_from_spec(spec)
30-
# spec.loader.exec_module(app)
18+
rel = lambda fname: os.path.join(os.path.dirname(__file__),
19+
'src',
20+
'requirements', fname)
21+
22+
23+
def fread(fname):
24+
return open(rel(fname)).read()
25+
26+
install_requires = fread('install.pip')
27+
test_requires = fread('testing.pip')
28+
dev_requires = fread('develop.pip')
3129

3230
base_url = 'https://github.com/saxix/django-concurrency/'
3331

3432

3533
class PyTest(TestCommand):
36-
3734
def finalize_options(self):
3835
TestCommand.finalize_options(self)
3936
self.test_args = ['tests']
@@ -43,6 +40,7 @@ def run_tests(self):
4340
# import here, cause outside the eggs aren't loaded
4441
import pytest
4542
import sys
43+
4644
sys.path.insert(0, os.path.join(ROOT, 'tests', 'demoapp'))
4745
errno = pytest.main(self.test_args)
4846
sys.exit(errno)
@@ -74,27 +72,6 @@ def run(self):
7472
remove_tree(self.build_help, dry_run=self.dry_run)
7573
CleanCommand.run(self)
7674

77-
install_requires = []
78-
test_requires = ["django-webtest>=1.7.5",
79-
"mock>=1.0.1",
80-
"check-manifest==0.30",
81-
"pytest-cache>=1.0",
82-
"pytest-cov>=1.6",
83-
"pytest-django>=2.8",
84-
"pytest-echo>=1.3",
85-
"pytest-pythonpath",
86-
"pytest>=2.8",
87-
"tox>=2.3",
88-
"WebTest>=2.0.11"]
89-
90-
dev_requires = ["autopep8",
91-
"coverage",
92-
"django_extensions",
93-
"flake8",
94-
"ipython",
95-
"pdbpp",
96-
"psycopg2",
97-
"sphinx"]
9875

9976
setup(
10077
name=app.NAME,

src/requirements/develop.pip

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
autopep8
2+
coverage
3+
django_extensions
4+
flake8
5+
ipython
6+
pdbpp
7+
psycopg2
8+
sphinx

src/requirements/install.pip

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
six

src/requirements/testing.pip

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
django-webtest>=1.7.5
2+
mock>=1.0.1
3+
check-manifest==0.30
4+
pytest-cache>=1.0
5+
pytest-cov>=1.6
6+
pytest-django>=2.8
7+
pytest-echo>=1.3
8+
pytest-pythonpath
9+
pytest>=2.8
10+
tox>=2.3
11+
WebTest>=2.0.11

tox.ini

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
[tox]
2-
envlist = py{27}-d{18,19}-{pg,sqlite,mysql},
3-
py{33}-d18-{pg,sqlite},
4-
py{34,35}-d{18,19}-{pg,sqlite}
5-
pypy-d{18,19}-{pg,sqlite}
2+
envlist = py{27}-d{18}-{pg}
3+
;envlist = py{27}-d{18,19}-{pg,sqlite,mysql},
4+
; py{33}-d18-{pg,sqlite},
5+
; py{34,35}-d{18,19}-{pg,sqlite}
6+
; pypy-d{18,19}-{pg,sqlite}
67

78
[pytest]
89
python_paths=./tests/demoapp/
@@ -22,6 +23,7 @@ markers =
2223
functional: mark a test as functional
2324

2425
[testenv]
26+
install_command=pip install {opts} {packages}
2527
pip_pre = True
2628
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH PYTHONDONTWRITEBYTECODE
2729

@@ -48,13 +50,12 @@ deps=
4850

4951
d19: django>=1.9,<1.10
5052
d19: django-reversion==1.10
51-
.[test]
53+
-rsrc/requirements/testing.pip
5254

5355
commands =
5456
mysql: - mysql -u root -e 'CREATE DATABASE IF NOT EXISTS concurrency;'
5557
pg: - psql -c 'DROP DATABASE "concurrency";' -U postgres
5658
pg: - psql -c 'CREATE DATABASE "concurrency";' -U postgres
57-
; pip install -e .[test] -q --log={envlogdir}/pip-extra-install.log
5859
{posargs:py.test tests -v -rw --create-db}
5960

6061
[testenv:clean]

0 commit comments

Comments
 (0)