Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #800 (closed enhancement: fixed)

Opened 13 years ago

Last modified 12 years ago

[PATCH] SQLalchemy selection in 0.9a5 does not generate requires

Reported by: jvanasco@… Owned by: anonymous
Priority: lowest Milestone: 0.9a6
Component: TurboGears Version: 0.9a5
Severity: trivial Keywords:


This is really trivial

since SQLalchemy isn't distributed with TG, it would be nice if an effect of choosing the sqlalchemy provider on quickstart would be tossing sqlalchemy into the requires lists in setup.py and egg-info

Change History

comment:1 Changed 13 years ago by jvanasco@…

  • Version changed from 0.9a4 to 0.9a5

updated revision to 0.9a5

comment:2 Changed 13 years ago by jorge.vargas

so far the support for sa is very limited much needs to be done before this can happen.

On the other hand one thing setuptools is still lacking is customization of dependancies at runtime. So I see this hard to happen.

Will sqlalchemy depend on your proy? or on your instalation? if the first you will end up with both ORM if the second you will not be able to switch between one and the other.

comment:3 Changed 13 years ago by michele

Hi Jorge,

what do you intend with customization of dependencies at runtime? I can't see how this could ever be supported, if you're going to install an egg you need to know *every* one of its dep in that exact moment, if they can change dynamically how can easy_install be sure that this egg will run correctly once installed?

I think what jvanasco is asking is pretty simple and reasonable, if you use a sqlalchemy provider your quickstart project will list sa as requirement, he was not asking for TG to change its requirements but just setup.py and egg-info of the quickstarted project. :-)

This ticket requires a trivial patch for the quickstart template.

comment:4 Changed 13 years ago by jvanasco@…


thats exactly it. i don't expect tg to integrate SA into the system -- but since there is the option to list SA, the egg-info should list SA as required. this way when something doesn't work, people don't blame a unmentioned require

comment:5 Changed 13 years ago by godoy

The problem is that then everybody's installation will have two ORMs: SQL Object and SQL Alchemy.

Today, SQL Object is the official -- hence required -- ORM. SQL Alchemy is supported and will, probably, be the official ORM one day. On that day, then, SQL Object *won't* be required and SQL Alchemy will.

Who chooses SQL Alchemy is going to have to handle more stuff manually than who chooses SQL Object.

On the other hand, I'm not sure but it might work if the "requires.txt" file had the chosen ORM in it, just for consistency. It will probably make it impossible to run the project unless SQL <something> is installed.

comment:6 Changed 13 years ago by Matt Good <tg@…>

  • Summary changed from SQLalchemy selection in 0.9a5 does not generate requires to [PATCH] SQLalchemy selection in 0.9a5 does not generate requires

This won't affect the requirements for TurboGears itself, only quickstarted projects as michele said above. And yes, this is really trivial:

  • turbogears/qstemplates/quickstart/setup.py_tmpl

    1616    #download_url=download_url, 
    1717    #license=license, 
    19     install_requires = ["TurboGears >= ${turbogearsversion}"], 
     19    install_requires = [ 
     20        "TurboGears >= ${turbogearsversion}", 
     21#if $identity == "sqlalchemy" 
     22        "SQLAlchemy", 
     23#end if 
     24    ], 
    2025    scripts = ["start-${package}.py"], 
    2126    zip_safe=False, 
    2227    packages=find_packages(), 

comment:7 Changed 13 years ago by jvanasco@…

awesome. thats exactly what i was thinking of.

question - how did you get the patch inline like that? i never saw a wikiformatting command like that before.

comment:8 Changed 13 years ago by Matt Good <tg@…>

It's the same as for code blocks using the WikiProcessors syntax:

(paste diff contents here)

comment:9 Changed 13 years ago by godoy

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone set to 0.9a6

Closed with [1489] and [1490].

Note: See TracTickets for help on using tickets.