forked from celery/celery
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update CONTRIBUTING.rst, fix tests and update Dockerfile. Related to c…
…elery#5096. (celery#5143) * Update couchbase install steps Fix integration test for channel leak. We have to inspect the channels created before the tasks are done to ensure we're looking at the correct data Running multiple times test_parallel_chords to make sure test works Add pytest fixtures to t/integration/conftest.py so we don't have to install package to use fixtures Update sphinx test to use sphinx_testing instead of running sphinx-build Bump setuptools Install reqs for all python versions and upgrade pip Update docker-compose to create a tagged image and update PYTHONPATH Add bandit to pkgutils Update contributing documentation and changelog to show 4.3 version Add pkgutils and docs requirements to run sphinx unit tests and use cyanide when running travis Forgot to fix flake8 issues on tests. Remove bandit from pkgutils.txt since tox already installs it. Update CONTRIBUTING.rst to show how to install bandit to run it Fix flake8 issues on test_sphinx and add shared task to the test Update wording for CONTRIBUTING.rst Make python3.6 default python version, mount the entire celery folder so everything can be done inside the container and bump setuptools Update label definitions. Remove cyanide from requirements for now and add bumpversion information. * Update celery.contrib.sphinx. Checking if the object to document is a subclass of BaseTask and has the attribute __wrapped__ should be enough to know if it's a Celery task. Checking if the object is also an instance of Proxy/PromiseProxy makes the extension not work correctly. Probably becuase of how sphinx loads objects and the dunder overrides that the Proxy class does,depending on how sphinx-doc is ran a celery task might be or not a instance of Proxy. * Update Test Case details.
- Loading branch information
Showing
17 changed files
with
450 additions
and
105 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/sh | ||
wget http://packages.couchbase.com/clients/c/libcouchbase-2.8.4_jessie_amd64.tar | ||
tar -vxf libcouchbase-2.8.4_jessie_amd64.tar | ||
dpkg -i libcouchbase-2.8.4_jessie_amd64/libcouchbase2-core_2.8.4-1_amd64.deb | ||
dpkg -i libcouchbase-2.8.4_jessie_amd64/libcouchbase-dev_2.8.4-1_amd64.deb | ||
wget http://packages.couchbase.com/releases/couchbase-release/couchbase-release-1.0-4-amd64.deb | ||
dpkg -i couchbase-release-1.0-4-amd64.deb | ||
apt-get update | ||
apt-get install libcouchbase-dev build-essential |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
setuptools>=20.6.7 | ||
setuptools>=30.0.0 | ||
wheel>=0.29.0 | ||
flake8>=2.5.4 | ||
flakeplus>=1.1 | ||
pydocstyle==1.1.1 | ||
tox>=2.3.1 | ||
sphinx2rst>=1.0 | ||
cyanide>=1.0.1 | ||
# Disable cyanide until it's fully updated. | ||
# cyanide>=1.0.1 | ||
bumpversion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
Documentation | ||
=============== | ||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
.. automodule:: foo | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,24 @@ | ||
from __future__ import absolute_import, unicode_literals | ||
|
||
from celery import Celery | ||
from celery import Celery, shared_task | ||
from xyzzy import plugh # noqa | ||
|
||
app = Celery() | ||
|
||
|
||
@app.task | ||
def bar(): | ||
"""This task has a docstring!""" | ||
"""Task. | ||
This is a sample Task. | ||
""" | ||
pass | ||
|
||
|
||
@shared_task | ||
def baz(): | ||
"""Shared Task. | ||
This is a sample Shared Task. | ||
""" | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,30 @@ | ||
from __future__ import absolute_import, unicode_literals | ||
|
||
import pkg_resources | ||
import os | ||
import pytest | ||
|
||
try: | ||
sphinx_build = pkg_resources.load_entry_point( | ||
'sphinx', 'console_scripts', 'sphinx-build') | ||
except pkg_resources.DistributionNotFound: | ||
sphinx_build = None | ||
from sphinx_testing import TestApp | ||
from sphinx.application import Sphinx # noqa: F401 | ||
sphinx_installed = True | ||
except ImportError: | ||
sphinx_installed = False | ||
|
||
|
||
@pytest.mark.skipif(sphinx_build is None, reason='Sphinx is not installed') | ||
def test_sphinx(tmpdir): | ||
srcdir = pkg_resources.resource_filename(__name__, 'proj') | ||
sphinx_build([srcdir, str(tmpdir)]) | ||
with open(tmpdir / 'contents.html', 'r') as f: | ||
contents = f.read() | ||
assert 'This task has a docstring!' in contents | ||
assert 'This task is in a different module!' not in contents | ||
SRCDIR = os.path.join(os.path.dirname(__file__), 'proj') | ||
|
||
|
||
@pytest.mark.skipif( | ||
sphinx_installed is False, | ||
reason='Sphinx is not installed' | ||
) | ||
def test_sphinx(): | ||
app = TestApp(srcdir=SRCDIR, confdir=SRCDIR) | ||
app.build() | ||
contents = (app.outdir / 'contents.html').read_text(encoding='UTF-8') | ||
assert 'This is a sample Task' in contents | ||
assert 'This is a sample Shared Task' in contents | ||
assert ( | ||
'This task is in a different module!' | ||
not in contents | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters