Skip to content

Commit 466bbbb

Browse files
committed
Merge pull request #2568 from tomchristie/requirements-refactor
Requirements refactor.
2 parents 85bf127 + 028c477 commit 466bbbb

8 files changed

+52
-28
lines changed

docs/topics/project-management.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,16 @@ When a translator has finished translating their work needs to be downloaded fro
166166

167167
---
168168

169+
## Project requirements
170+
171+
All our test requirements are pinned to exact versions, in order to ensure that our test runs are reproducible. We maintain the requirements in the `requirements` directory. The requirements files are referenced from the `tox.ini` configuration file, ensuring we have a single source of truth for package versions used in testing.
172+
173+
You can check if there are any packages available at a newer version, by using the `pip-review` tool.
174+
175+
Package upgrades should generally be treated as isolated pull requests. Also note that the `pip-dump` command does not work gracefully with our requirements layout style, so any edits should be made manually.
176+
177+
---
178+
169179
## Project ownership
170180

171181
The PyPI package is owned by `@tomchristie`. As a backup `@j4mie` also has ownership of the package.

requirements.txt

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
1-
# Minimum Django version
2-
Django>=1.4.11
3-
4-
# Test requirements
5-
pytest-django==2.8.0
6-
pytest==2.6.4
7-
pytest-cov==1.6
8-
flake8==2.2.2
9-
10-
# Optional packages
11-
markdown>=2.1.0
12-
django-guardian==1.2.4
13-
django-filter>=0.9.2
14-
15-
# wheel for PyPI installs
16-
wheel==0.24.0
17-
# twine for secured PyPI uploads
18-
twine==1.4.0
19-
20-
# MkDocs for documentation previews/deploys
21-
mkdocs==0.11.1
1+
# The base set of requirements for REST framework is actually
2+
# just Django, but for the purposes of development and testing
3+
# there are a number of packages that it is useful to install.
4+
5+
# Laying these out as seperate requirements files, allows us to
6+
# only included the relevent sets when running tox, and ensures
7+
# we are only ever declaring out dependancies in one place.
8+
9+
-r requirements/requirements-optionals.txt
10+
-r requirements/requirements-testing.txt
11+
-r requirements/requirements-documentation.txt
12+
-r requirements/requirements-codestyle.txt
13+
-r requirements/requirements-packaging.txt
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# PEP8 code linting, which we run on all commits.
2+
flake8==2.3.0
3+
pep8==1.6.2
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# MkDocs to build our documentation.
2+
mkdocs==0.11.1
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Optional packages which may be used with REST framework.
2+
markdown==2.5.2
3+
django-guardian==1.2.5
4+
django-filter==0.9.2
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Wheel for PyPI installs.
2+
wheel==0.24.0
3+
4+
# Twine for secured PyPI uploads.
5+
twine==1.4.0
6+
7+
# Transifex client for managing translation resources.
8+
transifex-client==0.10
9+
10+
# The pip-review tool for checking package upgrades.
11+
pip-tools==0.3.5

requirements/requirements-testing.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# PyTest for running the tests.
2+
pytest==2.6.4
3+
pytest-django==2.8.0

tox.ini

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,17 @@ deps =
1515
django16: Django==1.6.3 # Should track minimum supported
1616
django17: Django==1.7.2 # Should track maximum supported
1717
django18alpha: https://www.djangoproject.com/download/1.8a1/tarball/
18-
django-guardian==1.2.4
19-
pytest-django==2.8.0
20-
django-filter==0.9.2
21-
markdown>=2.1.0
18+
-rrequirements/requirements-testing.txt
19+
-rrequirements/requirements-optionals.txt
2220

2321
[testenv:py27-flake8]
2422
deps =
25-
pytest==2.6.4
26-
flake8==2.2.2
23+
-rrequirements/requirements-testing.txt
24+
-rrequirements/requirements-codestyle.txt
2725
commands = ./runtests.py --lintonly
2826

2927
[testenv:py27-docs]
3028
deps =
31-
mkdocs>=0.11.1
29+
-rrequirements/requirements-testing.txt
30+
-rrequirements/requirements-documentation.txt
3231
commands = mkdocs build

0 commit comments

Comments
 (0)