Browse files

Added setup.py and a tox manifest

  • Loading branch information...
1 parent df9d087 commit 03856fcaacebb23d59f7a6a630fcb3702b525ead @teozkr committed Nov 4, 2012
Showing with 50 additions and 0 deletions.
  1. +6 −0 .gitignore
  2. +8 −0 README.rst
  3. +24 −0 setup.py
  4. +12 −0 tox.ini
View
6 .gitignore
@@ -1,2 +1,8 @@
__pycache__
*.pyc
+*.egg
+htmlcov
+*.egg-info
+rotx-env
+.coverage
+.tox
View
8 README.rst
@@ -9,4 +9,12 @@ rotx.py contains a single function, ``rot``. The signature for this function is
To decrypt, invert ``n``. ``alphabetical_only`` decides whether to only encrypt the ASCII letters (like a true caesar cipher, leaving the other characters intact, including numbers) or to use the full spectrum of the encoding in use (all 8 bits if a bytestring, up to 0xFFFF or 0x10FFFF for unicode depending on whether your Python installation was compiled with UCS-2/UTF-16 or UCS-4/UTF-32).
+Testing
+=======
+Testing is done using tox and Pythonbrew, run the following assuming both of these have been installed to run the tests::
+
+ $ pythonbrew install 2.7.3
+ $ pythonbrew install 2.6.6
+ $ tox
+
.. [#insecure] Disclaimer: The rotX algorithms are neither actually secure nor useful.
View
24 setup.py
@@ -0,0 +1,24 @@
+from setuptools import setup
+from setuptools.command.test import test as TestCommand
+
+
+class PyTest(TestCommand):
+ def finalize_options(self):
+ TestCommand.finalize_options(self)
+ self.test_args = ['test_rotx.py']
+ self.test_suite = True
+
+ def run_tests(self):
+ #import here, cause outside the eggs aren't loaded
+ import pytest
+ raise SystemExit(pytest.main(self.test_args))
+
+
+setup(
+ name='rotx',
+ license='MIT',
+ tests_require=[
+ 'pytest>=2.3.2',
+ ],
+ cmdclass={'test': PyTest},
+)
View
12 tox.ini
@@ -0,0 +1,12 @@
+[tox]
+minversion=1.4.2
+envlist=py26,py27
+
+[testenv]
+commands=python setup.py test
+
+[testenv:py27]
+basepython={homedir}/.pythonbrew/pythons/Python-2.7.3/bin/python
+
+[testenv:py26]
+basepython={homedir}/.pythonbrew/pythons/Python-2.6.6/bin/python

0 comments on commit 03856fc

Please sign in to comment.