Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zest.releaser need setuptools/distribute installed at system level when used in buildout #24

Closed
benoit-intrw opened this issue Sep 25, 2012 · 7 comments

Comments

@benoit-intrw
Copy link

When running fullrelease into a buildout, I got a traceback as version.

After investigating, setup.py --version is called with sys.executable in a popen thus lost the sys.path context.

Most method are in zest/releaser/utils.py file.

The problem append when the computer have no version of setuptools installed at system level.

@reinout
Copy link
Collaborator

reinout commented Sep 25, 2012

zest.releaser requires setuptools in its setup.py. My assumption is that you have setuptools installed globally (else, how did you install zest.releaser?) OR that you installed it into some virtualenv or buildout. In both cases, I'd expect setuptools to be available when using sys.executable.

But apparently I'm mistaken! It could very well be that it works just fine with virtualenv (which seems to be having a harder link to its own custom local python than buildout).

Do you have any idea how we could solve this?

@benoit-intrw
Copy link
Author

The fullrelease entry point in buildout bin/ directory look like this (I’ve removed all other dependencies):

#!/usr/bin/python2.7

import sys
sys.path[0:0] = [
    '/home/xxxxx/.buildout/eggs/zest.releaser-3.37-py2.7.egg',
    '/home/xxxxx/.buildout/eggs/distribute-0.6.28-py2.7.egg',
    ]


import zest.releaser.fullrelease

if __name__ == '__main__':
    zest.releaser.fullrelease.main()

So with sys.executable you get the right python binary but lost the paths.

I agree with you that a pythonist machine without setuptools installed is quite rare :)
But we got the case.

I've not tried it but a solution could be to update PYTHONPATH environment variable with paths from sys.path. That's seems possible with http://docs.python.org/library/os.html#os.putenv but looks tricky.

@woutervh
Copy link

woutervh commented Jul 8, 2014

I'm also bitten by this

  • barebones python without setuptools (deliberate)
  • buildout pulls in its own setuptools to avoid conflicts between buildouts regarding setuptools-versions
  • zest-releaser installed in a separate virtualenv of buildout

updating PYTHONPATH and appending the path to zestreleaser's setuptools-path seems OK

@mauritsvanrees
Copy link
Member

A few years ago I gave this a shot in the maurits-add-syspath branch, basically changing the setup.py calls to: PYTHONPATH=...... python setup.py. I think it did not seem needed then, or it looked to dangerous/crazy.

Let's try it again, in basically the same way. See branch maurits-issue-24.

@mauritsvanrees
Copy link
Member

BTW, a workaround for the user would be to create a virtualenv or buildout or whatever with a setuptools installed and add the directory containing that python executable to the path when calling fullrelease or release:

  PATH=/path/to/working/python/bin:$PATH fullrelease

If you make this a small bash script or an alias and give that the name fullrelease, all should work fine without you needing to remember to add that PATH.

@reinout
Copy link
Collaborator

reinout commented Jul 17, 2014

I just released 3.51 with the fix by @mauritsvanrees . @woutervh, could you try that one?

(If it is still a problem, re-open the ticket :-) )

@reinout reinout closed this as completed Jul 17, 2014
@woutervh
Copy link

Confirmed that the fix is working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants