mangling of sys.path in setup.py makes installation of more than one lazr package fail

Bug #400170 reported by James Westby
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
LAZR package template
Fix Released
Undecided
Unassigned
lazr.batchnavigator
Fix Released
Undecided
Unassigned
lazr.config
Fix Released
Undecided
Unassigned
lazr.delegates
Fix Released
Undecided
Unassigned
lazr.lifecycle
Fix Released
Undecided
Unassigned
lazr.restfulclient
Fix Released
Undecided
Unassigned
lazr.smtptest
Fix Released
Undecided
Unassigned

Bug Description

Hi,

setup.py does

  sys.path.insert(0, "src")
  from lazr.restfulclient import __version__

however, if there is another lazr module in sys.path this will fail
with an import error, as the lazr package can't be split between
"src" and the other location in sys.path.

This means that if you

  setup.py install

lazr.uri, a dependency of lazr.restfulclient then

  setup.py install

in lazr.restfulclient will fail.

This makes it very difficult to install more than one lazr module.

This is a blocker for packaging the new launchpadlib. I could hack around
it in the package, but it would be better to fix it.

Thanks,

James

Related branches

Revision history for this message
James Westby (james-w) wrote :

Any comment on this? I'd rather not implement a hack in the packaging.

Thanks,

James

Revision history for this message
James Westby (james-w) wrote :

Hi,

Feature freeze for Ubuntu is at the end of this month, and I would like
to get the new launchpadlib in, but this is blocking it. Given that there
are new packages to integrate it will take some time, so I'm keen to
get this solved soon. Is there any interest in fixing it in lazr itself,
or shall I just patch it?

Thanks,

James

Revision history for this message
Gary Poster (gary) wrote :

We should put a versions.txt in the package, and have both setup.py and __init__.py read it. Then we can remove the path hack.

This affects the majority of lazr.* packages, inlcuding the template (lazr.yourpakg)

Revision history for this message
Leonard Richardson (leonardr) wrote :

I've implemented this fix for lazr.restful and lazr.restfulclient. I don't know what other lazr.* packages are in Ubuntu, but that might be enough for you to work with.

I'm working on the other lazr.* packages now. Let me know if you're unblocked by what I've done so far, and I can make it a little lower priority.

Revision history for this message
James Westby (james-w) wrote : Re: [Bug 400170] Re: mangling of sys.path in setup.py makes installation of more than one lazr package fail

Leonard Richardson wrote:
> I've implemented this fix for lazr.restful and lazr.restfulclient. I
> don't know what other lazr.* packages are in Ubuntu, but that might be
> enough for you to work with.
>
> I'm working on the other lazr.* packages now. Let me know if you're
> unblocked by what I've done so far, and I can make it a little lower
> priority.

That's good thanks, as I am not packaging lazr.restful as this stage, so
I don't need to package the other lazr.* packages it depends on.

Thanks for your help.

James

Revision history for this message
Leonard Richardson (leonardr) wrote :

I've implemented the fix for lazr.uri, lazr.yourpkg, and lazr.enum. lazr.enum still needs to land and then I need to do a release of it; I'll do the release tomorrow. This should be enough for now.

Changed in lazr.yourpkg:
status: New → Fix Released
Changed in lazr.restfulclient:
status: New → Fix Released
Changed in lazr.lifecycle:
status: New → Confirmed
Changed in lazr.config:
status: New → Fix Released
Gary Poster (gary)
Changed in lazr.smtptest:
status: New → In Progress
Gary Poster (gary)
Changed in lazr.smtptest:
status: In Progress → Fix Committed
Changed in lazr.lifecycle:
status: Confirmed → Fix Released
Changed in lazr.delegates:
status: New → Fix Released
Changed in lazr.batchnavigator:
status: New → Fix Released
Revision history for this message
Anna SdG (anna-granudd) wrote :

Version 1.2 of lazr.smtptest on pypi still seems to be missing this fix, is there anybody out there feeling motivated to push a new version of it to pypi? Thanks, Anna

Barry Warsaw (barry)
Changed in lazr.smtptest:
status: Fix Committed → Fix Released
milestone: none → 2.0
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.