Question

I want to try this middleware in a Django project I'm working on: https://github.com/directeur/django-pdf. It goes by the name "django-pdf", but is not the same as https://pypi.python.org/pypi/django-pdf/1.0.2. Unfortunately, the Directeur django-pdf is also not trivially eggifiable: It doesn't have a setup.py or requirements.txt.

Is there some buildout recipe or way to install the package into the django path, or am I forced to fork the repo and add a setup.py?

Here's my current development buildout.cfg:

[buildout]
parts =
    python
    django
    django-nose
    pyflakes
show-picked-versions = true
develop = .
eggs = django-core7
versions = versions

[python]
recipe = zc.recipe.egg
interpreter = python
eggs = ${buildout:eggs}

[django]
recipe = djangorecipe
project = core7
projectegg = core7
settings = development
test = core7
eggs =
    ${buildout:eggs}
    ${django-nose:eggs}
    django_pdb
extra-paths = ${buildout:sources-dir}

[django-nose]
recipe = zc.recipe.egg
eggs =
    django-nose
    coverage

# Make this a separate part so it doesn't get included in Django's path.
[pyflakes]
recipe = zc.recipe.egg
eggs = pyflakes

[versions]
django = 1.5
Was it helpful?

Solution

From what I understand, buidout heavily depends on setuptools (or at lease a setup.py). Without this, buildout cannot produce a distribution (an egg). Luckily GitHub lets you easily fork a repository so you can add a setup.py. ;-) You might want to consider supplying a patch.

Since there is no recipe (to my knowledge) that lets you add projects without a setup.py. Such a project sounds like an anti-pattern since this would break the 'contract' of a project requiring a setup.py.

The first option seems like the better one. When your project is on GitHub you can use mr.develop to pull in your dependency.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top