You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How do I set environment variables based on the platform?
Details
I am building a package which contains a Python C extension which is dynamically linked to a library. In the wheel-building process, there's no issue as the wheel-repair functionality bundles the library into the wheel and modifies the RPATH (or something similar).
The issue comes from editable installs, whereby the library path environment variable needs to be set.
TypeError: Field `tool.hatch.envs.default.overrides.platform.macos.env-vars` must be a string or an array
Work-around
The only workaround at the moment is to set all these variables for all platforms. While that works, it seems suboptimal, especially since Windows' PATH modification could cause issues on macOS or Linux.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
How do I set environment variables based on the platform?
Details
I am building a package which contains a Python C extension which is dynamically linked to a library. In the wheel-building process, there's no issue as the wheel-repair functionality bundles the library into the wheel and modifies the
RPATH
(or something similar).The issue comes from editable installs, whereby the library path environment variable needs to be set.
I was expecting something like this would work:
but this produces the following error:
Work-around
The only workaround at the moment is to set all these variables for all platforms. While that works, it seems suboptimal, especially since Windows'
PATH
modification could cause issues on macOS or Linux.Beta Was this translation helpful? Give feedback.
All reactions