Hashar has uploaded a new change for review.
https://gerrit.wikimedia.org/r/110596
Change subject: basic tox environnement
......................................................................
basic tox environnement
tox let you define virtual env and run whatever command you want
isolated. This change propose two environnement: py27 and flake8 (a
python linter). You can invoke them with:
tox -eflake8
tox -epy27
Or simply by running `tox`.
Moved test dependencies to test-requirements.txt which is becoming a
standard.
Change-Id: Id24f873c172d47cf31bfb66876c8b887322ecf45
---
M .gitignore
M requirements.txt
A test-requirements.txt
A tox.ini
4 files changed, 29 insertions(+), 3 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/analytics/wikimetrics
refs/changes/96/110596/1
diff --git a/.gitignore b/.gitignore
index 00c7c63..1c964c2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,5 +12,7 @@
.coverage
.idea
+/.tox
+
# never commit this as it holds any server-specific settings like secret keys
and passwords, etc.
config_secret.py
diff --git a/requirements.txt b/requirements.txt
index a0a83b6..01843f5 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -6,9 +6,6 @@
flask-login==0.2.4
flask-oauth==0.12
wtforms==1.0.4
-# needed to run tests but bad in prod environment
-# because tests are currently distructive nose ===1.3.0
-coverage==3.6
celery>=3.0
celery-with-redis>=3.0
PyYAML==3.10
diff --git a/test-requirements.txt b/test-requirements.txt
new file mode 100644
index 0000000..0d03fdb
--- /dev/null
+++ b/test-requirements.txt
@@ -0,0 +1,5 @@
+flake8
+nose
+# needed to run tests but bad in prod environment
+# because tests are currently distructive nose ===1.3.0
+coverage==3.6
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..cef351f
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,22 @@
+[tox]
+minversion = 1.6
+skipsdist = True
+envlist = flake8, py27
+
+[testenv]
+setenv = VIRTUAL_ENV={envdir}
+usedevelop = True
+install_command = pip install {opts} {packages}
+deps = -r{toxinidir}/requirements.txt
+ -r{toxinidir}/test-requirements.txt
+commands =
+ nosetests
+
+[testenv:flake8]
+commands = flake8
+
+[testenv:venv]
+commands = {posargs}
+
+[flake8]
+exclude = .venv,.tox,dist,doc,build,*.egg
--
To view, visit https://gerrit.wikimedia.org/r/110596
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id24f873c172d47cf31bfb66876c8b887322ecf45
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikimetrics
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits