grokproject does not like dotted names

Bug #223560 reported by Maurits van Rees
2
Affects Status Importance Assigned to Milestone
grok
Confirmed
Undecided
Brandon Rhodes
1.0
Confirmed
Undecided
Martijn Faassen

Bug Description

This refs http://permalink.gmane.org/gmane.comp.web.zope.grok.devel/4527
Oh well, I will paste that complete post.

maurits@hobb:~/grok $ grokproject one.two
Enter user (Name of an initial administrator user): admin
Enter passwd (Password for the initial administrator user): admin
Enter eggs_dir (Location where zc.buildout will look for and place packages) ['/home/maurits/buildout-eggs']:
Creating directory ./one.two
Downloading zc.buildout...
Invoking zc.buildout...
Couldn't find index page for 'onetwo' (maybe misspelled?)
While:
  Installing i18n.
  Getting distribution for 'onetwo'.
Error: Couldn't find a distribution for 'onetwo'.

As you can see, this fails. Is this a known bug? Or should
grokprojects not have dots in them?

This can be fixed by:

- replacing all occurences in the generated code of onetwo with
  one.two, except in app.py where "class one.two(...)" would give a
  syntax errror

- turning src/onetwo into src/one/two (with a proper __init__.py
  added)

Perhaps something I can look at on the Grokkerdam sprint with
someone? :)

todd (todd-infrae)
Changed in grok:
assignee: nobody → brandon-rhodes
milestone: none → 1.0
Revision history for this message
Brandon Rhodes (brandon-rhodes) wrote :

This looks like a great idea to me: that grokproject should be able to handle the creation of a package-in-a-namespace-package instead of users having to manually create a first-level grokproject and then move it beneath a namespace package themselves.

I'll ask the list about this.

Changed in grok:
status: New → Confirmed
Revision history for this message
Michael Haubenwallner (d2m) wrote :

The error is cause by the i18n part in buildout.cfg_tmpl

# this section named so that the i18n scripts are called bin/i18n...
[i18n]
recipe = z3c.recipe.i18n:i18n
packages = ${package}
eggs = ${package}
domain = ${package}
output = src/${package}/locales
zcml =

package names are mangled by paste.script (removes any charater but 'a-zA-Z0-9_')
the i18n part schould replace ${package} by ${egg}

Revision history for this message
Michael Haubenwallner (d2m) wrote :

assert that the project name is a valid Python identifier
http://svn.zope.org/grokproject/?rev=100140&view=rev

Revision history for this message
Martijn Faassen (faassen) wrote :

I'm not sure why this issue is set 'fix released'. Some bug was fixed but we still can't use grokproject on packages with dotted names, right?

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

Right, you can't use grokproject on packages with dotted names and get an Error when trying to do so.

Changed in grok:
status: Fix Released → Confirmed
Revision history for this message
Jan-Jaap Driessen (janjaapdriessen) wrote :

The implementation of namespaced packages can be copied from the fanstatictemplate code:

http://pypi.python.org/pypi/fanstatictemplate

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.