Install:
tox
, for running the test suite parameterized by multiple versions.future
, for doing some of the auto-conversion.
pip install tox future
Now in the project directory, add a tox.ini
file:
[tox]
envlist = py27,py35
[testenv]
usedevelop = True
commands =
COMMAND TO RUN TESTS GOES HERE
deps =
-r requirements.txt
OTHER TEST DEPENDENCIES (nose, pytest, etc)
The tests can now be run across python versions by typing tox
or tox -e py35
for a particular environment.
git ls-files | grep '[.]py$' | xargs futurize --stage1 -w
Examine the diff and fix any obvious issues.
Commit those changes, and run the build to see what fails (if anything). Fix test failures.
If there are a lot of test failures, look into using six or futurize's more advanced capabilities,
but for simple projects, a few try: ... except ImportError: ...
cases fix the test failures.
setup( ...
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries',
'Topic :: System :: Filesystems',
'Topic :: Utilities',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
],
)