Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 208 lines (152 sloc) 4.519 kb
5758117 @ask Adds paver task: verifyconfigref: Verifies that all Celery settings are ...
authored
1 import sys
9f26225 Replaced makefile with a Paver pavement file.
Ask Solem authored
2 from paver.easy import *
3 from paver import doctools
4 from paver.setuputils import setup
5
7e804bb @ask pavement: removepyc now also removes Jython compiled classes
authored
6 PYCOMPILE_CACHES = ["*.pyc", "*$py.class"]
7
9f26225 Replaced makefile with a Paver pavement file.
Ask Solem authored
8 options(
9 sphinx=Bunch(builddir=".build"),
10 )
11
c408d07 PEP8ify (using new version of pep8, 0.6.0)
Ask Solem authored
12
9f26225 Replaced makefile with a Paver pavement file.
Ask Solem authored
13 def sphinx_builddir(options):
14 return path("docs") / options.sphinx.builddir / "html"
15
16
17 @task
18 def clean_docs(options):
19 sphinx_builddir(options).rmtree()
20
21
22 @task
ca555f0 @nvie Rename the quick HTML generation to 'qhtml'.
nvie authored
23 @needs("clean_docs", "paver.doctools.html")
9f26225 Replaced makefile with a Paver pavement file.
Ask Solem authored
24 def html(options):
25 destdir = path("Documentation")
ca555f0 @nvie Rename the quick HTML generation to 'qhtml'.
nvie authored
26 destdir.rmtree()
27 builtdocs = sphinx_builddir(options)
28 builtdocs.move(destdir)
29
30
31 @task
32 @needs("paver.doctools.html")
33 def qhtml(options):
34 destdir = path("Documentation")
9f26225 Replaced makefile with a Paver pavement file.
Ask Solem authored
35 builtdocs = sphinx_builddir(options)
955c65f @nvie Use rsync instead of mv.
nvie authored
36 sh("rsync -az %s/ %s" % (builtdocs, destdir))
9f26225 Replaced makefile with a Paver pavement file.
Ask Solem authored
37
38
39 @task
40 @needs("clean_docs", "paver.doctools.html")
41 def ghdocs(options):
42 builtdocs = sphinx_builddir(options)
43 sh("git checkout gh-pages && \
540088e pavement: Fix the ghdocs task (quoted shell glob pattern by mistake)
Ask Solem authored
44 cp -r %s/* . && \
9f26225 Replaced makefile with a Paver pavement file.
Ask Solem authored
45 git commit . -m 'Rendered documentation for Github Pages.' && \
46 git push origin gh-pages && \
47 git checkout master" % builtdocs)
48
49
50 @task
51 @needs("clean_docs", "paver.doctools.html")
52 def upload_pypi_docs(options):
53 builtdocs = path("docs") / options.builddir / "html"
5758117 @ask Adds paver task: verifyconfigref: Verifies that all Celery settings are ...
authored
54 sh("%s setup.py upload_sphinx --upload-dir='%s'" % (
55 sys.executable, builtdocs))
9f26225 Replaced makefile with a Paver pavement file.
Ask Solem authored
56
57
58 @task
59 @needs("upload_pypi_docs", "ghdocs")
60 def upload_docs(options):
61 pass
62
63
64 @task
65 def autodoc(options):
59681f5 Fixed Sphinx build errors/warnings
Ask Solem authored
66 sh("contrib/release/doc4allmods celery")
9f26225 Replaced makefile with a Paver pavement file.
Ask Solem authored
67
68
69 @task
70 def verifyindex(options):
811ddad Reorganized distribution contrib/ directory
Ask Solem authored
71 sh("contrib/release/verify-reference-index.sh")
9f26225 Replaced makefile with a Paver pavement file.
Ask Solem authored
72
73
74 @task
5758117 @ask Adds paver task: verifyconfigref: Verifies that all Celery settings are ...
authored
75 def verifyconfigref(options):
76 sh("PYTHONPATH=. %s contrib/release/verify_config_reference.py \
77 docs/configuration.rst" % (sys.executable, ))
78
79
80 @task
09a6a11 @ask pavement: Adds the -E|--noerror option to flake8
authored
81 @cmdopts([
82 ("noerror", "E", "Ignore errors"),
83 ])
5d1a050 @ask Use flake8 instead of pep8+pyflakes and the silly flake ignore list
authored
84 def flake8(options):
bb0f24d paver releaseok now depends on pyflakes with no warnings. contrib/relea...
Ask Solem authored
85 noerror = getattr(options, "noerror", False)
5d1a050 @ask Use flake8 instead of pep8+pyflakes and the silly flake ignore list
authored
86 complexity = getattr(options, "complexity", 22)
87 sh("""flake8 celery | perl -mstrict -mwarnings -nle'
88 my $ignore = m/too complex \((\d+)\)/ && $1 le %s;
89 if (! $ignore) { print STDERR; our $FOUND_FLAKE = 1 }
90 }{exit $FOUND_FLAKE;
91 '""" % (complexity, ), ignore_error=noerror)
9f26225 Replaced makefile with a Paver pavement file.
Ask Solem authored
92
a86bd1c @ask flakeplus
authored
93
94 @task
95 @cmdopts([
96 ("noerror", "E", "Ignore errors"),
97 ])
98 def flakeplus(options):
99 noerror = getattr(options, "noerror", False)
5e15af6 @ask Tests passing + flake8
authored
100 sh("flakeplus celery", ignore_error=noerror)
a86bd1c @ask flakeplus
authored
101
102
9f26225 Replaced makefile with a Paver pavement file.
Ask Solem authored
103 @task
0bb5481 @ask releaseok now also runs flakeplus
authored
104 @cmdopts([
105 ("noerror", "E", "Ignore errors")
106 ])
107 def flakes(options):
108 flake8(options)
109 flakeplus(options)
110
111
112 @task
9f26225 Replaced makefile with a Paver pavement file.
Ask Solem authored
113 def clean_readme(options):
114 path("README").unlink()
115 path("README.rst").unlink()
116
117
118 @task
119 @needs("clean_readme")
120 def readme(options):
5758117 @ask Adds paver task: verifyconfigref: Verifies that all Celery settings are ...
authored
121 sh("%s contrib/release/sphinx-to-rst.py docs/templates/readme.txt \
122 > README.rst" % (sys.executable, ))
edb2dba Consistent naming for save_taskset/restore_taskset
Ask Solem authored
123 sh("ln -sf README.rst README")
9f26225 Replaced makefile with a Paver pavement file.
Ask Solem authored
124
125
126 @task
127 def bump(options):
76500d1 @ask Adds bump_version tool
authored
128 sh("contrib/release/bump_version.py \
129 celery/__init__.py docs/includes/introduction.txt \
130 --before-commit='paver readme'")
9f26225 Replaced makefile with a Paver pavement file.
Ask Solem authored
131
132 @task
133 @cmdopts([
134 ("coverage", "c", "Enable coverage"),
135 ("quick", "q", "Quick test"),
136 ("verbose", "V", "Make more noise"),
137 ])
138 def test(options):
994faa8 Removed top-level tests directory. Test config now in celery.tests.confi...
Ask Solem authored
139 cmd = "CELERY_LOADER=default nosetests"
9f26225 Replaced makefile with a Paver pavement file.
Ask Solem authored
140 if getattr(options, "coverage", False):
b5c587a pavement.py: "paver test" updated to work with non-django tests.
Ask Solem authored
141 cmd += " --with-coverage3"
9f26225 Replaced makefile with a Paver pavement file.
Ask Solem authored
142 if getattr(options, "quick", False):
b5c587a pavement.py: "paver test" updated to work with non-django tests.
Ask Solem authored
143 cmd = "QUICKTEST=1 SKIP_RLIMITS=1 %s" % cmd
9f26225 Replaced makefile with a Paver pavement file.
Ask Solem authored
144 if getattr(options, "verbose", False):
145 cmd += " --verbosity=2"
b5c587a pavement.py: "paver test" updated to work with non-django tests.
Ask Solem authored
146 sh(cmd)
9f26225 Replaced makefile with a Paver pavement file.
Ask Solem authored
147
148
149 @task
150 @cmdopts([
151 ("noerror", "E", "Ignore errors"),
152 ])
153 def pep8(options):
154 noerror = getattr(options, "noerror", False)
155 return sh("""find . -name "*.py" | xargs pep8 | perl -nle'\
156 print; $a=1 if $_}{exit($a)'""", ignore_error=noerror)
157
158
159 @task
160 def removepyc(options):
7e804bb @ask pavement: removepyc now also removes Jython compiled classes
authored
161 sh("find . -type f -a \\( %s \\) | xargs rm" % (
162 " -o ".join("-name '%s'" % (pat, ) for pat in PYCOMPILE_CACHES), ))
9f26225 Replaced makefile with a Paver pavement file.
Ask Solem authored
163
164
165 @task
166 @needs("removepyc")
167 def gitclean(options):
168 sh("git clean -xdn")
169
170
171 @task
172 @needs("removepyc")
173 def gitcleanforce(options):
174 sh("git clean -xdf")
175
176
177 @task
0bb5481 @ask releaseok now also runs flakeplus
authored
178 @needs("flakes", "autodoc", "verifyindex",
5758117 @ask Adds paver task: verifyconfigref: Verifies that all Celery settings are ...
authored
179 "verifyconfigref", "test", "gitclean")
9f26225 Replaced makefile with a Paver pavement file.
Ask Solem authored
180 def releaseok(options):
181 pass
182
183
184 @task
185 @needs("releaseok", "removepyc", "upload_docs")
186 def release(options):
187 pass
01de02f Added paver tasks to count sloc
Ask Solem authored
188
189
190 @task
2496b4c @ask Adds many missing authors :sparkles:
authored
191 def verify_authors(options):
192 sh("git shortlog -se | cut -f2 | contrib/release/attribution.py")
193
194
195 @task
01de02f Added paver tasks to count sloc
Ask Solem authored
196 def coreloc(options):
197 sh("xargs sloccount < contrib/release/core-modules.txt")
198
199
200 @task
201 def testloc(options):
202 sh("sloccount celery/tests")
203
204
205 @task
206 def loc(options):
207 sh("sloccount celery")
Something went wrong with that request. Please try again.