Skip to content

Cookiecutter template for a celery application as sub-package inside a namespace

Notifications You must be signed in to change notification settings

tanbro/cookiecutter-celery-subpackage-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cookiecutter-celery-subpackage-service

This is a cookiecutter template for a python project that:

  • is a celery worker, with tasks in it.
  • is a sub-package, and it's parent namespace has multiple other similar celery worker sub-packages.

The whole projects is like:

.
├── README.md
├── ...
│
├── myproject-services-subpack1
│   ├── README.md
│   ├── setup.cfg
│   ├── setup.py
│   ├── tests/
│   └── src
│       └── myproject
│           └── services
│               └── subpack1
│                   ├── app.py
│                   ├── __init__.py
│                   └── tasks.py
│
├── myproject-services-subpack2
│   ├── README.md
│   ├── setup.cfg
│   ├── setup.py
│   ├── tests/
│   └── src
│       └── myproject
│           └── services
│               └── subpack2
│                   ├── __init__.py
│                   ├── app.py
│                   └── tasks.py
│
├── myproject-other-module
│   ├── README.md
│   ├── setup.py
│   └── myproject
│       └── other
│           └── module.py
│
└── ...

myproject-services-subpackN are the sub-packages generated by this template.

Generate

In your project's working directory, run:

cookiecutter cookiecutter-celery-subpackage-service

When generated:

  • Hello world celery tasks defined in tasks.py
  • celery application variable app defined in app.py

Requires

This cookiecutter template can be used on either Python2 or Python3, with cookiecutter>=1.5. But the sub-package generated by the template requires:

Attention:

Since setuptools>=40.1.0 required, an update might be necessary on your development environment before any action to the sub-package's setuptools:

pip install -U setuptools

Develop

Install the sub-package in develop mode into your parent project's environment:

cd myproject-services-subpack1
python setup.py develop

About

Cookiecutter template for a celery application as sub-package inside a namespace

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages