bake version requirements hard into setup.py

Bug #332974 reported by Derek Richardson

This bug report was converted into a question: question #132108: bake version requirements hard into setup.py.

2
Affects Status Importance Assigned to Milestone
grok
Invalid
Undecided
Unassigned

Bug Description

it would
> be nice if grokproject could optionally generate a setup.py with
> versions pinned appropiately for packaging a project as an egg. That way
> it's easy for others with needs like ours to do what is necessary to
> incorporate a new grok project into an existing wsgi app. This seems to
> go well with the current initiative of moving the paster integration
> code (startup.py, etc) into an egg and out of grokproject templates.

Revision history for this message
Kevin Teague (kevin-bud) wrote :

An easy way to handle this is to take advantage of the fact that setup.py determines it's metadata when it's run. Adding a function at the top of setup.py that reads:

def read_versions():
    versions = []
    for line in open('versions.cfg'):
        line = line.rstrip('\r\n')
        if line == "[versions]": continue
        line = line.replace('=','==')
        versions.append(line)
    return versions

Then change install_requires to read:

install_requires=read_versions()

This should let you use the existing 'versions.cfg' file listing of pinned eggs that need to be installed for Grok, but use those pinned version for setuptools installed apps.

Revision history for this message
Jan-Jaap Driessen (janjaapdriessen) wrote :

Wouldn't you want to freeze versions in the setup.py at the moment of releasing instead of initial creation? You could use a zest.releaser hookpoint to do this.

Changed in grok:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.