[Python-modules-commits] [python-django-celery-results] 01/02: importing python-django-celery-results_1.0.1.orig.tar.gz
Michael Fladischer
fladi at moszumanska.debian.org
Thu Aug 10 09:35:48 UTC 2017
This is an automated email from the git hooks/post-receive script.
fladi pushed a commit to branch debian/master
in repository python-django-celery-results.
commit 8d29fef48520512e86e33e2398f9143ba136e170
Author: Michael Fladischer <FladischerMichael at fladi.at>
Date: Wed Aug 9 07:37:30 2017 +0200
importing python-django-celery-results_1.0.1.orig.tar.gz
---
.bumpversion.cfg | 15 ++
.cookiecutterrc | 26 ++
.coveragerc | 11 +
.editorconfig | 14 ++
.gitignore | 31 +++
.travis.yml | 33 +++
AUTHORS | 92 +++++++
Changelog | 29 +++
LICENSE | 54 ++++
MANIFEST.in | 17 ++
Makefile | 151 ++++++++++++
README.rst | 99 ++++++++
appveyor.yml | 53 ++++
django_celery_results/__init__.py | 34 +++
django_celery_results/admin.py | 37 +++
django_celery_results/apps.py | 15 ++
django_celery_results/backends/__init__.py | 6 +
django_celery_results/backends/cache.py | 36 +++
django_celery_results/backends/database.py | 62 +++++
django_celery_results/managers.py | 159 ++++++++++++
django_celery_results/migrations/0001_initial.py | 55 +++++
django_celery_results/migrations/__init__.py | 0
django_celery_results/models.py | 60 +++++
django_celery_results/utils.py | 18 ++
docs/Makefile | 238 ++++++++++++++++++
docs/_static/.keep | 0
docs/_templates/.keep | 0
docs/changelog.rst | 1 +
docs/conf.py | 30 +++
docs/copyright.rst | 28 +++
docs/glossary.rst | 10 +
docs/images/favicon.ico | Bin 0 -> 3364 bytes
docs/images/logo.png | Bin 0 -> 26250 bytes
docs/includes/installation.txt | 42 ++++
docs/includes/introduction.txt | 26 ++
docs/index.rst | 32 +++
docs/make.bat | 272 +++++++++++++++++++++
.../django_celery_results.backends.cache.rst | 11 +
.../django_celery_results.backends.database.rst | 11 +
docs/reference/django_celery_results.backends.rst | 11 +
docs/reference/django_celery_results.managers.rst | 11 +
docs/reference/django_celery_results.models.rst | 11 +
docs/reference/django_celery_results.utils.rst | 11 +
docs/reference/index.rst | 18 ++
docs/templates/readme.txt | 32 +++
extra/appveyor/install.ps1 | 85 +++++++
extra/appveyor/run_with_compiler.cmd | 47 ++++
manage.py | 11 +
requirements/default.txt | 1 +
requirements/docs.txt | 2 +
requirements/pkgutils.txt | 8 +
requirements/test-ci.txt | 2 +
requirements/test-django.txt | 1 +
requirements/test-django110.txt | 1 +
requirements/test-django18.txt | 1 +
requirements/test-django19.txt | 1 +
requirements/test.txt | 4 +
setup.cfg | 16 ++
setup.py | 157 ++++++++++++
t/__init__.py | 0
t/proj/__init__.py | 1 +
t/proj/celery.py | 15 ++
t/proj/settings.py | 117 +++++++++
t/proj/urls.py | 8 +
t/proj/wsgi.py | 17 ++
t/unit/__init__.py | 0
t/unit/backends/__init__.py | 0
t/unit/backends/test_cache.py | 96 ++++++++
t/unit/backends/test_database.py | 79 ++++++
t/unit/conftest.py | 36 +++
t/unit/test_models.py | 62 +++++
tox.ini | 74 ++++++
72 files changed, 2744 insertions(+)
diff --git a/.bumpversion.cfg b/.bumpversion.cfg
new file mode 100644
index 0000000..169ab09
--- /dev/null
+++ b/.bumpversion.cfg
@@ -0,0 +1,15 @@
+[bumpversion]
+current_version = 1.0.1
+commit = True
+tag = True
+parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(?P<releaselevel>[a-z]+)?
+serialize =
+ {major}.{minor}.{patch}{releaselevel}
+ {major}.{minor}.{patch}
+
+[bumpversion:file:django_celery_results/__init__.py]
+
+[bumpversion:file:docs/includes/introduction.txt]
+
+[bumpversion:file:README.rst]
+
diff --git a/.cookiecutterrc b/.cookiecutterrc
new file mode 100644
index 0000000..bec8fca
--- /dev/null
+++ b/.cookiecutterrc
@@ -0,0 +1,26 @@
+# This file exists so you can easily regenerate your project.
+#
+# `cookiepatcher` is a convenient shim around `cookiecutter`
+# for regenerating projects (it will generate a .cookiecutterrc
+# automatically for any template). To use it:
+#
+# pip install cookiepatcher
+# cookiepatcher gh:ionelmc/cookiecutter-pylibrary project-path
+#
+# See:
+# https://pypi.python.org/pypi/cookiecutter
+#
+# Alternatively, you can run:
+#
+# cookiecutter --overwrite-if-exists --config-file=project-path/.cookiecutterrc gh:ionelmc/cookiecutter-pylibrary
+
+default_context:
+
+ email: 'ask at celeryproject.org'
+ full_name: 'Ask Solem'
+ github_username: 'celery'
+ project_name: 'django-celery-results'
+ project_short_description: 'Celery result backends using Django'
+ project_slug: 'django-celery-results'
+ version: '1.0.0'
+ year: '2016'
diff --git a/.coveragerc b/.coveragerc
new file mode 100644
index 0000000..3586787
--- /dev/null
+++ b/.coveragerc
@@ -0,0 +1,11 @@
+[run]
+branch = 1
+cover_pylib = 0
+include = *django_celery_results/*
+omit = t/*
+
+[report]
+omit =
+ */python?.?/*
+ */site-packages/*
+ */pypy/*
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..22fb1f9
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,14 @@
+# http://editorconfig.org
+
+root = true
+
+[*]
+indent_style = space
+indent_size = 4
+trim_trailing_whitespace = true
+insert_final_newline = true
+charset = utf-8
+end_of_line = lf
+
+[Makefile]
+indent_style = tab
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..42bed40
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,31 @@
+.DS_Store
+*.pyc
+*$py.class
+*~
+.*.sw[pon]
+dist/
+*.egg-info
+*.egg
+*.egg/
+build/
+.build/
+_build/
+pip-log.txt
+.directory
+erl_crash.dump
+*.db
+Documentation/
+.tox/
+.ropeproject/
+.project
+.pydevproject
+.idea/
+.coverage
+celery/tests/cover/
+.ve*
+cover/
+.vagrant/
+*.sqlite3
+.cache/
+htmlcov/
+coverage.xml
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..7128256
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,33 @@
+language: python
+sudo: false
+cache: false
+python:
+ - '3.5'
+os:
+ - linux
+env:
+ global:
+ PYTHONUNBUFFERED=yes
+ matrix:
+ - TOXENV=2.7-django1.10
+ - TOXENV=2.7-django1.9
+ - TOXENV=2.7-django1.8
+ - TOXENV=pypy-django1.10
+ - TOXENV=pypy-django1.9
+ - TOXENV=pypy-django1.8
+ - TOXENV=3.4-django1.10
+ - TOXENV=3.4-django1.9
+ - TOXENV=3.4-django1.8
+ - TOXENV=3.5-django1.10
+ - TOXENV=3.5-django1.9
+ - TOXENV=3.5-django1.8
+ - TOXENV=flake8
+ - TOXENV=flakeplus
+ - TOXENV=apicheck
+ - TOXENV=pydocstyle
+ - TOXENV=cov
+install: travis_retry pip install -U tox
+script: tox -v -- -v
+after_success:
+ - .tox/$TRAVIS_PYTHON_VERSION/bin/coverage xml
+ - .tox/$TRAVIS_PYTHON_VERSION/bin/codecov -e TOXENV
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..d5be671
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,92 @@
+=========
+ AUTHORS
+=========
+:order: sorted
+
+Aaron Ross <aaron at wawd.com>
+Adam Endicott
+Alex Stapleton <alex.stapleton at artfinder.com>
+Alvaro Vega <avega at tid.es>
+Andrew Frankel
+Andrew Watts <andrewwatts at gmail.com>
+Andrii Kostenko <andrey at kostenko.name>
+Anton Novosyolov <anton.novosyolov at gmail.com>
+Ask Solem <ask at celeryproject.org>
+Augusto Becciu <augusto at becciu.org>
+Ben Firshman <ben at firshman.co.uk>
+Brad Jasper <bjasper at gmail.com>
+Brett Gibson <brett at swiftserve.com>
+Brian Rosner <brosner at gmail.com>
+Charlie DeTar <cfd at media.mit.edu>
+Christopher Grebs <cg at webshox.org>
+Dan LaMotte <lamotte85 at gmail.com>
+Darjus Loktevic <darjus at amazon.com>
+David Fischer <david.fischer.ch at gmail.com>
+David Ziegler <david.ziegler at gmail.com>
+Diego Andres Sanabria Martin <diegueus9 at gmail.com>
+Dmitriy Krasilnikov <krasilnikov.d.o at gmail.com>
+Donald Stufft <donald.stufft at gmail.com>
+Eldon Stegall
+Eugene Nagornyi <ideviantik at gmail.com>
+Felix Berger <bflat1 at gmx.net
+Gabe Jackson <gabejackson at cxg.ch>
+Glenn Washburn <M8R-hkaf6e at mailinator.com>
+Gnrhxni <gnrhxni at outlook.com>
+Greg Taylor <gtaylor at duointeractive.com>
+Grégoire Cachet <gregoire at audacy.fr>
+Hari <haridara at gmail.com>
+Idan Zalzberg <idanzalz at gmail.com>
+Ionel Maries Cristian <ionel.mc at gmail.com>
+Jannis Leidel <jannis at leidel.info>
+Jason Baker <amnorvend at gmail.com>
+Jay States <jstates at based.ca>
+Jeff Balogh <me at jeffbalogh.org>
+Jeff Fischer <jeffrey.fischer at gmail.com>
+Jeffrey Hu <zhiwehu at gmail.com>
+Jens Alm <jens.alm at mac.com>
+Jerzy Kozera <jerzy.kozera at gmail.com>
+Jesper Noehr <jesper at noehr.org>
+John Andrews <johna at stjit011.(none)>
+John Watson <johnw at mahalo.com>
+Jonas Haag <jonas at lophus.org>
+Jonatan Heyman <jonatan at heyman.info>
+Josh Drake <m0nikr at is-0338.(none)>
+José Moreira <zemanel at zemanel.eu>
+Jude Nagurney <jude at pwan.org>
+Justin Quick <justquick at gmail.com>
+Keith Perkins <keith at tasteoftheworld.us>
+Kirill Panshin <kipanshi at gmail.com>
+Mark Hellewell <mark.hellewell at gmail.com>
+Mark Lavin <markdlavin at gmail.com>
+Mark Stover <stovenator at gmail.com>
+Maxim Bodyansky <bodyansky at gmail.com>
+Michael Elsdoerfer <michael at elsdoerfer.com>
+Michael van Tellingen <m.vantellingen at lukkien.com>
+Mikhail Korobov <kmike84 at gmail.com>
+Olivier Tabone <olivier.tabone at gmail.com>
+Patrick Altman <paltman at gmail.com>
+Piotr Bulinski <piotr at bulinski.pl>
+Piotr Sikora <piotr.sikora at frickle.com>
+Reza Lotun <rlotun at gmail.com>
+Rockallite Wulf <rockallite.wulf at gmail.com>
+Roger Barnes <roger at mindsocket.com.au>
+Roman Imankulov <roman at netangels.ru>
+Rune Halvorsen <runefh at gmail.com>
+Sam Cooke <sam at mixcloud.com>
+Scott Rubin <srubin at broadway.com>
+Sean Creeley <sean.creeley at gmail.com>
+Serj Zavadsky <fevral13 at gmail.com>
+Simon Charette <charette.s at gmail.com>
+Spencer Ellinor <spencer.ellinor at gmail.com>
+Theo Spears <github at theos.me.uk>
+Timo Sugliani
+Vincent Driessen <vincent at datafox.nl>
+Vitaly Babiy <vbabiy86 at gmail.com>
+Vladislav Poluhin <nuklea at gmail.com>
+Weipin Xia <weipin at me.com>
+Wes Turner <wes.turner at gmail.com>
+Wes Winham <winhamwr at gmail.com>
+Williams Mendez <wmendez27 at gmail.com>
+WoLpH <Rick at Fawo.nl>
+dongweiming <ciici123 at hotmail.com>
+zeez <zeezdev at gmail.com>
diff --git a/Changelog b/Changelog
new file mode 100644
index 0000000..c21efb3
--- /dev/null
+++ b/Changelog
@@ -0,0 +1,29 @@
+.. _changelog:
+
+================
+ Change history
+================
+
+.. _version-1.0.1:
+
+1.0.1
+=====
+:release-date: 2016-11-07 02:00 p.m. PST
+:release-by: Ask Solem
+
+- Migrations were not being installed as part of the distribution (Issue #4).
+
+- Now includes simple task result admin interface.
+
+ Contributed by :github_user:`zeezdev`.
+
+- Now depends on Celery 4.0.0.
+
+.. _version-1.0.0:
+
+1.0.0
+=====
+:release-date: 2016-09-08 03:19 p.m. PDT
+:release-by: Ask Solem
+
+- Initial release
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..44d17ed
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,54 @@
+Copyright (c) 2015-2016 Ask Solem. All Rights Reserved.
+Copyright (c) 2012-2014 GoPivotal, Inc. All Rights Reserved.
+Copyright (c) 2009-2012 Ask Solem. All Rights Reserved.
+
+django-celery-results is licensed under The BSD License (3 Clause, also known as
+the new BSD license). The license is an OSI approved Open Source
+license and is GPL-compatible(1).
+
+The license text can also be found here:
+http://www.opensource.org/licenses/BSD-3-Clause
+
+License
+=======
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of Ask Solem nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Ask Solem OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+Documentation License
+=====================
+
+The documentation portion of django-celery-results (the rendered contents of the
+"docs" directory of a software distribution or checkout) is supplied
+under the "Creative Commons Attribution-ShareAlike 4.0
+International" (CC BY-SA 4.0) License as described by
+http://creativecommons.org/licenses/by-sa/4.0/
+
+Footnotes
+=========
+(1) A GPL-compatible license makes it possible to
+ combine django-celery-results with other software that is released
+ under the GPL, it does not mean that we're distributing
+ django-celery-results under the GPL license. The BSD license, unlike the GPL,
+ let you distribute a modified version without making your
+ changes open source.
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..76c8fea
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,17 @@
+include Changelog
+include LICENSE
+include README.rst
+include MANIFEST.in
+include setup.cfg
+include setup.py
+include manage.py
+recursive-include docs *
+recursive-include extra/*
+recursive-include examples *
+recursive-include requirements *.txt *.rst
+recursive-include t *.py
+recursive-include django_celery_results *.py
+
+recursive-exclude * __pycache__
+recursive-exclude * *.py[co]
+recursive-exclude * .*.sw*
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..92b747b
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,151 @@
+PROJ=django_celery_results
+PGPIDENT="Celery Security Team"
+PYTHON=python
+PYTEST=py.test
+GIT=git
+TOX=tox
+ICONV=iconv
+FLAKE8=flake8
+FLAKEPLUS=flakeplus
+PYDOCSTYLE=pydocstyle
+SPHINX2RST=sphinx2rst
+
+TESTDIR=t
+SPHINX_DIR=docs/
+SPHINX_BUILDDIR="${SPHINX_DIR}/_build"
+README=README.rst
+README_SRC="docs/templates/readme.txt"
+CONTRIBUTING=CONTRIBUTING.rst
+CONTRIBUTING_SRC="docs/contributing.rst"
+SPHINX_HTMLDIR="${SPHINX_BUILDDIR}/html"
+DOCUMENTATION=Documentation
+FLAKEPLUSTARGET=2.7
+
+all: help
+
+help:
+ @echo "docs - Build documentation."
+ @echo "test-all - Run tests for all supported python versions."
+ @echo "distcheck ---------- - Check distribution for problems."
+ @echo " test - Run unittests using current python."
+ @echo " lint ------------ - Check codebase for problems."
+ @echo " apicheck - Check API reference coverage."
+ @echo " configcheck - Check configuration reference coverage."
+ @echo " readmecheck - Check README.rst encoding."
+ @echo " contribcheck - Check CONTRIBUTING.rst encoding"
+ @echo " flakes -------- - Check code for syntax and style errors."
+ @echo " flakecheck - Run flake8 on the source code."
+ @echo " flakepluscheck - Run flakeplus on the source code."
+ @echo " pep257check - Run pydocstyle on the source code."
+ @echo "readme - Regenerate README.rst file."
+ @echo "contrib - Regenerate CONTRIBUTING.rst file"
+ @echo "clean-dist --------- - Clean all distribution build artifacts."
+ @echo " clean-git-force - Remove all uncomitted files."
+ @echo " clean ------------ - Non-destructive clean"
+ @echo " clean-pyc - Remove .pyc/__pycache__ files"
+ @echo " clean-docs - Remove documentation build artifacts."
+ @echo " clean-build - Remove setup artifacts."
+ @echo "bump - Bump patch version number."
+ @echo "bump-minor - Bump minor version number."
+ @echo "bump-major - Bump major version number."
+ @echo "release - Make PyPI release."
+
+clean: clean-docs clean-pyc clean-build
+
+clean-dist: clean clean-git-force
+
+bump:
+ bumpversion patch
+
+bump-minor:
+ bumpversion minor
+
+bump-major:
+ bumpversion major
+
+release:
+ python setup.py register sdist bdist_wheel upload --sign --identity="$(PGPIDENT)"
+
+Documentation:
+ (cd "$(SPHINX_DIR)"; $(MAKE) html)
+ mv "$(SPHINX_HTMLDIR)" $(DOCUMENTATION)
+
+docs: Documentation
+
+clean-docs:
+ -rm -rf "$(SPHINX_BUILDDIR)"
+
+lint: flakecheck apicheck configcheck readmecheck
+
+apicheck:
+ (cd "$(SPHINX_DIR)"; $(MAKE) apicheck)
+
+configcheck:
+ true
+
+flakecheck:
+ $(FLAKE8) "$(PROJ)" "$(TESTDIR)"
+
+flakediag:
+ -$(MAKE) flakecheck
+
+pep257check:
+ $(PYDOCSTYLE) "$(PROJ)"
+
+flakepluscheck:
+ $(FLAKEPLUS) --$(FLAKEPLUSTARGET) "$(PROJ)" "$(TESTDIR)"
+
+flakeplusdiag:
+ -$(MAKE) flakepluscheck
+
+flakes: flakediag flakeplusdiag pep257check
+
+clean-readme:
+ -rm -f $(README)
+
+readmecheck:
+ $(ICONV) -f ascii -t ascii $(README) >/dev/null
+
+$(README):
+ $(SPHINX2RST) "$(README_SRC)" --ascii > $@
+
+readme: clean-readme $(README) readmecheck
+
+clean-contrib:
+ -rm -f "$(CONTRIBUTING)"
+
+$(CONTRIBUTING):
+ $(SPHINX2RST) "$(CONTRIBUTING_SRC)" > $@
+
+contrib: clean-contrib $(CONTRIBUTING)
+
+clean-pyc:
+ -find . -type f -a \( -name "*.pyc" -o -name "*$$py.class" \) | xargs rm
+ -find . -type d -name "__pycache__" | xargs rm -r
+
+removepyc: clean-pyc
+
+clean-build:
+ rm -rf build/ dist/ .eggs/ *.egg-info/ .tox/ .coverage cover/
+
+clean-git:
+ $(GIT) clean -xdn
+
+clean-git-force:
+ $(GIT) clean -xdf
+
+test-all: clean-pyc
+ $(TOX)
+
+test:
+ $(PYTHON) setup.py test
+
+cov: covbuild
+ (cd $(TESTDIR); py.test -x --cov=django_celery_results --cov-report=html)
+
+build:
+ $(PYTHON) setup.py sdist bdist_wheel
+
+distcheck: lint test clean
+
+dist: readme contrib clean-dist build
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..4c9a557
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,99 @@
+=====================================================================
+ Celery Result Backends using the Django ORM/Cache framework.
+=====================================================================
+
+|build-status| |coverage| |license| |wheel| |pyversion| |pyimp|
+
+:Version: 1.0.1
+:Web: http://django-celery-results.readthedocs.io/
+:Download: http://pypi.python.org/pypi/django-celery-results
+:Source: http://github.com/celery/django-celery-results
+:Keywords: django, celery, database, results
+
+About
+=====
+
+This extension enables you to store Celery task results using the Django ORM.
+
+It defines a single model (``django_celery_results.models.TaskResult``)
+used to store task results, and you can query this database table like
+any other Django model.
+
+Installing
+==========
+
+The installation instructions for this extension is available
+from the `Celery documentation`_:
+
+http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html#django-celery-results-using-the-django-orm-cache-as-a-result-backend
+
+
+.. _`Celery documentation`:
+ http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html#django-celery-results-using-the-django-orm-cache-as-a-result-backend
+
+.. _installation:
+
+Installation
+============
+
+You can install django-celery-results either via the Python Package Index (PyPI)
+or from source.
+
+To install using `pip`,::
+
+ $ pip install -U django-celery-results
+
+.. _installing-from-source:
+
+Downloading and installing from source
+--------------------------------------
+
+Download the latest version of django-celery-results from
+http://pypi.python.org/pypi/django-celery-results
+
+You can install it by doing the following,::
+
+ $ tar xvfz django-celery-results-0.0.0.tar.gz
+ $ cd django-celery-results-0.0.0
+ $ python setup.py build
+ # python setup.py install
+
+The last command must be executed as a privileged user if
+you are not currently using a virtualenv.
+
+.. _installing-from-git:
+
+Using the development version
+-----------------------------
+
+With pip
+~~~~~~~~
+
+You can install the latest snapshot of django-celery-results using the following
+pip command::
+
+ $ pip install https://github.com/celery/django-celery-results/zipball/master#egg=django-celery-results
+
+.. |build-status| image:: https://secure.travis-ci.org/celery/django-celery-results.png?branch=master
+ :alt: Build status
+ :target: https://travis-ci.org/celery/django-celery-results
+
+.. |coverage| image:: https://codecov.io/github/celery/django-celery-results/coverage.svg?branch=master
+ :target: https://codecov.io/github/celery/django-celery-results?branch=master
+
+.. |license| image:: https://img.shields.io/pypi/l/django-celery-results.svg
+ :alt: BSD License
+ :target: https://opensource.org/licenses/BSD-3-Clause
+
+.. |wheel| image:: https://img.shields.io/pypi/wheel/django-celery-results.svg
+ :alt: django-celery-results can be installed via wheel
+ :target: http://pypi.python.org/pypi/django-celery-results/
+
+.. |pyversion| image:: https://img.shields.io/pypi/pyversions/django-celery-results.svg
+ :alt: Supported Python versions.
+ :target: http://pypi.python.org/pypi/django-celery-results/
+
+.. |pyimp| image:: https://img.shields.io/pypi/implementation/django-celery-results.svg
+ :alt: Support Python implementations.
+ :target: http://pypi.python.org/pypi/django-celery-results/
+
diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644
index 0000000..8677155
--- /dev/null
+++ b/appveyor.yml
@@ -0,0 +1,53 @@
+environment:
+
+ global:
+ # SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
+ # /E:ON and /V:ON options are not enabled in the batch script intepreter
+ # See: http://stackoverflow.com/a/13751649/163740
+ WITH_COMPILER: "cmd /E:ON /V:ON /C .\\extra\\appveyor\\run_with_compiler.cmd"
+
+ matrix:
+
+ # Pre-installed Python versions, which Appveyor may upgrade to
+ # a later point release.
+ # See: http://www.appveyor.com/docs/installed-software#python
+
+ - PYTHON: "C:\\Python27"
+ PYTHON_VERSION: "2.7.x"
+ PYTHON_ARCH: "32"
+
+ - PYTHON: "C:\\Python34"
+ PYTHON_VERSION: "3.4.x"
+ PYTHON_ARCH: "32"
+
+ - PYTHON: "C:\\Python27-x64"
+ PYTHON_VERSION: "2.7.x"
+ PYTHON_ARCH: "64"
+ WINDOWS_SDK_VERSION: "v7.0"
+
+ - PYTHON: "C:\\Python34-x64"
+ PYTHON_VERSION: "3.4.x"
+ PYTHON_ARCH: "64"
+ WINDOWS_SDK_VERSION: "v7.1"
+
+
+init:
+ - "ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%"
+
+install:
+ - "powershell extra\\appveyor\\install.ps1"
+ - "%PYTHON%/Scripts/pip.exe install -U setuptools"
+
+build: off
+
+test_script:
+ - "%WITH_COMPILER% %PYTHON%/python setup.py test"
+
+after_test:
+ - "%WITH_COMPILER% %PYTHON%/python setup.py bdist_wheel"
+
+artifacts:
+ - path: dist\*
+
+#on_success:
+# - TODO: upload the content of dist/*.whl to a public wheelhouse
diff --git a/django_celery_results/__init__.py b/django_celery_results/__init__.py
new file mode 100644
index 0000000..46fe8f2
--- /dev/null
+++ b/django_celery_results/__init__.py
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+"""Celery result backends for Django."""
+# :copyright: (c) 2016, Ask Solem.
+# All rights reserved.
+# :license: BSD (3 Clause), see LICENSE for more details.
+
+from __future__ import absolute_import, unicode_literals
+
+import re
+
+from collections import namedtuple
+
+__version__ = '1.0.1'
+__author__ = 'Ask Solem'
+__contact__ = 'ask at celeryproject.org'
+__homepage__ = 'https://github.com/celery/django-celery-results'
+__docformat__ = 'restructuredtext'
+
+# -eof meta-
+
+version_info_t = namedtuple('version_info_t', (
+ 'major', 'minor', 'micro', 'releaselevel', 'serial',
+))
+
+# bumpversion can only search for {current_version}
+# so we have to parse the version here.
+_temp = re.match(
+ r'(\d+)\.(\d+).(\d+)(.+)?', __version__).groups()
+VERSION = version_info = version_info_t(
+ int(_temp[0]), int(_temp[1]), int(_temp[2]), _temp[3] or '', '')
+del(_temp)
+del(re)
+
+__all__ = []
diff --git a/django_celery_results/admin.py b/django_celery_results/admin.py
new file mode 100644
index 0000000..8b6987b
--- /dev/null
+++ b/django_celery_results/admin.py
@@ -0,0 +1,37 @@
+"""Result Task Admin interface."""
+from __future__ import absolute_import, unicode_literals
+
+from django.contrib import admin
+
+from .models import TaskResult
+
+
+class TaskResultAdmin(admin.ModelAdmin):
+ """Admin-interface for results of tasks."""
+
+ model = TaskResult
+ list_display = ('task_id', 'date_done', 'status')
+ readonly_fields = ('date_done', 'result', 'hidden', 'meta')
+ fieldsets = (
+ (None, {
+ 'fields': (
+ 'task_id',
+ 'status',
+ 'content_type',
+ 'content_encoding',
+ ),
+ 'classes': ('extrapretty', 'wide')
+ }),
+ ('Result', {
+ 'fields': (
+ 'result',
+ 'date_done',
+ 'traceback',
+ 'hidden',
+ 'meta',
+ ),
+ 'classes': ('extrapretty', 'wide')
+ }),
+ )
+
+admin.site.register(TaskResult, TaskResultAdmin)
diff --git a/django_celery_results/apps.py b/django_celery_results/apps.py
new file mode 100644
index 0000000..157acf7
--- /dev/null
+++ b/django_celery_results/apps.py
@@ -0,0 +1,15 @@
+"""Application configuration."""
+from __future__ import absolute_import, unicode_literals
+
+from django.apps import AppConfig
+from django.utils.translation import ugettext_lazy as _
+
+__all__ = ['CeleryResultConfig']
+
+
+class CeleryResultConfig(AppConfig):
+ """Default configuration for the django_celery_results app."""
+
+ name = 'django_celery_results'
+ label = 'celery_results'
+ verbose_name = _('Celery Results')
diff --git a/django_celery_results/backends/__init__.py b/django_celery_results/backends/__init__.py
new file mode 100644
index 0000000..fa95c99
--- /dev/null
+++ b/django_celery_results/backends/__init__.py
@@ -0,0 +1,6 @@
+from __future__ import absolute_import, unicode_literals
+
+from .cache import CacheBackend
+from .database import DatabaseBackend
+
+__all__ = ['CacheBackend', 'DatabaseBackend']
diff --git a/django_celery_results/backends/cache.py b/django_celery_results/backends/cache.py
new file mode 100644
index 0000000..84e9170
--- /dev/null
+++ b/django_celery_results/backends/cache.py
@@ -0,0 +1,36 @@
+"""Celery cache backend using the Django Cache Framework."""
+from __future__ import absolute_import, unicode_literals
+
+from django.core.cache import cache as default_cache, caches
+
+from celery.backends.base import KeyValueStoreBackend
+
+
+class CacheBackend(KeyValueStoreBackend):
+ """Backend using the Django cache framework to store task metadata."""
+
+ def __init__(self, *args, **kwargs):
+ super(CacheBackend, self).__init__(*args, **kwargs)
+
+ # Must make sure backend doesn't convert exceptions to dict.
+ self.serializer = 'pickle'
+
+ def get(self, key):
+ return self.cache_backend.get(key)
+
+ def set(self, key, value):
+ self.cache_backend.set(key, value, self.expires)
+
+ def delete(self, key):
+ self.cache_backend.delete(key)
+
+ def encode(self, data):
+ return data
+
+ def decode(self, data):
+ return data
+
+ @property
+ def cache_backend(self):
+ backend = self.app.conf.cache_backend
+ return caches[backend] if backend else default_cache
diff --git a/django_celery_results/backends/database.py b/django_celery_results/backends/database.py
new file mode 100644
index 0000000..298c18e
--- /dev/null
+++ b/django_celery_results/backends/database.py
@@ -0,0 +1,62 @@
+from __future__ import absolute_import, unicode_literals
+
+from base64 import b64encode, b64decode
+
+from celery.backends.base import BaseDictBackend
+
+from ..models import TaskResult
+
+
+class DatabaseBackend(BaseDictBackend):
+ """The Django database backend, using models to store task state."""
+
+ TaskModel = TaskResult
+
+ subpolling_interval = 0.5
+
+ def _store_result(self, task_id, result, status,
+ traceback=None, request=None):
+ """Store return value and status of an executed task."""
+ content_type, content_encoding, result = self.encode_content(result)
+ _, _, meta = self.encode_content({
+ 'children': self.current_task_children(request),
+ })
+
+ self.TaskModel._default_manager.store_result(
+ content_type, content_encoding,
+ task_id, result, status,
+ traceback=traceback,
+ meta=meta,
+ )
+ return result
+
+ def _get_task_meta_for(self, task_id):
+ """Get task metadata for a task by id."""
+ obj = self.TaskModel._default_manager.get_task(task_id)
+ res = obj.as_dict()
+ meta = self.decode_content(obj, res.pop('meta', None)) or {}
+ res.update(meta,
+ result=self.decode_content(obj, res.get('result')))
+ return self.meta_from_decoded(res)
+
+ def encode_content(self, data):
+ content_type, content_encoding, content = self._encode(data)
+ if content_encoding == 'binary':
+ content = b64encode(content)
+ return content_type, content_encoding, content
+
+ def decode_content(self, obj, content):
+ if content:
+ if obj.content_encoding == 'binary':
+ content = b64decode(content)
+ return self.decode(content)
+
... 2234 lines suppressed ...
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-django-celery-results.git
More information about the Python-modules-commits
mailing list