spotfiresoftware / spotfire-python

Package for Building Python Extensions to Spotfire®
Other
18 stars 6 forks source link

Generate interpreter SPK packages with protections from overriding with user site-packages #39

Closed bbassett-tibco closed 1 year ago

bbassett-tibco commented 1 year ago

When building a Spotfire interpreter SPK (using python -m spotfire.spk python ...), use a site path configuration file to add an additional directory to the interpreter's sys.path property ahead of any site-packages directories (especially the per-user one). Install the spotfire module into this directory during the creation of the SPK. (The requirements of the spotfire package should not be subject to this behavior, as user site-packages installations overriding other packages from the interpreter SPK package are less problematic for use by the Analyst client.)

The idea with this change is to reduce the likelyhood that if a user has installed an older version of the spotfire module in their per-user site-packages directory, that it should not prevent the version that is included with the interpreter SPK package (which will contain the required features the Analyst client is expecting) from loading (and inducing failures at runtime that are limited to a specific user's machine configuration). This is not intended to change the loading behaviors when the spotfire package is loaded by a user-provided interpreter (since they are presumed to take responsibility for installing the correct version to be compatible with the Analyst client version in use).