Merge pull request #6 from mozilla/feature/py3k
Python 3 and more django support, various cleanups along the way
This commit is contained in:
Коммит
99ff19f575
29
.travis.yml
29
.travis.yml
|
@ -1,16 +1,25 @@
|
|||
language: python
|
||||
sudo: false
|
||||
|
||||
language: python
|
||||
|
||||
python:
|
||||
- "2.7"
|
||||
install:
|
||||
- make testenv
|
||||
script:
|
||||
- make test
|
||||
- '2.7'
|
||||
- '3.4'
|
||||
- '3.5'
|
||||
- pypy
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.cache/pip
|
||||
|
||||
env:
|
||||
- DJANGO_SPEC="Django>=1.6,<1.7"
|
||||
- DJANGO_SPEC="Django>=1.7,<1.8"
|
||||
- DJANGO_SPEC="Django>=1.8,<1.9"
|
||||
- DJANGO_SPEC="Django>=1.9,<2.0"
|
||||
- DJANGO_VERSION=1.10.x
|
||||
- DJANGO_VERSION=1.9.x
|
||||
- DJANGO_VERSION=1.8.x
|
||||
|
||||
|
||||
install:
|
||||
- pip install tox
|
||||
|
||||
script:
|
||||
- tox -e "$TRAVIS_PYTHON_VERSION-$DJANGO_VERSION"
|
||||
|
|
7
Makefile
7
Makefile
|
@ -1,10 +1,7 @@
|
|||
DJANGO ?= "Django>=1.8,<1.9"
|
||||
CELERY ?= "celery>=3.0,<4.0"
|
||||
|
||||
testenv:
|
||||
pip install --upgrade pip wheel tox
|
||||
pip install -e .
|
||||
pip install --upgrade pip wheel
|
||||
pip install $(DJANGO) $(CELERY) coverage flake8 mock
|
||||
pip install -e .[tests]
|
||||
|
||||
flake8:
|
||||
flake8 post_request_task
|
||||
|
|
|
@ -61,10 +61,11 @@ Running tests
|
|||
$ make testenv
|
||||
$ make test
|
||||
|
||||
Tests are run with Django 1.8.x by default. If you want to override this, use:
|
||||
Tests are run with Django 1.8.x by default. If you want to run tests for other versions
|
||||
use tox:
|
||||
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
$ DJANGO="Django==1.9" make testenv
|
||||
$ make test
|
||||
$ make testenv
|
||||
$ tox -e 2.7-1.9.x # or any other environment defined in our tox.ini
|
||||
|
|
54
setup.py
54
setup.py
|
@ -1,22 +1,56 @@
|
|||
import codecs
|
||||
import os
|
||||
import sys
|
||||
from setuptools import setup
|
||||
|
||||
version = '0.1.0'
|
||||
|
||||
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
|
||||
README = readme.read()
|
||||
|
||||
if sys.argv[-1] == 'publish':
|
||||
os.system('python setup.py sdist upload')
|
||||
os.system('python setup.py bdist_wheel upload')
|
||||
print('You probably want to also tag the version now:')
|
||||
print(' git tag -a %s -m "version %s"' % (version, version))
|
||||
print(' git push --tags')
|
||||
sys.exit()
|
||||
|
||||
|
||||
def read(*parts):
|
||||
filename = os.path.join(os.path.dirname(__file__), *parts)
|
||||
with codecs.open(filename, encoding='utf-8') as fp:
|
||||
return fp.read()
|
||||
|
||||
|
||||
install_requires = [
|
||||
'Django>=1.6,<1.11',
|
||||
'celery>=3.0,<4.0',
|
||||
]
|
||||
|
||||
|
||||
test_requires = [
|
||||
'coverage',
|
||||
'flake8',
|
||||
'mock',
|
||||
]
|
||||
|
||||
|
||||
setup(
|
||||
name='django-post-request-task',
|
||||
version='0.0.3',
|
||||
description='A celery task class whose execution is delayed until after '
|
||||
'the request finishes',
|
||||
version=version,
|
||||
description=(
|
||||
'A celery task class whose execution is delayed until after '
|
||||
'the request finishes'
|
||||
),
|
||||
author='Mathieu Pillard',
|
||||
author_email='mpillard@mozilla.com',
|
||||
url='http://github.com/mozilla/django-post-request-task',
|
||||
license='MIT',
|
||||
long_description=README,
|
||||
long_description=read('README.rst'),
|
||||
packages=['post_request_task'],
|
||||
install_requires=install_requires,
|
||||
extras_require={
|
||||
'tests': test_requires,
|
||||
},
|
||||
include_package_data=True,
|
||||
zip_safe=False,
|
||||
classifiers=[
|
||||
|
@ -28,6 +62,14 @@ setup(
|
|||
'License :: OSI Approved :: BSD License',
|
||||
'Operating System :: OS Independent',
|
||||
'Programming Language :: Python',
|
||||
'Programming Language :: Python',
|
||||
'Programming Language :: Python :: 2',
|
||||
'Programming Language :: Python :: 2.7',
|
||||
'Programming Language :: Python :: 3',
|
||||
'Programming Language :: Python :: 3.4',
|
||||
'Programming Language :: Python :: 3.5',
|
||||
'Programming Language :: Python :: Implementation :: PyPy',
|
||||
'Programming Language :: Python :: Implementation :: CPython',
|
||||
'Topic :: Software Development :: Libraries :: Python Modules',
|
||||
]
|
||||
)
|
||||
|
|
|
@ -0,0 +1,79 @@
|
|||
[testenv]
|
||||
setenv =
|
||||
PYTHONPATH={toxinidir}
|
||||
PYTHONDONTWRITEBYTECODE=1
|
||||
whitelist_externals =
|
||||
make
|
||||
commands =
|
||||
pip install --upgrade pip setuptools wheel
|
||||
pip install --use-wheel -e .
|
||||
pip install --use-wheel -e .[tests]
|
||||
make test
|
||||
|
||||
deps18 =
|
||||
https://github.com/django/django/archive/stable/1.8.x.tar.gz#egg=django
|
||||
deps19 =
|
||||
https://github.com/django/django/archive/stable/1.9.x.tar.gz#egg=django
|
||||
deps110 =
|
||||
https://github.com/django/django/archive/stable/1.10.x.tar.gz#egg=django
|
||||
|
||||
|
||||
[testenv:2.7-1.8.x]
|
||||
basepython = python2.7
|
||||
deps =
|
||||
{[testenv]deps18}
|
||||
|
||||
[testenv:2.7-1.9.x]
|
||||
basepython = python2.7
|
||||
deps =
|
||||
{[testenv]deps19}
|
||||
|
||||
[testenv:2.7-1.10.x]
|
||||
basepython = python2.7
|
||||
deps =
|
||||
{[testenv]deps110}
|
||||
|
||||
[testenv:3.4-1.8.x]
|
||||
basepython = python3.4
|
||||
deps =
|
||||
{[testenv]deps18}
|
||||
|
||||
[testenv:3.4-1.9.x]
|
||||
basepython = python3.4
|
||||
deps =
|
||||
{[testenv]deps19}
|
||||
|
||||
[testenv:3.4-1.10.x]
|
||||
basepython = python3.4
|
||||
deps =
|
||||
{[testenv]deps110}
|
||||
|
||||
[testenv:3.5-1.8.x]
|
||||
basepython = python3.5
|
||||
deps =
|
||||
{[testenv]deps18}
|
||||
|
||||
[testenv:3.5-1.9.x]
|
||||
basepython = python3.5
|
||||
deps =
|
||||
{[testenv]deps19}
|
||||
|
||||
[testenv:3.5-1.10.x]
|
||||
basepython = python3.5
|
||||
deps =
|
||||
{[testenv]deps110}
|
||||
|
||||
[testenv:pypy-1.8.x]
|
||||
basepython = pypy
|
||||
deps =
|
||||
{[testenv]deps18}
|
||||
|
||||
[testenv:pypy-1.9.x]
|
||||
basepython = pypy
|
||||
deps =
|
||||
{[testenv]deps19}
|
||||
|
||||
[testenv:pypy-1.10.x]
|
||||
basepython = pypy
|
||||
deps =
|
||||
{[testenv]deps110}
|
Загрузка…
Ссылка в новой задаче