Hashar has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/265735

Change subject: Introduce tox as an entry point
......................................................................

Introduce tox as an entry point

tox is a wrapper around virtualenv which ease testing. It setup the
virtualenv under /.tox and run whatever command you want under the venv.

Ignore /.tox

Add README.md to MANIFEST.in, it is read by setuptools to set the
long_description but was not included in the sdist.

Mention use of tox/flake8 in README.md

Create a very basic tox.ini file that defines a couple env:

flake8: run the pep8 and pyflakes linter.
- skip running sdist and install using --develop by setting 'usedevelop
  = True'
- just depends on flake8
- flake8 {posargs}  let you pass extra parameters when invoking tox, eg:
  tox -eflake8 -- --statistics

Change-Id: I392711db726657bb8b26278eb0309c7761758963
py27: just run the install step since no tests are around
---
M .gitignore
M MANIFEST.in
M README.md
A tox.ini
4 files changed, 18 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/crosswatch 
refs/changes/35/265735/1

diff --git a/.gitignore b/.gitignore
index a42bdcf..c56b396 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+/.tox
 .ropeproject
 .idea
 *.py[cod]
diff --git a/MANIFEST.in b/MANIFEST.in
index 1379ba9..90ae8c7 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1 +1,2 @@
+include README.md
 graft backend/server/public
diff --git a/README.md b/README.md
index ea5ad0e..bf68f55 100644
--- a/README.md
+++ b/README.md
@@ -47,5 +47,9 @@
 directory. Change the name of the tool in `frontend/gulpfile.js` and
 `backend/config.py` and the `scripts` files.
 
+# Testing
+
+Invoke `tox`. We rely on flake8 to enforce python style.
+
 #License
 Licensed under 
[ISC](https://en.wikipedia.org/w/index.php?title=ISC_license&oldid=653545972)
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..b134b7f
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,12 @@
+[tox]
+envlist = flake8,py27
+
+[testenv]
+commands = python setup.py install
+
+[testenv:flake8]
+# skip sdist, use --develop
+usedevelop = True
+
+deps = flake8
+commands = flake8 {posargs}

-- 
To view, visit https://gerrit.wikimedia.org/r/265735
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I392711db726657bb8b26278eb0309c7761758963
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/crosswatch
Gerrit-Branch: master
Gerrit-Owner: Hashar <has...@free.fr>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to