mirror of
https://github.com/jazzband/django-celery-monitor.git
synced 2026-03-16 22:00:24 +00:00
Compare commits
17 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2b86acddc4 | ||
|
|
5320d6014c | ||
|
|
9fe14325e8 | ||
|
|
c055ee8d2c | ||
|
|
aec77ca926 | ||
|
|
6ec13500d0 | ||
|
|
ca942e2408 | ||
|
|
1f890c977d | ||
|
|
a91a8eed57 | ||
|
|
7012454230 | ||
|
|
9591ff917a | ||
|
|
08fc27346b | ||
|
|
2b761082b7 | ||
|
|
6d1276692f | ||
|
|
c21f7274a6 | ||
|
|
25266115f6 | ||
|
|
62ba936a79 |
20 changed files with 214 additions and 65 deletions
|
|
@ -1,5 +1,5 @@
|
|||
[bumpversion]
|
||||
current_version = 1.1.0
|
||||
current_version = 1.1.2
|
||||
commit = True
|
||||
tag = True
|
||||
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(?P<releaselevel>[a-z]+)?
|
||||
|
|
|
|||
53
.github/workflows/release.yml
vendored
Normal file
53
.github/workflows/release.yml
vendored
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
if: github.repository == 'jazzband/django-celery-monitor'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.8
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: release-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
release-
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install -U pip
|
||||
python -m pip install -U setuptools twine wheel
|
||||
|
||||
- name: Build package
|
||||
run: |
|
||||
python setup.py --version
|
||||
python setup.py sdist --format=gztar bdist_wheel
|
||||
twine check dist/*
|
||||
|
||||
- name: Upload packages to Jazzband
|
||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
|
||||
uses: pypa/gh-action-pypi-publish@master
|
||||
with:
|
||||
user: jazzband
|
||||
password: ${{ secrets.JAZZBAND_RELEASE_KEY }}
|
||||
repository_url: https://jazzband.co/projects/django-celery-monitor/upload
|
||||
48
.github/workflows/test.yml
vendored
Normal file
48
.github/workflows/test.yml
vendored
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
name: Test
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 5
|
||||
matrix:
|
||||
python-version: ['2.7', '3.5', '3.6']
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key:
|
||||
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ matrix.python-version }}-v1-
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install --upgrade tox tox-gh-actions
|
||||
|
||||
- name: Tox tests
|
||||
run: |
|
||||
tox -v
|
||||
|
||||
- name: Upload coverage
|
||||
uses: codecov/codecov-action@v1
|
||||
with:
|
||||
name: Python ${{ matrix.python-version }}
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -28,3 +28,4 @@ cover/
|
|||
.cache/
|
||||
htmlcov/
|
||||
coverage.xml
|
||||
.tox/
|
||||
|
|
|
|||
21
.travis.yml
21
.travis.yml
|
|
@ -1,21 +0,0 @@
|
|||
language: python
|
||||
sudo: false
|
||||
python:
|
||||
- '2.7'
|
||||
- '3.4'
|
||||
- '3.5'
|
||||
- '3.6'
|
||||
install: travis_retry pip install -U codecov tox-travis
|
||||
script: tox -v --travis-after -- -v
|
||||
after_success:
|
||||
- codecov
|
||||
deploy:
|
||||
provider: pypi
|
||||
user: jezdez
|
||||
password:
|
||||
secure: IyvYrWsNRfmKH5Ib8B6M/F/+EFadWG1z3qs0l5nFAYAx5LqZuL0esLPMLOxgigfN5Ii8Ne1FnJ3KDV8B/i8V6ApBJgiE+0yeP/ExQZ/WQ2ug/CcvxgIFhRN79WzwpWTqRvuYRlxGnA1cp+VLFAweC4dqzXLIzMFQw9uN8h/1uOszc9VsW4asq7/pMFutB0hYMjjZV2RrEARuCVsw93hROB/beGTAmfUOURoVv7zZ1HkcU6fUHDOU10ip7kNxNPVfXk7Z/HOyMti9Hgg6ZGTd7afCN1XBCPj+9nHbOghiEQ8RlaqN9EnoaUfC6H540QuIZISO8aEHxQqzpx8yWNScf/8ZZq3LsBCL6EtzuRWg9HdbZ7DkdezTUHXt8Rnk5ehF8H/bv43ZawTxXxBLTOsH9+ffj98BtpWWAdwEarRLTe61unw62AL7FmCzrfK1amsP74TdlZqTpJTq3Lgb3n31BxC4y4ONhjvlSKxX/z5PO/S9fb94R1v1kAMGeJcB6xtoxNjvfOov3KuRrWdDW+DL8k5tatJSBVyMJMHaOoLFxgmxZG71QZjX6v9UUKXjXD2nwTq9Z8A1aAjQibPMQXRqNErg9uax5h9B1ugWsjp+zeiYYlsQyCCib4h17beVgxVuEiwaDhN0nuaRJKVWWWoDNgwsNF8v5uJTyZNDCk7wFK0=
|
||||
on:
|
||||
tags: true
|
||||
repo: jezdez/django-celery-monitor
|
||||
python: 3.5
|
||||
distributions: sdist bdist_wheel
|
||||
|
|
@ -4,6 +4,20 @@
|
|||
Change history
|
||||
================
|
||||
|
||||
.. _version-1.1.2:
|
||||
|
||||
:release-date: 2017-05-18 11:30 a.m. UTC+2
|
||||
:release-by: Jannis Leidel
|
||||
|
||||
- More packaging fixes. Sigh.
|
||||
|
||||
.. _version-1.1.1:
|
||||
|
||||
:release-date: 2017-05-18 10:30 a.m. UTC+2
|
||||
:release-by: Jannis Leidel
|
||||
|
||||
- Fix the folder that the extra stylesheet file was stored in.
|
||||
|
||||
.. _version-1.1.0:
|
||||
|
||||
:release-date: 2017-05-11 10:25 p.m. UTC+2
|
||||
|
|
|
|||
46
CODE_OF_CONDUCT.md
Normal file
46
CODE_OF_CONDUCT.md
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
# Code of Conduct
|
||||
|
||||
As contributors and maintainers of the Jazzband projects, and in the interest of
|
||||
fostering an open and welcoming community, we pledge to respect all people who
|
||||
contribute through reporting issues, posting feature requests, updating documentation,
|
||||
submitting pull requests or patches, and other activities.
|
||||
|
||||
We are committed to making participation in the Jazzband a harassment-free experience
|
||||
for everyone, regardless of the level of experience, gender, gender identity and
|
||||
expression, sexual orientation, disability, personal appearance, body size, race,
|
||||
ethnicity, age, religion, or nationality.
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
- The use of sexualized language or imagery
|
||||
- Personal attacks
|
||||
- Trolling or insulting/derogatory comments
|
||||
- Public or private harassment
|
||||
- Publishing other's private information, such as physical or electronic addresses,
|
||||
without explicit permission
|
||||
- Other unethical or unprofessional conduct
|
||||
|
||||
The Jazzband roadies have the right and responsibility to remove, edit, or reject
|
||||
comments, commits, code, wiki edits, issues, and other contributions that are not
|
||||
aligned to this Code of Conduct, or to ban temporarily or permanently any contributor
|
||||
for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
By adopting this Code of Conduct, the roadies commit themselves to fairly and
|
||||
consistently applying these principles to every aspect of managing the jazzband
|
||||
projects. Roadies who do not follow or enforce the Code of Conduct may be permanently
|
||||
removed from the Jazzband roadies.
|
||||
|
||||
This code of conduct applies both within project spaces and in public spaces when an
|
||||
individual is representing the project or its community.
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by
|
||||
contacting the roadies at `roadies@jazzband.co`. All complaints will be reviewed and
|
||||
investigated and will result in a response that is deemed necessary and appropriate to
|
||||
the circumstances. Roadies are obligated to maintain confidentiality with regard to the
|
||||
reporter of an incident.
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version
|
||||
1.3.0, available at [https://contributor-covenant.org/version/1/3/0/][version]
|
||||
|
||||
[homepage]: https://contributor-covenant.org
|
||||
[version]: https://contributor-covenant.org/version/1/3/0/
|
||||
5
CONTRIBUTING.rst
Normal file
5
CONTRIBUTING.rst
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
.. 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>`_.
|
||||
23
README.rst
23
README.rst
|
|
@ -2,13 +2,13 @@
|
|||
Celery Monitoring for Django
|
||||
============================
|
||||
|
||||
:Version: 1.1.0
|
||||
:Version: 1.1.2
|
||||
:Web: https://django-celery-monitor.readthedocs.io/
|
||||
:Download: https://pypi.python.org/pypi/django_celery_monitor
|
||||
:Source: https://github.com/jezdez/django-celery-monitor
|
||||
:Download: https://pypi.org/project/django_celery_monitor/
|
||||
:Source: https://github.com/jazzband/django-celery-monitor
|
||||
:Keywords: django, celery, events, monitoring
|
||||
|
||||
|build-status| |coverage| |license| |wheel| |pyversion| |pyimp|
|
||||
|jazzband| |build-status| |coverage| |license| |wheel| |pyversion| |pyimp|
|
||||
|
||||
About
|
||||
=====
|
||||
|
|
@ -72,7 +72,7 @@ To use this with your project you need to follow these steps:
|
|||
|
||||
.. code-block:: console
|
||||
|
||||
$ python manage.py migrate django_celery_monitor
|
||||
$ python manage.py migrate celery_monitor
|
||||
|
||||
#. Go to the Django admin of your site and look for the "Celery Monitor"
|
||||
section.
|
||||
|
|
@ -124,13 +124,16 @@ In your Celery configuration simply set them to override the defaults, e.g.::
|
|||
|
||||
monitor_task_success_expires = timedelta(days=7)
|
||||
|
||||
.. |jazzband| image:: https://jazzband.co/static/img/badge.svg
|
||||
:target: https://jazzband.co/
|
||||
:alt: Jazzband
|
||||
|
||||
.. |build-status| image:: https://secure.travis-ci.org/jezdez/django-celery-monitor.svg?branch=master
|
||||
:alt: Build status
|
||||
:target: https://travis-ci.org/jezdez/django-celery-monitor
|
||||
.. |build-status| image:: https://github.com/jazzband/django-celery-monitor/workflows/Test/badge.svg
|
||||
:target: https://github.com/jazzband/django-celery-monitor/actions
|
||||
:alt: GitHub Actions
|
||||
|
||||
.. |coverage| image:: https://codecov.io/github/jezdez/django-celery-monitor/coverage.svg?branch=master
|
||||
:target: https://codecov.io/github/jezdez/django-celery-monitor?branch=master
|
||||
.. |coverage| image:: https://codecov.io/github/jazzband/django-celery-monitor/coverage.svg?branch=master
|
||||
:target: https://codecov.io/github/jazzband/django-celery-monitor?branch=master
|
||||
|
||||
.. |license| image:: https://img.shields.io/pypi/l/django-celery-monitor.svg
|
||||
:alt: BSD License
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@ import re
|
|||
|
||||
from collections import namedtuple
|
||||
|
||||
__version__ = '1.1.0'
|
||||
__version__ = '1.1.2'
|
||||
__author__ = 'Jannis Leidel'
|
||||
__contact__ = 'jannis@leidel.info'
|
||||
__homepage__ = 'https://github.com/jezdez/django-celery-monitor'
|
||||
__homepage__ = 'https://github.com/jazzband/django-celery-monitor'
|
||||
__docformat__ = 'restructuredtext'
|
||||
|
||||
# -eof meta-
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@ globals().update(conf.build_config(
|
|||
'django_celery_monitor', __file__,
|
||||
project='django_celery_monitor',
|
||||
version_dev='1.2.0',
|
||||
version_stable='1.1.0',
|
||||
version_stable='1.1.2',
|
||||
canonical_url='http://django-celery-monitor.readthedocs.io',
|
||||
webdomain='',
|
||||
github_project='jezdez/django-celery-monitor',
|
||||
github_project='jazzband/django-celery-monitor',
|
||||
copyright='2009-2017',
|
||||
django_settings='proj.settings',
|
||||
include_intersphinx={'python', 'sphinx', 'django', 'celery'},
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
sphinx_celery>=1.1
|
||||
Django>=1.10
|
||||
Django>=1.10,<2.0
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@ tox>=2.3.1
|
|||
sphinx2rst>=1.0
|
||||
bumpversion==0.5.3
|
||||
pydocstyle==2.0.0
|
||||
docutils==0.13.1
|
||||
docutils==0.14
|
||||
readme-renderer==17.2
|
||||
check-manifest==0.35
|
||||
check-manifest==0.36
|
||||
|
|
|
|||
|
|
@ -1,2 +1 @@
|
|||
pytest-cov==2.5.0
|
||||
codecov==2.0.9
|
||||
pytest-cov
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
case>=1.3.1
|
||||
pytest>=3.0
|
||||
pytest-django==3.1.2
|
||||
pytz>dev
|
||||
pytest-django
|
||||
pytz
|
||||
|
|
|
|||
2
setup.py
2
setup.py
|
|
@ -150,5 +150,5 @@ setuptools.setup(
|
|||
tests_require=reqs('test.txt'),
|
||||
cmdclass={'test': pytest},
|
||||
zip_safe=False,
|
||||
include_package_data=False,
|
||||
include_package_data=True,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@ def Event(*args, **kwargs):
|
|||
return _Event(*args, **kwargs)
|
||||
|
||||
|
||||
@pytest.mark.django_db()
|
||||
@pytest.mark.usefixtures('depends_on_current_app')
|
||||
@pytest.mark.django_db
|
||||
class test_Camera:
|
||||
Camera = camera.Camera
|
||||
|
||||
|
|
@ -62,8 +62,9 @@ class test_Camera:
|
|||
worker.event('heartbeat', t, t, {})
|
||||
self.state.workers[worker.hostname] = worker
|
||||
assert (
|
||||
self.cam.get_heartbeat(worker) ==
|
||||
make_aware(datetime.fromtimestamp(t3))
|
||||
self.cam.get_heartbeat(worker) == make_aware(
|
||||
datetime.fromtimestamp(t3)
|
||||
)
|
||||
)
|
||||
|
||||
def test_handle_worker(self):
|
||||
|
|
@ -140,24 +141,28 @@ class test_Camera:
|
|||
task.event('received', tstamp, tstamp, {})
|
||||
mt = self.cam.handle_task((task.uuid, task))
|
||||
assert (
|
||||
mt.tstamp ==
|
||||
datetime(2016, 6, 1, 15, 0, 0, tzinfo=timezone.utc)
|
||||
mt.tstamp == datetime(
|
||||
2016, 6, 1, 15, 0, 0, tzinfo=timezone.utc
|
||||
)
|
||||
)
|
||||
assert (
|
||||
mt.eta ==
|
||||
datetime(2016, 6, 1, 15, 16, 17, 654321, tzinfo=timezone.utc)
|
||||
mt.eta == datetime(
|
||||
2016, 6, 1, 15, 16, 17, 654321, tzinfo=timezone.utc
|
||||
)
|
||||
)
|
||||
assert (
|
||||
mt.expires ==
|
||||
datetime(2016, 7, 1, 12, 16, 17, 765432, tzinfo=timezone.utc)
|
||||
mt.expires == datetime(
|
||||
2016, 7, 1, 12, 16, 17, 765432, tzinfo=timezone.utc
|
||||
)
|
||||
)
|
||||
|
||||
task = self.create_task(worker, eta='2016-06-04T15:16:17.654321')
|
||||
task.event('received', tstamp, tstamp, {})
|
||||
mt = self.cam.handle_task((task.uuid, task))
|
||||
assert (
|
||||
mt.eta ==
|
||||
datetime(2016, 6, 4, 15, 16, 17, 654321, tzinfo=timezone.utc)
|
||||
mt.eta == datetime(
|
||||
2016, 6, 4, 15, 16, 17, 654321, tzinfo=timezone.utc
|
||||
)
|
||||
)
|
||||
|
||||
with override_settings(USE_TZ=False, TIME_ZONE='Europe/Helsinki'):
|
||||
|
|
|
|||
16
tox.ini
16
tox.ini
|
|
@ -1,6 +1,6 @@
|
|||
[tox]
|
||||
envlist =
|
||||
tests-py{py,27,34,35}-dj{18,19,110}
|
||||
tests-py{py,27,35}-dj111
|
||||
tests-py36-dj111
|
||||
apicheck
|
||||
builddocs
|
||||
|
|
@ -10,12 +10,11 @@ envlist =
|
|||
pydocstyle
|
||||
readme
|
||||
|
||||
[travis]
|
||||
[gh-actions]
|
||||
python =
|
||||
2.7: py27, apicheck, builddocs, flake8, flakeplus, linkcheck, pydocstyle
|
||||
|
||||
[travis:after]
|
||||
travis = python: 3.5
|
||||
2.7: py27, flake8, flakeplus, pydocstyle
|
||||
3.5: py35
|
||||
3.6: py36, apicheck, builddocs, linkcheck
|
||||
|
||||
[testenv]
|
||||
sitepackages = False
|
||||
|
|
@ -24,16 +23,13 @@ deps=
|
|||
-r{toxinidir}/requirements/test.txt
|
||||
-r{toxinidir}/requirements/test-ci.txt
|
||||
|
||||
dj18: django>=1.8,<1.9
|
||||
dj19: django>=1.9,<1.10
|
||||
dj110: django>=1.10,<1.11
|
||||
dj111: django>=1.11,<2
|
||||
|
||||
apicheck,builddocs,linkcheck: -r{toxinidir}/requirements/docs.txt
|
||||
flake8,flakeplus,manifest,pydocstyle,readme: -r{toxinidir}/requirements/pkgutils.txt
|
||||
|
||||
commands =
|
||||
tests: py.test -xv --cov=django_celery_monitor --cov-report=term --cov-report=xml --no-cov-on-fail []
|
||||
tests: pytest -xv --cov=django_celery_monitor --cov-report=term --cov-report=xml --no-cov-on-fail []
|
||||
apicheck: sphinx-build -W -b apicheck -d {envtmpdir}/doctrees docs docs/_build/apicheck
|
||||
builddocs: sphinx-build -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html
|
||||
flake8: flake8 {toxinidir}/django_celery_monitor {toxinidir}/tests
|
||||
|
|
|
|||
Loading…
Reference in a new issue