Skip to content

Support a AnyCpy / Any Python build #910

Closed
@rmadsen-ks

Description

@rmadsen-ks

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions