mirror of
https://github.com/jazzband/django-defender.git
synced 2026-03-16 22:10:32 +00:00
Add Tox config and prepare for project releases.
This commit is contained in:
parent
a1d526f318
commit
f7bda0c276
3 changed files with 43 additions and 36 deletions
21
.travis.yml
21
.travis.yml
|
|
@ -8,24 +8,9 @@ python:
|
|||
- "3.7"
|
||||
- "3.8"
|
||||
- "pypy3"
|
||||
env:
|
||||
- DJANGO=1.11
|
||||
- DJANGO=2.1
|
||||
- DJANGO=2.2
|
||||
services:
|
||||
- redis-server
|
||||
install:
|
||||
- pip install coveralls mockredispy django-redis-cache "celery<5"
|
||||
- pip install -q django~=$DJANGO
|
||||
- python setup.py develop
|
||||
script:
|
||||
- PYTHONPATH=$PYTHONPATH:$PWD coverage run --source=defender $(which django-admin.py) test defender --settings=defender.travis_settings
|
||||
- coverage report -m
|
||||
matrix:
|
||||
exclude:
|
||||
- python: "2.7"
|
||||
env: DJANGO=2.1
|
||||
- python: "2.7"
|
||||
env: DJANGO=2.2
|
||||
install: pip install tox-travis codecov
|
||||
script: tox
|
||||
after_success:
|
||||
- coveralls --verbose
|
||||
- codecov
|
||||
|
|
|
|||
20
setup.py
20
setup.py
|
|
@ -1,28 +1,12 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import os
|
||||
|
||||
try:
|
||||
from setuptools import setup
|
||||
except ImportError:
|
||||
from distutils.core import setup
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
|
||||
version = "0.6.2"
|
||||
|
||||
|
||||
def get_packages(package):
|
||||
"""
|
||||
Return root package and all sub-packages.
|
||||
"""
|
||||
return [
|
||||
dirpath
|
||||
for dirpath, dirnames, filenames in os.walk(package)
|
||||
if os.path.exists(os.path.join(dirpath, "__init__.py"))
|
||||
]
|
||||
|
||||
|
||||
def get_package_data(package):
|
||||
"""
|
||||
Return all files under the root package, that are not in a
|
||||
|
|
@ -72,7 +56,7 @@ setup(
|
|||
author_email="kencochrane@gmail.com",
|
||||
license="Apache 2",
|
||||
include_package_data=True,
|
||||
packages=get_packages("defender"),
|
||||
packages=find_packages(),
|
||||
package_data=get_package_data("defender"),
|
||||
install_requires=["Django>=1.8,<2.3", "redis>=2.10.3,<3.3"],
|
||||
tests_require=[
|
||||
|
|
|
|||
38
tox.ini
Normal file
38
tox.ini
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
[tox]
|
||||
envlist =
|
||||
# list of supported Django/Python versioons:
|
||||
# https://docs.djangoproject.com/en/2.2/faq/install/#what-python-version-can-i-use-with-django
|
||||
py{27,35,36,37,py3}-django111
|
||||
py{35,36,37,py3}-django{21,22,master}
|
||||
py38-django22
|
||||
|
||||
[travis]
|
||||
python =
|
||||
2.7: py27
|
||||
3.5: py35
|
||||
3.6: py36
|
||||
3.7: py37
|
||||
3.8: py38
|
||||
pypy3: pypy3
|
||||
|
||||
[travis:env]
|
||||
DJANGO =
|
||||
1.11: django111
|
||||
2.1: django21
|
||||
2.2: django22
|
||||
master: djangomaster
|
||||
|
||||
[testenv]
|
||||
deps =
|
||||
coveralls
|
||||
mockredispy
|
||||
django-redis-cache
|
||||
celery<5
|
||||
py27: mock
|
||||
django111: django>=1.11,<2.0
|
||||
django21: django>=2.1,<2.2
|
||||
django22: django>=2.2,<2.3
|
||||
djangomaster: https://github.com/django/django/archive/master.tar.gz
|
||||
commands =
|
||||
coverage run --source=defender {envbindir}/django-admin.py test defender --settings=defender.travis_settings
|
||||
coverage report -m
|
||||
Loading…
Reference in a new issue