-
Notifications
You must be signed in to change notification settings - Fork 747
Support a AnyCpy / Any Python build #910
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
Comments
This is the explicit plan already. I've recently merged #894 that goes in this direction, further pull requests that drop usages of defines are highly appreciated. Since P/Invoke is not a good fit for this approach, though (since the Mono method of using @lostmsu looked into this before, but wanted to implement some simple benchmarking to see how much this would regress performance. To find out which Python version to use at runtime I'd like to make the version and library path explicit parameters to the |
Sounds great! I was not aware that it was explicitly planned. The P/Invoke stuff would have to go, but I cannot imaging there would be any significant performance penalty using delegate, Marshal.GetDelegateForFunctionPointer and friends. In any case having a benchmark would be good. Also enables profiling performance issues that might already be in the interface between CLR and Python. |
@rmadsen-ks https://www.nuget.org/packages/Python.Runtime.UnofficialNetStandard/ currently does that. We are planning to upstream the necessary changes. |
@lostmsu sounds great! Any way I can download the source? |
@rmadsen-ks it is in this one: https://github.com/losttech/pythonnet , branch losttech/master . It is diverged a bit though. |
@lostmsu, thanks, will check it out. |
@lostmsu, I'm having trouble building the branch you linked. I'm working on a project with similar requirements as @rmadsen-ks. Are there any updates about the effort to remove compilation symbols from the build? |
This have now been implemented in Python.NET 3.0 (preview available in |
I suggest to remove all the defines, e.g PYTHON2, PYTHON3, PYTHON27, PYTHON3X, MONO_LINUX... And make it possible to define this at run-time.
I have an application where I don't know the operative system and I don't know which Python the users use (at compile time). The users will select the python version to use at run-time, depending on what they have installed. Currently, this has forced me to ship Python.Runtime.dll in 9 different versions: {Linux , Windows 32, Window 64} X {Python 2.7, 3.6 and 3.7}. Making me dread the day Python 3.8 gets out and I'll have to ship 12 different versions. And this is not even taking the 'm' and 'd' options into account.
In theory, a Python.Runtime built for python 3.6 should also work with 3.7, the only issue is figuring out what the python library is called: libpython3.6, libpython3.7, ...
Even the PYTHON2/PYTHON3 defines could be replaced by a Python.Runtime.IsPython2 bool in most cases (I believe all).
The only issue is then figuring out which python version to use at run time. Here, if you want, it could be a compile time flag, with a way of overriding it in run-time.
I might implement this myself if the maintainers think it's a good idea.
The text was updated successfully, but these errors were encountered: