Commit 3a290803 authored by Brian May's avatar Brian May

New upstream version 3.1.1

parent 9c39ae80
[run]
source = model_utils
omit = model_utils/tests/*
branch = 1
omit = .*
tests/*
*/_*
language: python
sudo: false
python: 2.7
env:
- TOXENV=py27-django18
- TOXENV=py27-django19
- TOXENV=py27-django110
- TOXENV=py27-django111
- TOXENV=py33-django18
- TOXENV=py34-django18
- TOXENV=py34-django19
- TOXENV=py34-django110
- TOXENV=py34-django111
- TOXENV=py35-django18
- TOXENV=py35-django19
- TOXENV=py35-django110
- TOXENV=py35-django111
- TOXENV=py35-django_trunk
- TOXENV=py36-django111
- TOXENV=py36-django_trunk
matrix:
fast_finish: true
include:
- python: 2.7
env: TOXENV=py27-django18
- python: 2.7
env: TOXENV=py27-django19
- python: 2.7
env: TOXENV=py27-django110
- python: 2.7
env: TOXENV=py27-django111
- python: 3.4
env: TOXENV=py34-django18
- python: 3.4
env: TOXENV=py34-django19
- python: 3.4
env: TOXENV=py34-django110
- python: 3.4
env: TOXENV=py34-django111
- python: 3.4
env: TOXENV=py34-django200
- python: 3.5
env: TOXENV=py35-django18
- python: 3.5
env: TOXENV=py35-django19
- python: 3.5
env: TOXENV=py35-django110
- python: 3.5
env: TOXENV=py35-django111
- python: 3.5
env: TOXENV=py35-django200
- python: 3.5
env: TOXENV=py35-djangotrunk
- python: 3.6
env: TOXENV=py36-django111
- python: 3.6
env: TOXENV=py36-django200
- python: 3.6
env: TOXENV=py36-djangotrunk
allow_failures:
- python: 3.5
env: TOXENV=py35-djangotrunk
- python: 3.6
env: TOXENV=py36-django111
- python: 3.6
env: TOXENV=py36-djangotrunk
install:
- pip install --upgrade pip setuptools tox virtualenv coveralls
- pip install --upgrade pip setuptools tox virtualenv codecov
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then export PYVER=py27; fi
- if [[ $TRAVIS_PYTHON_VERSION == '3.4' ]]; then export PYVER=py34; fi
- if [[ $TRAVIS_PYTHON_VERSION == '3.5' ]]; then export PYVER=py35; fi
- if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then export PYVER=py36; fi
script:
- tox
matrix:
allow_failures:
- env: TOXENV=py35-django_trunk
- env: TOXENV=py36-django111
- env: TOXENV=py36-django_trunk
script: tox -e$TOXENV -- --cov # positional args ({posargs}) to pass into tox.ini
after_success: coveralls
after_success: codecov
CHANGES
=======
master (unreleased)
-------------------
3.1.1 (2017.12.17)
------------------
- Update classifiers and README via GH-306, fixes GH-305
3.1.0 (2017.12.11)
------------------
- Support for Django 2.0 via GH-298, fixes GH-297
- Remove old travis script via GH-300
- Fix codecov and switch to py.test #301
3.0.0 (2017.04.13)
------------------
......
Contributing
============
.. image:: https://jazzband.co/static/img/jazzband.svg
:target: https://jazzband.co/
:alt: Jazzband
This is a `Jazzband <https://jazzband.co>`_ project. By contributing you agree
to abide by the `Contributor Code of Conduct
<https://jazzband.co/about/conduct>`_ and follow the `guidelines
<https://jazzband.co/about/guidelines>`_.
Below is a list of tips for submitting issues and pull requests.
Submitting Issues
......
......@@ -2,17 +2,19 @@
django-model-utils
==================
.. image:: https://secure.travis-ci.org/carljm/django-model-utils.png?branch=master
:target: http://travis-ci.org/carljm/django-model-utils
.. image:: https://coveralls.io/repos/carljm/django-model-utils/badge.png?branch=master
:target: https://coveralls.io/r/carljm/django-model-utils
.. image:: https://jazzband.co/static/img/badge.svg
:target: https://jazzband.co/
:alt: Jazzband
.. image:: https://travis-ci.org/jazzband/django-model-utils.svg?branch=master
:target: https://travis-ci.org/jazzband/django-model-utils
.. image:: https://codecov.io/gh/jazzband/django-model-utils/branch/master/graph/badge.svg
:target: https://codecov.io/gh/jazzband/django-model-utils
.. image:: https://img.shields.io/pypi/v/django-model-utils.svg
:target: https://crate.io/packages/django-model-utils
:target: https://pypi.python.org/pypi/django-model-utils
Django model mixins and utilities.
``django-model-utils`` supports `Django`_ 1.8 through 1.10 (latest bugfix
release in each series only) on Python 2.7, 3.3 (Django 1.8 only), 3.4 and 3.5.
``django-model-utils`` supports `Django`_ 1.8 to 2.0.
.. _Django: http://www.djangoproject.com/
......@@ -20,12 +22,11 @@ This app is available on `PyPI`_.
.. _PyPI: https://pypi.python.org/pypi/django-model-utils/
Getting Help
============
Documentation for django-model-utils is available at https://django-model-utils.readthedocs.io/
Documentation for django-model-utils is available
https://django-model-utils.readthedocs.io/
Contributing
============
......@@ -33,6 +34,6 @@ Contributing
Please file bugs and send pull requests to the `GitHub repository`_ and `issue
tracker`_. See `CONTRIBUTING.rst`_ for details.
.. _GitHub repository: https://github.com/carljm/django-model-utils/
.. _issue tracker: https://github.com/carljm/django-model-utils/issues
.. _CONTRIBUTING.rst: https://github.com/carljm/django-model-utils/blob/master/CONTRIBUTING.rst
.. _GitHub repository: https://github.com/jazzband/django-model-utils/
.. _issue tracker: https://github.com/jazzband/django-model-utils/issues
.. _CONTRIBUTING.rst: https://github.com/jazzband/django-model-utils/blob/master/CONTRIBUTING.rst
......@@ -24,8 +24,8 @@ Contributing
Please file bugs and send pull requests to the `GitHub repository`_ and `issue
tracker`_.
.. _GitHub repository: https://github.com/carljm/django-model-utils/
.. _issue tracker: https://github.com/carljm/django-model-utils/issues
.. _GitHub repository: https://github.com/jazzband/django-model-utils/
.. _issue tracker: https://github.com/jazzband/django-model-utils/issues
......
from .choices import Choices
from .tracker import FieldTracker, ModelTracker
__version__ = '3.0.0'
__version__ = '3.1.1'
......@@ -90,13 +90,25 @@ class InheritanceQuerySetMixin(object):
new_qs.subclasses = subclasses
return new_qs
def _chain(self, **kwargs):
for name in ['subclasses', '_annotated']:
if hasattr(self, name):
kwargs[name] = getattr(self, name)
return super(InheritanceQuerySetMixin, self)._chain(**kwargs)
def _clone(self, klass=None, setup=False, **kwargs):
if django.VERSION >= (2, 0):
return super(InheritanceQuerySetMixin, self)._clone()
for name in ['subclasses', '_annotated']:
if hasattr(self, name):
kwargs[name] = getattr(self, name)
if django.VERSION < (1, 9):
kwargs['klass'] = klass
kwargs['setup'] = setup
return super(InheritanceQuerySetMixin, self)._clone(**kwargs)
def annotate(self, *args, **kwargs):
......@@ -235,7 +247,6 @@ class InheritanceQuerySet(InheritanceQuerySetMixin, QuerySet):
class InheritanceManagerMixin(object):
use_for_related_fields = True
_queryset_class = InheritanceQuerySet
def get_queryset(self):
......@@ -253,7 +264,6 @@ class InheritanceManager(InheritanceManagerMixin, models.Manager):
class QueryManagerMixin(object):
use_for_related_fields = True
def __init__(self, *args, **kwargs):
if args:
......
pytest==3.3.1
pytest-django==3.1.2
#!/usr/bin/env python
import os, sys
from django.conf import settings
import django
DEFAULT_SETTINGS = dict(
INSTALLED_APPS=(
'model_utils',
'tests',
),
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3"
}
},
SILENCED_SYSTEM_CHECKS=["1_7.W001"],
)
def runtests():
if not settings.configured:
settings.configure(**DEFAULT_SETTINGS)
django.setup()
parent = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, parent)
from django.test.runner import DiscoverRunner
runner_class = DiscoverRunner
test_args = ['tests']
failures = runner_class(
verbosity=1, interactive=True, failfast=False).run_tests(test_args)
sys.exit(failures)
if __name__ == '__main__':
runtests()
......@@ -3,5 +3,9 @@ source-dir = docs/
build-dir = docs/_build
all_files = 1
[tool:pytest]
django_find_project = false
DJANGO_SETTINGS_MODULE = tests.settings
[wheel]
universal = 1
......@@ -21,6 +21,7 @@ def get_version(root_path):
if line.startswith('__version__ ='):
return line.split('=')[1].strip().strip('"\'')
setup(
name='django-model-utils',
version=get_version(HERE),
......@@ -29,7 +30,8 @@ setup(
long_description=long_description,
author='Carl Meyer',
author_email='carl@oddbird.net',
url='https://github.com/carljm/django-model-utils/',
maintainer='JazzBand',
url='https://github.com/jazzband/django-model-utils/',
packages=find_packages(exclude=['tests*']),
install_requires=['Django>=1.8'],
classifiers=[
......@@ -44,13 +46,19 @@ setup(
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Framework :: Django',
'Framework :: Django :: 1.8',
'Framework :: Django :: 1.9',
'Framework :: Django :: 1.10',
'Framework :: Django :: 1.11',
'Framework :: Django :: 2.0',
],
zip_safe=False,
tests_require=['Django>=1.8'],
package_data={
'model_utils': [
'locale/*/LC_MESSAGES/django.po','locale/*/LC_MESSAGES/django.mo'
'locale/*/LC_MESSAGES/django.po', 'locale/*/LC_MESSAGES/django.mo'
],
},
)
INSTALLED_APPS = (
'model_utils',
'tests',
)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3'
}
}
SECRET_KEY = 'dummy'
......@@ -49,7 +49,7 @@ class StatusModelPlainTupleTests(StatusModelTests):
class StatusModelDefaultManagerTests(TestCase):
def test_default_manager_is_not_status_model_generated_ones(self):
# Regression test for https://github.com/carljm/django-model-utils/issues/251
# Regression test for GH-251
# The logic behind order for managers seems to have changed in Django 1.10
# and affects default manager.
# This code was previously failing because the first custom manager (which filters
......
[tox]
envlist =
py27-django{18,19,110,111},
py33-django{18},
py34-django{18,19,110,111},
py35-django{18,19,110,111,_trunk},
py36-django{111,_trunk},
py34-django{18,19,110,111,200},
py35-django{18,19,110,111,200,trunk},
py36-django{111,200,trunk},
[testenv]
basepython =
py27: python2.7
py33: python3.3
py34: python3.4
py35: python3.5
py36: python3.6
deps =
coverage == 3.6
django18: Django>=1.8,<1.9
django19: Django>=1.9,<1.10
django110: Django>=1.10,<1.11
django111: Django>=1.11,<1.12
django_trunk: https://github.com/django/django/tarball/master
django200: Django>=2.0,<2.1
djangotrunk: https://github.com/django/django/tarball/master
freezegun == 0.3.8
-rrequirements-test.txt
pytest-cov
commands = coverage run -a runtests.py
commands =
pip install -e .
py.test {posargs}
#!/bin/sh
# Updates .travis.yml envs based on tox.ini configuration.
# Removing old environment list
cp ./.travis.yml ./.travis.yml.bak
cat ./.travis.yml.bak | grep -v "^ - TOXENV=" > ./.travis.yml
# Inserting envs based on list generated by tox
for env_name in $(tox --listenvs | sort -r); do
sed -i "/^env:$/a\
\ \ - TOXENV=${env_name}" ./.travis.yml;
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment