diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..acbd03c --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,96 @@ +version: 2.0 + +common: &common + working_directory: ~/repo + steps: + - checkout + - restore_cache: + keys: + - v2-deps-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }} + - v2-deps- + - run: + name: install dependencies + command: pip install --user tox + - run: + name: run tox + command: ~/.local/bin/tox + - run: + name: upload coverage report + command: | + if [[ "$UPLOAD_COVERAGE" != 0 ]]; then + PATH=$HOME/.local/bin:$PATH + pip install --user codecov + coverage xml + ~/.local/bin/codecov --required -X search gcov pycov -f coverage.xml --flags $CIRCLE_JOB + fi + - save_cache: + paths: + - .tox + - ~/.cache/pip + - ~/.local + - ./eggs + key: v2-deps-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }} + +jobs: + lint: + <<: *common + docker: + - image: circleci/python:3.6.1 + environment: + - TOXENV=checkqa + - UPLOAD_COVERAGE=0 + py27dj111: + <<: *common + docker: + - image: circleci/python:2.7 + environment: + TOXENV=py27-dj111 + py34dj111: + <<: *common + docker: + - image: circleci/python:3.4 + environment: + TOXENV=py34-dj111 + py34dj20: + <<: *common + docker: + - image: circleci/python:3.4 + environment: + TOXENV=py34-dj20 + py35dj111: + <<: *common + docker: + - image: circleci/python:3.5 + environment: + TOXENV=py35-dj111 + py35dj20: + <<: *common + docker: + - image: circleci/python:3.5 + environment: + TOXENV=py35-dj20 + py36dj111: + <<: *common + docker: + - image: circleci/python:3.6 + environment: + TOXENV=py36-dj111 + py36dj20: + <<: *common + docker: + - image: circleci/python:3.6 + environment: + TOXENV=py36-dj20 + +workflows: + version: 2 + test: + jobs: + - lint + - py27dj111 + - py34dj111 + - py34dj20 + - py35dj111 + - py35dj20 + - py36dj111 + - py36dj20 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 544df4f..673dbb6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,44 @@ -build -dist -.coverage -.tox MANIFEST -*.pyc -*.egg-info -*.egg +.DS_Store + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ docs/_build/ +eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg +*.eggs +.python-version + +# Pipfile +Pipfile +Pipfile.lock + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports htmlcov/ +.tox/ +.coverage +.cache +nosetests.xml +coverage.xml + +# IDEs +.idea/ \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f3a8abe..0000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -sudo: false -language: python -python: - - "2.7" - - "3.3" - - "3.4" - - "3.5" -env: - - DJANGO=1.8 - - DJANGO=1.9 - - DJANGO=1.10 - - DJANGO=master -matrix: - exclude: - - python: "3.3" - env: DJANGO=1.9 - - python: "3.3" - env: DJANGO=1.10 - - python: "3.3" - env: DJANGO=master -install: - - pip install tox coveralls -script: - - tox -e py${TRAVIS_PYTHON_VERSION//[.]/}-$DJANGO -after_success: - - coveralls diff --git a/AUTHORS b/AUTHORS index f9e3a83..d214a73 100644 --- a/AUTHORS +++ b/AUTHORS @@ -3,3 +3,5 @@ Matt George Angel Velasquez Cangiani Agustín Jeff Bowen +Katherine “Kati” Michel + diff --git a/LICENSE b/LICENSE index dd36b39..b9a09a0 100644 --- a/LICENSE +++ b/LICENSE @@ -1,19 +1,21 @@ -# Copyright (c) 2012-2015 James Tauber and contributors -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. \ No newline at end of file +The MIT License (MIT) + +Copyright (c) 2012-2019 James Tauber and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/MANIFEST.in b/MANIFEST.in index 68386b8..b44eea6 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,3 @@ include AUTHORS include LICENSE -include README.rst -recursive-include pinax/models/static * -recursive-include pinax/models/templates * +include README.md diff --git a/Makefile b/Makefile index 3dff49d..5aff318 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,10 @@ -all: init docs test +all: init test init: python setup.py develop - pip install detox coverage mkdocs + pip install detox coverage test: coverage erase detox coverage html - -docs: - mkdocs build - -.PHONY: docs diff --git a/README.md b/README.md new file mode 100644 index 0000000..ffa0160 --- /dev/null +++ b/README.md @@ -0,0 +1,174 @@ +# Pinax Models + +[![](https://img.shields.io/pypi/v/pinax-models.svg)](https://pypi.python.org/pypi/pinax-models/) + +[![CircleCi](https://img.shields.io/circleci/project/github/pinax/pinax-models.svg)](https://circleci.com/gh/pinax/pinax-models) +[![Codecov](https://img.shields.io/codecov/c/github/pinax/pinax-models.svg)](https://codecov.io/gh/pinax/pinax-models) +[![](https://img.shields.io/github/contributors/pinax/pinax-models.svg)](https://github.com/pinax/pinax-models/graphs/contributors) +[![](https://img.shields.io/github/issues-pr/pinax/pinax-models.svg)](https://github.com/pinax/pinax-models/pulls) +[![](https://img.shields.io/github/issues-pr-closed/pinax/pinax-models.svg)](https://github.com/pinax/pinax-models/pulls?q=is%3Apr+is%3Aclosed) + +[![](http://slack.pinaxproject.com/badge.svg)](http://slack.pinaxproject.com/) +[![](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT) + + +## Table of Contents + +* [About Pinax](#about-pinax) +* [Overview](#overview) + * [Supported Django and Python versions](#supported-django-and-python-versions) +* [Documentation](#documentation) + * [Installation](#installation) + * [Usage](#usage) + * [Logical Deletion](#logical-deletion) +* [Change Log](#change-log) +* [Backwards Incompatible Changes](#backwards-incompatible-changes) +* [History](#history) +* [Contribute](#contribute) +* [Code of Conduct](#code-of-conduct) +* [Connect with Pinax](#connect-with-pinax) +* [License](#license) + + +## About Pinax + +Pinax is an open-source platform built on the Django Web Framework. It is an ecosystem of reusable Django apps, themes, and starter project templates. This collection can be found at http://pinaxproject.com. + + +## pinax-models + +### Overview + +``pinax-models`` provides support for logical deletes on models and in the Django admin. + +This is a small and simple app that Patrick Altman wrote to get some reuse out +of something he did in nearly every project and every model he created. It's +too easy for good data to get deleted and it be unrecoverable. It's also too +easy to fix this by overriding the model's delete() method and just flagging +records as deleted and then leveraging Django's managers to override default +behavior so that logically deleted items are not returned in querysets. + +There are two exceptions to this rule, however, that are useful. + +* In the admin it is nice to see everything with an indicator of whether or not + it has been deleted, with the ability to filter down to just active records, + (or deleted for that matter). +* It is a valid request when an item is fetched by its primary key value, that + the object should return, even if it is marked as deleted. + +#### Supported Django and Python versions + +Django \ Python | 2.7 | 3.4 | 3.5 | 3.6 +--------------- | --- | --- | --- | --- +1.11 | * | * | * | * +2.0 | | * | * | * + + +## Documentation + +The ``pinax-models`` documentation is currently under construction. If you would like to help us write documentation, please join our Pinax Project Slack team and let us know! The Pinax documentation is available at http://pinaxproject.com/pinax/. + +### Installation + +To install pinax-models: + +```shell + $ pip install pinax-models +``` + +Add `pinax.models` to your `INSTALLED_APPS` setting: + +```python + INSTALLED_APPS = [ + # other apps + "pinax.models", + ] +``` + +### Usage + +Using the app is pretty simple: + +#. add `pinax.models` to your INSTALLED_APPS +#. Inherit from ``pinax.models.LogicalDeleteModel`` for all models that you wish + to share in this functionality. +#. Create and/or Register admins for each of these models using + ``pinax.models.LogicalDeleteModelAdmin`` + +### Logical Deletion + +`pinax.models.models.LogicalDeleteModel` aims to provide a consistent interface for +managing logical deletion of models also reducing the need to implement +functionality at the model level. + +* Logical Deletion instead of Physical Deletion +* Admin that can reveal which records are "Deleted" and allow you to reverse it. +* Provides some short cuts in the default manager + +Logical deletes are handled by date stamping a `date_removed` column. In +addition, a ``date_created`` and ``date_modified`` columns will be populated as a +convenience. + + +## Change Log + +### 4.0 + +* Add Django 2.0 compatibility testing +* Drop Django 1.8, 1.9, 1.10, and Python 3.3 support +* Move documentation into README, standardize layout +* Convert CI and coverage to CircleCi and CodeCov +* Add PyPi-compatible long description + + +## Backwards Incompatible Changes + +### 2.0 + +* Renamed to ``pinax-models`` and base model renamed to ``LogicalDeleteModel`` + +### 1.1 + +* Changed ``everything`` to ``all_with_deleted`` on LogicalDeleteManager +* LogicalDeleteManager moved from ``logicaldelete.models`` to ``logicaldelete.managers`` +* Removed ``deleted`` and ``everything`` querysets from ``logicaldelete.models.Model`` + + +## History + +On May 25, 2015, Patrick donated ``django-logicaldelete`` to Pinax and as part of +that process, ``pinax-models`` was born and the code incorporated into that +package. It remains just a Django app and can be quite independently of other +Pinax apps. + + +## Contribute + +For an overview on how contributing to Pinax works read this [blog post](http://blog.pinaxproject.com/2016/02/26/recap-february-pinax-hangout/) +and watch the included video, or read our [How to Contribute](http://pinaxproject.com/pinax/how_to_contribute/) section. +For concrete contribution ideas, please see our +[Ways to Contribute/What We Need Help With](http://pinaxproject.com/pinax/ways_to_contribute/) section. + +In case of any questions we recommend you join our [Pinax Slack team](http://slack.pinaxproject.com) +and ping us there instead of creating an issue on GitHub. Creating issues on GitHub is of course +also valid but we are usually able to help you faster if you ping us in Slack. + +We also highly recommend reading our blog post on [Open Source and Self-Care](http://blog.pinaxproject.com/2016/01/19/open-source-and-self-care/). + + +## Code of Conduct + +In order to foster a kind, inclusive, and harassment-free community, the Pinax Project +has a [code of conduct](http://pinaxproject.com/pinax/code_of_conduct/). +We ask you to treat everyone as a smart human programmer that shares an interest in Python, Django, and Pinax with you. + + +## Connect with Pinax + +For updates and news regarding the Pinax Project, please follow us on Twitter [@pinaxproject](https://twitter.com/pinaxproject) +and check out our [Pinax Project blog](http://blog.pinaxproject.com). + + +## License + +Copyright (c) 2012-2019 James Tauber and contributors under the [MIT license](https://opensource.org/licenses/MIT). \ No newline at end of file diff --git a/README.rst b/README.rst deleted file mode 100644 index a0ec79f..0000000 --- a/README.rst +++ /dev/null @@ -1,144 +0,0 @@ -Pinax Models -============ -.. image:: http://slack.pinaxproject.com/badge.svg - :target: http://slack.pinaxproject.com/ - -.. image:: https://img.shields.io/travis/pinax/pinax-models.svg - :target: https://travis-ci.org/pinax/pinax-models - -.. image:: https://img.shields.io/coveralls/pinax/pinax-models.svg - :target: https://coveralls.io/r/pinax/pinax-models - -.. image:: https://img.shields.io/pypi/dm/pinax-models.svg - :target: https://pypi.python.org/pypi/pinax-models/ - -.. image:: https://img.shields.io/pypi/v/pinax-models.svg - :target: https://pypi.python.org/pypi/pinax-models/ - -.. image:: https://img.shields.io/badge/license-MIT-blue.svg - :target: https://pypi.python.org/pypi/pinax-models/ - - -Pinax --------- - -Pinax is an open-source platform built on the Django Web Framework. It is an ecosystem of reusable Django apps, themes, and starter project templates. -This collection can be found at http://pinaxproject.com. - -This app was developed as part of the Pinax ecosystem but is just a Django app and can be used independently of other Pinax apps. - - -pinax-models -------------- - -``pinax-models`` provides support for logical deletes on models and in the Django admin. - -This is a small and simple app that Patrick Altman wrote to get some reuse out -of something he did in nearly every project and every model he created. It's -too easy for good data to get deleted and it be unrecoverable. It's also too -easy to fix this by overriding the model's delete() method and just flagging -records as deleted and then leveraging Django's managers to override default -behavior so that logically deleted items are not returned in querysets. - -There are two exceptions to this rule, however, that are useful. - -#. In the admin it is nice to see everything with an indicator of whether or not - it has been deleted, with the ability to filter down to just active records, - (or deleted for that matter). -#. It is a valid request when an item is fetched by its primary key value, that - the object should return, even if it is marked as deleted. - - -History --------- - -On May 25, 2015, Patrick donated ``django-logicaldelete`` to Pinax and as part of -that process, ``pinax-models`` was born and the code incorporated into that -package. It remains just a Django app and can be quite independently of other -Pinax apps. - - -Installation ------------------------ - -:: - - pip install pinax-models - - -Usage ------------------- - -Using the app is pretty simple: - -#. add `pinax.models` to your INSTALLED_APPS -#. Inherit from ``pinax.models.LogicalDeleteModel`` for all models that you wish - to share in this functionality. -#. Create and/or Register admins for each of these models using - ``pinax.models.LogicalDeleteModelAdmin`` - - -Additional ----------- - -Logical deletes are handled by date stamping a `date_removed` column. In -addition, a ``date_created`` and ``date_modified`` columns will be populated as a -convenience. - - -Backwards Incompatible Changes ------------------------------- - -2.0 -*** - -* Renamed to ``pinax-models`` and base model renamed to ``LogicalDeleteModel`` - - -1.1 -*** - -* Changed ``everything`` to ``all_with_deleted`` on LogicalDeleteManager -* LogicalDeleteManager moved from ``logicaldelete.models`` to ``logicaldelete.managers`` -* Removed ``deleted`` and ``everything`` querysets from ``logicaldelete.models.Model`` - - -Documentation --------------- - -The ``pinax-models`` documentation is currently under construction. If you would like to help us write documentation, please join our Pinax Project Slack team and let us know! The Pinax documentation is available at http://pinaxproject.com/pinax/. - - -Contribute ----------------- - -See this blog post http://blog.pinaxproject.com/2016/02/26/recap-february-pinax-hangout/ including a video, or our How to Contribute (http://pinaxproject.com/pinax/how_to_contribute/) section for an overview on how contributing to Pinax works. For concrete contribution ideas, please see our Ways to Contribute/What We Need Help With (http://pinaxproject.com/pinax/ways_to_contribute/) section. - -In case of any questions we recommend you join our Pinax Slack team (http://slack.pinaxproject.com) and ping us there instead of creating an issue on GitHub. Creating issues on GitHub is of course also valid but we are usually able to help you faster if you ping us in Slack. - -We also highly recommend reading our Open Source and Self-Care blog post (http://blog.pinaxproject.com/2016/01/19/open-source-and-self-care/). - - -Code of Conduct ----------------- - -In order to foster a kind, inclusive, and harassment-free community, the Pinax Project has a code of conduct, which can be found here http://pinaxproject.com/pinax/code_of_conduct/. We ask you to treat everyone as a smart human programmer that shares an interest in Python, Django, and Pinax with you. - - -Pinax Project Blog and Twitter -------------------------------- - -For updates and news regarding the Pinax Project, please follow us on Twitter at @pinaxproject and check out our blog http://blog.pinaxproject.com. - - - - - - - - - - - - - diff --git a/docs/changelog.md b/docs/changelog.md deleted file mode 100644 index bab6bf8..0000000 --- a/docs/changelog.md +++ /dev/null @@ -1,3 +0,0 @@ -# Change Log - -## 0.1 diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 index d377bff..0000000 --- a/docs/index.md +++ /dev/null @@ -1,34 +0,0 @@ -# pinax-models - - -!!! note "Pinax Ecosystem" - This app was donated to and is a part of the Pinax ecosystem but is just a - Django app and can be used independently of other Pinax apps. - - To learn more about Pinax, see - - -## Quickstart - -Install the development version: - - pip install pinax-models - -Add `pinax-models` to your `INSTALLED_APPS` setting: - - INSTALLED_APPS = ( - # ... - "pinax.models", - # ... - ) - - -## Logical Deletion - -`pinax.models.models.LogicalDeleteModel` aims to provide a consistent interface for -managing logical deletion of models also reducing the need to implement -functionality at the model level. - -* Logical Deletion instead of Physical Deletion -* Admin that can reveal which records are "Deleted" and allow you to reverse it. -* Provides some short cuts in the default manager diff --git a/mkdocs.yml b/mkdocs.yml deleted file mode 100644 index b9cff9f..0000000 --- a/mkdocs.yml +++ /dev/null @@ -1,9 +0,0 @@ -site_name: pinax-models -pages: -- [index.md, Home] -- [changelog.md, Change Log] -theme: readthedocs -repo_url: https://github.com/pinax/pinax-models -site_description: "Provide Support for Logical Deletes on Models and in the Django Admin" -site_author: "Pinax Team" -markdown_extensions: [admonition] diff --git a/pinax/models/tests/urls.py b/pinax/models/tests/urls.py deleted file mode 100644 index 65e57f3..0000000 --- a/pinax/models/tests/urls.py +++ /dev/null @@ -1,9 +0,0 @@ -try: - from django.conf.urls import patterns -except ImportError: - from django.conf.urls.defaults import patterns - - -urlpatterns = patterns( - "", -) diff --git a/pinax/models/utils.py b/pinax/models/utils.py index 539d710..16bac2f 100644 --- a/pinax/models/utils.py +++ b/pinax/models/utils.py @@ -2,9 +2,8 @@ import itertools -from django.db import DEFAULT_DB_ALIAS - from django.contrib.admin.utils import NestedObjects +from django.db import DEFAULT_DB_ALIAS def get_related_objects(obj, using=DEFAULT_DB_ALIAS): diff --git a/runtests.py b/runtests.py index d0abf38..9a86f54 100644 --- a/runtests.py +++ b/runtests.py @@ -23,7 +23,6 @@ } }, SITE_ID=1, - ROOT_URLCONF="pinax.models.tests.urls", SECRET_KEY="notasecret", ) diff --git a/setup.py b/setup.py index 88d7f24..4c31f2d 100644 --- a/setup.py +++ b/setup.py @@ -1,23 +1,61 @@ -import codecs - -from os import path from setuptools import find_packages, setup +VERSION = "4.0" +LONG_DESCRIPTION = """ +.. image:: http://pinaxproject.com/pinax-design/patches/blank.svg + :target: https://pypi.python.org/pypi/pinax-models/ + +============ +Pinax Models +============ + +.. image:: https://img.shields.io/pypi/v/pinax-models.svg + :target: https://pypi.python.org/pypi/pinax-models/ + +\ + +.. image:: https://img.shields.io/circleci/project/github/pinax/pinax-models.svg + :target: https://circleci.com/gh/pinax/pinax-models +.. image:: https://img.shields.io/codecov/c/github/pinax/pinax-models.svg + :target: https://codecov.io/gh/pinax/pinax-models +.. image:: https://img.shields.io/github/contributors/pinax/pinax-models.svg + :target: https://github.com/pinax/pinax-models/graphs/contributors +.. image:: https://img.shields.io/github/issues-pr/pinax/pinax-models.svg + :target: https://github.com/pinax/pinax-models/pulls +.. image:: https://img.shields.io/github/issues-pr-closed/pinax/pinax-models.svg + :target: https://github.com/pinax/pinax-models/pulls?q=is%3Apr+is%3Aclosed + +\ + +.. image:: http://slack.pinaxproject.com/badge.svg + :target: http://slack.pinaxproject.com/ +.. image:: https://img.shields.io/badge/license-MIT-blue.svg + :target: https://pypi.python.org/pypi/pinax-models/ + +\ -def read(*parts): - filename = path.join(path.dirname(__file__), *parts) - with codecs.open(filename, encoding="utf-8") as fp: - return fp.read() +``pinax-models`` provides support for logical deletes on models and in the Django admin. + +Supported Django and Python Versions +------------------------------------ ++-----------------+-----+-----+-----+-----+ +| Django / Python | 2.7 | 3.4 | 3.5 | 3.6 | ++=================+=====+=====+=====+=====+ +| 1.11 | * | * | * | * | ++-----------------+-----+-----+-----+-----+ +| 2.0 | | * | * | * | ++-----------------+-----+-----+-----+-----+ +""" setup( - author="Pinax Developers", - author_email="developers@pinaxproject.com", + author="Pinax Team", + author_email="team@pinaxprojects.com", description="Provide Support for Logical Deletes on Models and in the Django Admin", name="pinax-models", - long_description=read("README.rst"), - version="3.0", - url="http://pinax-models.rtfd.org/", + long_description=LONG_DESCRIPTION, + version=VERSION, + url="http://github.com/pinax/pinax-models/", license="MIT", packages=find_packages(), package_data={ @@ -27,16 +65,22 @@ def read(*parts): tests_require=[ ], classifiers=[ - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", + 'Framework :: Django :: 1.11', + 'Framework :: Django :: 2.0', "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 3", + '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 :: 3.6', "Topic :: Software Development :: Libraries :: Python Modules", ], zip_safe=False -) +) \ No newline at end of file diff --git a/tox.ini b/tox.ini index a605cd9..72293ea 100644 --- a/tox.ini +++ b/tox.ini @@ -2,28 +2,56 @@ ignore = E265,E501 max-line-length = 100 max-complexity = 10 -exclude = migrations/*,docs/* +exclude = **/*/migrations/* +inline-quotes = double + +[isort] +multi_line_output=3 +known_django=django +known_third_party=pinax +sections=FUTURE,STDLIB,DJANGO,THIRDPARTY,FIRSTPARTY,LOCALFOLDER +include_trailing_comma=True +skip_glob=**/*/migrations/* + +[coverage:run] +source = pinax +omit = **/*/conf.py,**/*/tests/*,**/*/migrations/* +branch = true +data_file = .coverage + +[coverage:report] +omit = **/*/conf.py,**/*/tests/*,**/*/migrations/* +exclude_lines = + coverage: omit +show_missing = True [tox] envlist = - py27-{1.8,1.9,1.10,master}, - py33-{1.8}, - py34-{1.8,1.9,1.10,master}, - py35-{1.8,1.9,1.10,master} + checkqa, + py27-dj{111} + py34-dj{111,20} + py35-dj{111,20} + py36-dj{111,20} [testenv] +passenv = CI CIRCLECI CIRCLE_* deps = - coverage==4.0.2 - flake8==2.5.0 - 1.8: Django>=1.8,<1.9 - 1.9: Django>=1.9,<1.10 - 1.10: Django>=1.10,<1.11 + coverage + codecov + dj111: Django>=1.11,<1.12 + dj20: Django<2.1 master: https://github.com/django/django/tarball/master + usedevelop = True -setenv = - LANG=en_US.UTF-8 - LANGUAGE=en_US:en - LC_ALL=en_US.UTF-8 commands = - flake8 pinax coverage run setup.py test + coverage report -m --skip-covered + +[testenv:checkqa] +commands = + flake8 pinax + isort --recursive --check-only --diff pinax -sp tox.ini +deps = + flake8 == 3.4.1 + flake8-quotes == 0.11.0 + isort == 4.2.15