[WIP] Fix cross-version: ABI tag-based precompilation cache directory#172
[WIP] Fix cross-version: ABI tag-based precompilation cache directory#172tkf wants to merge 2 commits into
Conversation
| # this is python 3.3 specific | ||
| from types import ModuleType, FunctionType | ||
|
|
||
| from setuptools.pep425tags import get_abi_tag |
There was a problem hiding this comment.
This is not a good idea since this function is not setuptools's API. We should probably copy their function https://github.com/pypa/setuptools/blob/e0433cf32dfdf39c0c14a3740c3920c496f09486/setuptools/pep425tags.py#L81 if we want to use ABI tag. Alternatively, we can drop Python 2 support. In that case sysconfig.get_config_var('SOABI') would work (https://www.python.org/dev/peps/pep-3149/). Of course, if we don't need ABI, then we can just use sys.version_info.
There was a problem hiding this comment.
...and it fails in Windows because they don't have setuptools by default? https://ci.appveyor.com/project/Keno/pyjulia/build/1.0.98/job/kh23o578ngvjkysy#L89
No. PyCall's precompilation cache for pyjulia should only depend on the Python major version. |
|
Hmm... Right, now I can't reproduce the bug I thought I fixed... Sorry for the noise. |
Here is an idea to fix cross-version capability of pyjulia. How about using Python ABI tag for separating compilation cache? In the current implementation, the cache directory uses only
sys.version_info[0](major version):pyjulia/julia/core.py
Lines 359 to 360 in 18d98e5
It then doesn't work when switching between, e.g., 3.6 and 3.7.
With this patch, cache directory would be:
Though I'm actually not sure if we should use the Python tag (e.g.,
cp37) instead of the ABI tag (e.g.,cp37m). Would PyCall.jl create different precompilation cache if it is build against, say, debug build and normal build?It is WIP until we resolve:
get_abi_tagfunction? [WIP] Fix cross-version: ABI tag-based precompilation cache directory #172 (comment)But the general idea seems to be fine; I can now use pyjulia with Python 3.6 and 3.7 with this patch.