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

pygst: support parallel installation of different versions #183

Closed
pyinstaller-tickets-migration opened this Issue Oct 18, 2014 · 9 comments

Comments

Projects
None yet
5 participants
@pyinstaller-tickets-migration
Copy link

pyinstaller-tickets-migration commented Oct 18, 2014

Original date: 2010/05/04
Original reporter: drakkan

Pyinstaller is unable to add the new paths imported using pkg_resources:

http://groups.google.com/group/pyinstaller/browse_thread/thread/0e66585401cb4f48

@htgoebel

This comment has been minimized.

Copy link
Member

htgoebel commented Oct 18, 2014

Original date: 2011/07/25

From this thread:

  • How it's supposed to work:

    pygst lies directly in site-packages and basically just contains the require() function. So in a script you always do import pygst, pygst.require(version) and it will add the correct gst- directory (there can be several concurrent different versions) to sys.path. Then, you do import gst.

  • Workaround 1: added the gst path to pathex

  • Workaround 2: add import pygst; pygst.require("...version...") within the spec file itself.

Solution suggested by giovannibajo:

I think the best solution for PyInstaller would be to:

  1. Detect calls to pkgname.require() (not easy)

  2. Create and invoke a wrapper script that does something like:

    import pygst
    pygst.require("...version...")
    print sys.path
    
  3. Dynamically add the new paths to the pathex

@htgoebel

This comment has been minimized.

Copy link
Member

htgoebel commented Oct 18, 2014

Original date: 2011/09/27

Replying to [comment:2 htgoebel]:

Solution suggested by giovannibajo:

  1. Detect calls to pkgname.require() (not easy)

Detecting "normal" bytecode could be easy, since this is basically the code below. But: this only works if the package is still pkgname, it will fail as soon as somebody does import pkgname as othername.

Thus I vote for wont-fix.

Bytecode

LOAD_GLOBAL       0 (pkgname)
LOAD_ATTR         1 (require)
LOAD_CONST        1 ('whatever')
CALL_FUNCTION     1
POP_TOP             
@htgoebel

This comment has been minimized.

Copy link
Member

htgoebel commented Oct 18, 2014

Original date: 2012/03/27

Rescheduling "enhancements" to release 2.1.

@pyinstaller-tickets-migration

This comment has been minimized.

Copy link

pyinstaller-tickets-migration commented Oct 18, 2014

Original date: 2012/04/23
Original reporter: mat AND kivy DOT org

+1 to have this bugfix. Even if "from -- to --" notation is not supported, it still a first step that would avoid lot of troubles :)

@matysek matysek modified the milestones: PyInstaller 2.2, PyInstaller 2.1 Oct 18, 2014

@matysek matysek modified the milestones: PyInstaller 3.x, PyInstaller 2.2 Jan 6, 2015

@matysek matysek added PY3 @low and removed @high labels Jan 6, 2015

@htgoebel

This comment has been minimized.

Copy link
Member

htgoebel commented Sep 3, 2015

This could be solved using the mechanisms I just added (see #1362 (comment)). The issue is that all Distributions store their meta-data in the EGG-INFO sub-directory. We need to find a way to distinguish the distribution, maybe by adding another directory-level. But where to get this level-name from?

@matysek matysek changed the title pkg_resources runtime magic pkg_resources runtime magic ( pkg_resources.get_distribution ) Oct 20, 2015

@matysek matysek referenced this issue Dec 2, 2015

Closed

Copy metadata #1701

@htgoebel htgoebel self-assigned this Dec 6, 2015

@htgoebel

This comment has been minimized.

Copy link
Member

htgoebel commented Dec 6, 2015

May be solved by #1701. Todo: verify it.

@htgoebel htgoebel added the verify label Dec 6, 2015

@htgoebel

This comment has been minimized.

Copy link
Member

htgoebel commented Dec 22, 2015

I revised this issue:

  1. This issue is not about pkg_resources runtime magic! It is just about the way pygst is adding it's concrete, versioned implementation to sys.path. pygst never used pkg_resources, see original commit of pygst.py. Only Giovanni said, this is about pkg_resources runtime magic in the last post of the mailinglist-thread (see first comment).
  2. In addition, pygst never ever did support parallel installation of different versions. Check the history of pygst.py (which is not that long).
  3. The concrete, versioned implementation was always added to sys.path using a .pth file. This was removed when pygst switched to using gi (glib introspection), see this commit
  4. There already is a hook-gst._gst.py (see issue #725) which is triggered when the usual pattern (see comments above) is used.

Conclusion: @fhoech This never ever has been a real issue. It's just been a tempest in a teapot (Sturm im Wasserglas). Argl!

Closing as invalid.

@htgoebel htgoebel closed this Dec 22, 2015

@htgoebel htgoebel added invalid and removed feature PY3 verify labels Dec 22, 2015

@htgoebel htgoebel changed the title pkg_resources runtime magic ( pkg_resources.get_distribution ) pygst: support parallel installation of different versions Dec 22, 2015

@bjones1

This comment has been minimized.

Copy link
Member

bjones1 commented Dec 22, 2015

Wow. I'm impressed by the digging you did to untangle this knot. Well done!

@xdesai

This comment has been minimized.

Copy link

xdesai commented Jun 4, 2018

I know this is an ancient issue, but I came here from bullet 2 on https://github.com/pyinstaller/pyinstaller/wiki/FAQ#misc

I see this task is marked as closed invalid. Does that mean that PyInstaller does not have issues with pkg_resources like the wiki suggests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment