@@ -296,19 +296,31 @@ First you need to fork the Celery repository, a good introduction to this
296
296
is in the Github Guide: `Fork a Repo `_.
297
297
298
298
After you have cloned the repository you should checkout your copy
299
- to a directory on your machine::
299
+ to a directory on your machine:
300
+
301
+ .. code-block :: bash
300
302
301
303
$ git clone git@github.com:username/celery.git
302
304
303
305
When the repository is cloned enter the directory to set up easy access
304
- to upstream changes::
306
+ to upstream changes:
307
+
308
+ .. code-block :: bash
305
309
306
310
$ cd celery
311
+
312
+ .. code-block :: bash
313
+
307
314
$ git remote add upstream git://github.com/celery/celery.git
315
+
316
+ .. code-block :: bash
317
+
308
318
$ git fetch upstream
309
319
310
320
If you need to pull in new changes from upstream you should
311
- always use the :option: `--rebase ` option to ``git pull ``::
321
+ always use the :option: `--rebase ` option to ``git pull ``:
322
+
323
+ .. code-block :: bash
312
324
313
325
git pull --rebase upstream master
314
326
@@ -338,12 +350,16 @@ To run the Celery test suite you need to install a few dependencies.
338
350
A complete list of the dependencies needed are located in
339
351
:file: `requirements/test.txt `.
340
352
341
- Installing the test requirements::
353
+ Installing the test requirements:
354
+
355
+ .. code-block :: bash
342
356
343
357
$ pip -E $VIRTUAL_ENV install -U -r requirements/test.txt
344
358
345
359
When installation of dependencies is complete you can execute
346
- the test suite by calling ``nosetests ``::
360
+ the test suite by calling ``nosetests ``:
361
+
362
+ .. code-block :: bash
347
363
348
364
$ nosetests
349
365
@@ -366,7 +382,9 @@ Some useful options to :program:`nosetests` are:
366
382
Run with verbose output.
367
383
368
384
If you want to run the tests for a single test file only
369
- you can do so like this::
385
+ you can do so like this:
386
+
387
+ .. code-block :: bash
370
388
371
389
$ nosetests celery.tests.test_worker.test_worker_job
372
390
@@ -392,14 +410,18 @@ the steps outlined here: http://bit.ly/koJoso
392
410
Calculating test coverage
393
411
~~~~~~~~~~~~~~~~~~~~~~~~~
394
412
395
- Code coverage in HTML::
413
+ Code coverage in HTML:
414
+
415
+ .. code-block :: bash
396
416
397
417
$ nosetests --with-coverage3 --cover3-html
398
418
399
419
The coverage output will then be located at
400
420
:file: `celery/tests/cover/index.html `.
401
421
402
- Code coverage in XML (Cobertura-style)::
422
+ Code coverage in XML (Cobertura-style):
423
+
424
+ .. code-block :: bash
403
425
404
426
$ nosetests --with-coverage3 --cover3-xml --cover3-xml-file=coverage.xml
405
427
@@ -413,25 +435,33 @@ Running the tests on all supported Python versions
413
435
There is a ``tox `` configuration file in the top directory of the
414
436
distribution.
415
437
416
- To run the tests for all supported Python versions simply execute::
438
+ To run the tests for all supported Python versions simply execute:
439
+
440
+ .. code-block :: bash
417
441
418
442
$ tox
419
443
420
444
If you only want to test specific Python versions use the :option: `-e `
421
- option::
445
+ option:
446
+
447
+ .. code-block :: bash
422
448
423
449
$ tox -e py25,py26
424
450
425
451
Building the documentation
426
452
--------------------------
427
453
428
454
To build the documentation you need to install the dependencies
429
- listed in :file: `requirements/docs.txt `::
455
+ listed in :file: `requirements/docs.txt `:
456
+
457
+ .. code-block :: bash
430
458
431
459
$ pip -E $VIRTUAL_ENV install -U -r requirements/docs.txt
432
460
433
461
After these dependencies are installed you should be able to
434
- build the docs by running::
462
+ build the docs by running:
463
+
464
+ .. code-block :: bash
435
465
436
466
$ cd docs
437
467
$ rm -rf .build
@@ -448,28 +478,36 @@ Verifying your contribution
448
478
To use these tools you need to install a few dependencies. These dependencies
449
479
can be found in :file: `requirements/pkgutils.txt `.
450
480
451
- Installing the dependencies::
481
+ Installing the dependencies:
482
+
483
+ .. code-block :: bash
452
484
453
485
$ pip -E $VIRTUAL_ENV install -U -r requirements/pkgutils.txt
454
486
455
487
pyflakes & PEP8
456
488
~~~~~~~~~~~~~~~
457
489
458
490
To ensure that your changes conform to PEP8 and to run pyflakes
459
- execute::
491
+ execute:
492
+
493
+ .. code-block :: bash
460
494
461
495
$ paver flake8
462
496
463
497
To not return a negative exit code when this command fails use the
464
- :option: `-E ` option, this can be convenient while developing::
498
+ :option: `-E ` option, this can be convenient while developing:
499
+
500
+ .. code-block :: bash
465
501
466
502
$ paver flake8 -E
467
503
468
504
API reference
469
505
~~~~~~~~~~~~~
470
506
471
507
To make sure that all modules have a corresponding section in the API
472
- reference please execute::
508
+ reference please execute:
509
+
510
+ .. code-block :: bash
473
511
474
512
$ paver autodoc
475
513
$ paver verifyindex
@@ -481,19 +519,28 @@ located in :file:`docs/internals/reference/`. If the module is public
481
519
it should be located in :file: `docs/reference/ `.
482
520
483
521
For example if reference is missing for the module ``celery.worker.awesome ``
484
- and this module is considered part of the public API, use the following steps::
522
+ and this module is considered part of the public API, use the following steps:
523
+
524
+ .. code-block :: bash
485
525
486
526
$ cd docs/reference/
487
527
$ cp celery.schedules.rst celery.worker.awesome.rst
528
+
529
+ .. code-block :: bash
530
+
488
531
$ vim celery.worker.awesome.rst
489
532
490
533
# change every occurance of ``celery.schedules`` to
491
534
# ``celery.worker.awesome``
492
535
536
+ .. code-block :: bash
537
+
493
538
$ vim index.rst
494
539
495
540
# Add ``celery.worker.awesome`` to the index.
496
541
542
+ .. code-block :: bash
543
+
497
544
# Add the file to git
498
545
$ git add celery.worker.awesome.rst
499
546
$ git add index.rst
@@ -808,15 +855,21 @@ The version number must be updated two places:
808
855
After you have changed these files you must render
809
856
the :file: `README ` files. There is a script to convert sphinx syntax
810
857
to generic reStructured Text syntax, and the paver task `readme `
811
- does this for you::
858
+ does this for you:
859
+
860
+ .. code-block :: bash
812
861
813
862
$ paver readme
814
863
815
- Now commit the changes::
864
+ Now commit the changes:
865
+
866
+ .. code-block :: bash
816
867
817
868
$ git commit -a -m " Bumps version to X.Y.Z"
818
869
819
- and make a new version tag::
870
+ and make a new version tag:
871
+
872
+ .. code-block :: bash
820
873
821
874
$ git tag vX.Y.Z
822
875
$ git push --tags
0 commit comments