Jean-Michel Fauth wrote:
I do not think, there is any valid and/or serious reason
to change anything for the while.
we should change it now, or not bother
As a *win* developer, switching from one wxPy version
to one another can simply be done by a directory renaming.
(a two-five lines Python script).
it can be done this way on all platforms, but it means that at any one moment, there is only one version in use, and it can't be specified by the app.
The actual discussion is a little hot, because the switch
wxPy24* -> wxPy25 has introduced a lot of changes
Exacly why we should do it now or never.
To be short, I would say wxPy25 is a new world.
Right, which is why this is such an obvious issue right now. IN teh future, who is to say we won't have a similar issue with wxPy35 ?
I do
not think it will take a long time, until all users have switched.
If not possible, keeping two versions of the same application,
is probably the easiest solution.
Exactly why each version of the app should be able to specify which version of wxPython it needs to run with.
Scott David Daniels wrote:
I'd consider using a path file to control this.
In site-packages: "wx24/wx" and "wx24/wxPython" and "wx25/wx" and ...
Also in site-packages:
wxpython.pth
A simple text file with the directory name to use for wxPython
(either wx24 or wx25 in this example).
This still requires for the standard install to have a version name in the path, which is what I"m shooting for. This may solve the "how to ahve a default" problem. If there is a wxpython.pth file, will:
from wx25 import wx
or
from wx24 import wx
still work? This may be the solution...
Robin Dunn wrote:
Chris Barker wrote:
What are your thoughts on option (4) from my previous post:
I think it's a bit too unwieldy, but I'm still thinking about it.
With the suggestion of a wxpython.pth file, I think this could be pretty darn clean:
site-packages/wx24/wx
site-packages/wx24/wxPython
site-packages/wx25/wx
site-packages/wx26/wx
the default set in:
site-packages/wxPython.pth
and then the old style will work, and:
from wx25 import wx
from wx25 import wx.lib.buttons
will work as well!
Samuel Reynolds wrote:
I'd certainly use wxpython.pth instead of symlinks, because
it's a single solution that works cross-platform.
yup, I wish I'd thought of it!
Neither symlinks, folder-renaming, nor wxpython.pth solves
this use-case:
- Single installation of single Python version (e.g., 2.3.2)
- Program A requires wx24 (not converted for wx25)
- Program B requires wx25 (converted, so won't run with wx24)
- User runs A
- User runs B (without killing A)
This is EXACTLY the use case I'm trying to accomidate, and I think the above suggestion would work, and it would only require that the import lines specify the version.
It may be resolved on *nix by starting via a shell script
that sets PYTHONPATH, or on Windows via a .bat file that
starts a new cmd shell with the appropriate PYTHONPATH.
But in either case, this approach would require not only
two different versions of wxPython, but two different
installs of Python (even if the same version).
no, it jsut requires that wxPython not be istalled in the standard location, and I REALLY don't like the need for an extra launch script.
Something that allows the app to specify, before it
imports wxPython (or any part of it), what version is
desired, would be preferable.
This is OK, and there have bee a couple of suggestions, but it still seems simpler to jsut have the version specified in the import statement. The one advantage I can see is that this extra step could allow the user to specifiy an environment variable, that would be used if it existed, solving David Fraser's use case. However, as Jean-Michel pointed out, the best solution there might be: "Don't do that", i.e. don't try to make one wxPython program that works with both versions. If we have a nice way to specify versions, there will be little need.
Unfortunately, this would require changes to Python's
import machinery, not just changes to wxPython.
This is NOT going to happen any time soon, so we need a solution that doesn't require changes to Python.
-Chris
···
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov