Skip to content

Commit

Permalink
Merge pull request #562 from felixxm/django-31
Browse files Browse the repository at this point in the history
Added testing for Django 3.1 and updated Travis CI configuration.
  • Loading branch information
benjaoming committed Oct 27, 2020
2 parents 860cd7f + 8d6d842 commit d6d75cf
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 20 deletions.
15 changes: 7 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
os: linux
dist: xenial
language: python
python:
- 3.6
cache: pip
install: travis_retry pip install tox\>=3.1.2 codecov
script: tox -e $TOX_ENV
matrix:
jobs:
fast_finish: true
include:
- python: 3.6
Expand All @@ -14,25 +16,22 @@ matrix:
- python: 3.6
env: TOX_ENV=no_rest_framework
- python: 3.7
dist: xenial
env: TOX_ENV=django_master-py37
- python: 3.6
dist: xenial
env: TOX_ENV=django_master-py36
- python: 3.7
dist: xenial
env: TOX_ENV=django31-py37
- python: 3.6
env: TOX_ENV=django31-py36
- python: 3.7
env: TOX_ENV=django30-py37
- python: 3.6
dist: xenial
env: TOX_ENV=django30-py36
- python: 3.7
dist: xenial
env: TOX_ENV=django22-py37
- python: 3.6
dist: xenial
env: TOX_ENV=django22-py36
- python: 3.7
dist: xenial
env: TOX_ENV=django21-py37
- python: 3.6
env: TOX_ENV=django21-py36
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ django-money
A little Django app that uses ``py-moneyed`` to add support for Money
fields in your models and forms.

* Django versions supported: 1.11, 2.1, 2.2, 3.0
* Django versions supported: 1.11, 2.1, 2.2, 3.0, 3.1
* Python versions supported: 3.5, 3.6, 3.7
* PyPy versions supported: PyPy3

Expand Down
4 changes: 4 additions & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ Fixed

- Resulting Money object from arithmetics (add / sub / ...) inherits maximum decimal_places from arguments `#522`_ (`wearebasti`_)

Added
~~~~~

- Django 3.1 support

`1.1`_ - 2020-04-06
-------------------
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ known_first_party = tests, djmoney, moneyed
known_third_party = pytest, rest_framework, certifi
sections=FUTURE,STDLIB,DJANGO,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
include_trailing_comma = true
not_skip = __init__.py
multi_line_output = 3
lines_after_imports = 2

Expand Down
6 changes: 6 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ def run_tests(self):
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Framework :: Django',
'Framework :: Django :: 1.11',
'Framework :: Django :: 2.1',
'Framework :: Django :: 2.2',
'Framework :: Django :: 3.0',
'Framework :: Django :: 3.1',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
Expand Down
4 changes: 2 additions & 2 deletions tests/test_reversion.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import pytest

from djmoney.money import Money
from reversion.models import Version
from reversion.revisions import create_revision

from djmoney.money import Money

from .testapp.models import RevisionedModel


Expand Down
3 changes: 2 additions & 1 deletion tests/testapp/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
from django.core.validators import MinValueValidator
from django.db import models

from reversion.revisions import register

from djmoney.models.fields import MoneyField
from djmoney.models.managers import money_manager, understands_money
from djmoney.models.validators import MaxMoneyValidator, MinMoneyValidator
from djmoney.money import Money
from moneyed import Money as OldMoney
from reversion.revisions import register


class ModelWithVanillaMoneyField(models.Model):
Expand Down
20 changes: 13 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[tox]
envlist =
django_master-py{37,36}
django31-py{37,36}
django30-py{37,36}
django22-py{37,36}
django21-py{37,36,35,py3}
Expand All @@ -20,6 +21,7 @@ deps =
django21: {[django]2.1.x}
django22: {[django]2.2.x}
django30: {[django]3.0.x}
django31: {[django]3.1.x}
django_master: {[django]master}
commands = py.test --ds=tests.settings --cov=./djmoney {posargs}
usedevelop = false
Expand All @@ -31,13 +33,13 @@ deps =
black
commands =
flake8 {toxinidir}/djmoney {toxinidir}/tests
isort -rc -c {toxinidir}/djmoney {toxinidir}/tests
isort -c {toxinidir}/djmoney {toxinidir}/tests
black -l 120 --check --diff {toxinidir}/djmoney {toxinidir}/tests

[django]
1.11.x =
Django>=1.11.0,<2.0.0
django-reversion>=2.0.8
django-reversion>=2.0.8,<3.0.8
djangorestframework>=3.6.2
2.1.x =
Django>=2.1,<2.2
Expand All @@ -48,19 +50,23 @@ commands =
django-reversion>=2.0.8
djangorestframework>=3.7.3
3.0.x =
Django>=3.0a1,<3.1
Django>=3.0,<3.1
django-reversion>=2.0.8
djangorestframework>=3.7.3
3.1.x =
Django>=3.1,<3.2
django-reversion>=3.0.8
djangorestframework>=3.12.0
master =
https://github.com/django/django/tarball/master
django-reversion>=2.0.8
djangorestframework>=3.6.2
django-reversion>=3.0.8
djangorestframework>=3.12.0

[testenv:no_rest_framework]
deps =
.[test,exchange]
Django>=1.11.0,<2.0.0
django-reversion>=2.0.8
Django>=2.2,<3.2
django-reversion>=3.0.8

[testenv:docs]
basepython = python3.6
Expand Down

0 comments on commit d6d75cf

Please sign in to comment.