From 1c643d483e4dbb3ce188b3e66036a43d2783dd48 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Sat, 22 Nov 2014 14:19:19 +0100 Subject: [PATCH 1/6] Basic dev/testing setup --- README.md | 9 +++++++-- setup.cfg | 5 +++++ setup.py | 28 ++++++++++++++++++++-------- 3 files changed, 32 insertions(+), 10 deletions(-) create mode 100644 setup.cfg diff --git a/README.md b/README.md index dd750d0f4..d7264d7e3 100644 --- a/README.md +++ b/README.md @@ -20,9 +20,14 @@ sudo ./venv/bin/letsencrypt Note, that letsencrypt does not yet handle Debian unstable's Apache2 conf layout. -## Developing +## Hacking -`python setup.py develop --user` +#. Bootstrap: `./venv/bin/python setup.py dev` + +#. Test code base: `./venv/bin/nosetests` + +#. Check coding style for the whole project `./venv/bin/pylint letsencrypt`, + or specific module, e.g. `./venv/bin/pylint letsencrypt.client.acme`. ## Command line usage diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 000000000..2968e59c2 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,5 @@ +[easy_install] +zip_ok = false + +[aliases] +dev = develop easy_install letsencrypt[testing] \ No newline at end of file diff --git a/setup.py b/setup.py index b39a8230d..2d5bff09c 100755 --- a/setup.py +++ b/setup.py @@ -2,6 +2,21 @@ from setuptools import setup +install_requires = [ + 'jsonschema', + 'M2Crypto', + 'pycrypto', + 'python-augeas', + 'python2-pythondialog', + 'requests', +] + +testing_extras = [ + 'coverage', + 'nose', + 'pylint', +] + setup( name="letsencrypt", version="0.1", @@ -14,18 +29,15 @@ setup( 'letsencrypt.client', 'letsencrypt.scripts', ], - install_requires=[ - 'jsonschema', - 'M2Crypto', - 'pycrypto', - 'python-augeas', - 'python2-pythondialog', - 'requests', - ], dependency_links=[ # http://augeas.net/download.html 'https://fedorahosted.org/released/python-augeas/', ], + install_requires=install_requires, + tests_require=install_requires, + extras_require={ + 'testing': testing_extras, + }, entry_points={ 'console_scripts': [ 'letsencrypt = letsencrypt.scripts.main:main', From 300a4f0b45c4fe47539770899803497790dc8017 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Sat, 22 Nov 2014 15:02:52 +0100 Subject: [PATCH 2/6] Use tox for tests --- .gitignore | 1 + README.md | 2 +- setup.py | 1 + tox.ini | 14 ++++++++++++++ 4 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore index ced995972..437c9f0bd 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ build/ dist/ venv/ +.tox/ m3 diff --git a/README.md b/README.md index d7264d7e3..87cdf3100 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ conf layout. #. Bootstrap: `./venv/bin/python setup.py dev` -#. Test code base: `./venv/bin/nosetests` +#. Test code base: `./venv/bin/tox` #. Check coding style for the whole project `./venv/bin/pylint letsencrypt`, or specific module, e.g. `./venv/bin/pylint letsencrypt.client.acme`. diff --git a/setup.py b/setup.py index 2d5bff09c..bb7a03f1b 100755 --- a/setup.py +++ b/setup.py @@ -15,6 +15,7 @@ testing_extras = [ 'coverage', 'nose', 'pylint', + 'tox>=1.6', ] setup( diff --git a/tox.ini b/tox.ini new file mode 100644 index 000000000..d4df3e8bf --- /dev/null +++ b/tox.ini @@ -0,0 +1,14 @@ +# Tox (http://tox.testrun.org/) is a tool for running tests +# in multiple virtualenvs. This configuration file will run the +# test suite on all supported python versions. To use it, "pip install tox" +# and then run "tox" from this directory. + +[tox] +envlist = py26, py27 + +[testenv] +# install_command requires tox>=1.6 +install_command = pip install --process-dependency-links {opts} {packages} +commands = nosetests +deps = + nose From 1f844153fe97209588b4161314f35cd52e38aa67 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Sat, 22 Nov 2014 15:12:33 +0100 Subject: [PATCH 3/6] Use tox for lint. --- README.md | 3 --- tox.ini | 5 ++++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 87cdf3100..07364d5f3 100644 --- a/README.md +++ b/README.md @@ -26,9 +26,6 @@ conf layout. #. Test code base: `./venv/bin/tox` -#. Check coding style for the whole project `./venv/bin/pylint letsencrypt`, - or specific module, e.g. `./venv/bin/pylint letsencrypt.client.acme`. - ## Command line usage ``` diff --git a/tox.ini b/tox.ini index d4df3e8bf..4e894d2c3 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = py26, py27 +envlist = py26, py27, lint [testenv] # install_command requires tox>=1.6 @@ -12,3 +12,6 @@ install_command = pip install --process-dependency-links {opts} {packages} commands = nosetests deps = nose + +[testenv:lint] +commands = pylint letsencrypt From 10707868db5290afff40809a0de8bc0f82e2fbe1 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Sat, 22 Nov 2014 15:14:14 +0100 Subject: [PATCH 4/6] Add missing newline at end of file --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 2968e59c2..a848a847e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,4 +2,4 @@ zip_ok = false [aliases] -dev = develop easy_install letsencrypt[testing] \ No newline at end of file +dev = develop easy_install letsencrypt[testing] From b901a84f2b54bbc9a787322fe8e51dd292060a74 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Sat, 22 Nov 2014 15:15:33 +0100 Subject: [PATCH 5/6] Fix README.md ordered list --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 07364d5f3..0ed79a307 100644 --- a/README.md +++ b/README.md @@ -22,9 +22,9 @@ conf layout. ## Hacking -#. Bootstrap: `./venv/bin/python setup.py dev` +1. Bootstrap: `./venv/bin/python setup.py dev` -#. Test code base: `./venv/bin/tox` +2. Test code base: `./venv/bin/tox` ## Command line usage From e432d00e0aaecde3915f7fad69919643279a717c Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Sat, 22 Nov 2014 20:28:11 +0100 Subject: [PATCH 6/6] pylint dep for tox --- tox.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tox.ini b/tox.ini index 4e894d2c3..88127ba9a 100644 --- a/tox.ini +++ b/tox.ini @@ -15,3 +15,5 @@ deps = [testenv:lint] commands = pylint letsencrypt +deps = + pylint \ No newline at end of file