I have a medium size python package and I use setuptools to build a wheel. The package is meant to be a convenience library for a fortran program. I now would like to define a constant which gives the Path to the fortran executable (which lives close to my setup.py) within my python package which I can access from any installation of my wheel. I am aware that things with resolving __file__
in a constants module won’t work since this then would be the installation directory of my package.
I am aware that probably my project structure is bad and this won’t arise with proper knowledge of how these things should be done. I googled around a lot but I have to say I am a bit lost here.
What I tried is to add the path to my setup.py in the long description:
setup(
name='spinterface',
version=VERSION,
packages=find_namespace_packages(include=["spinterface.*"]),
package_data={"":["*.json"]},
long_description=__file__)
and then access the metadata with importlib.metadata but this gives me a path which hides the information. Like:
/private/var/folders/dp/j32wtmvj6n9727g16dt5k1rr0000gn/T/build-via-sdist-23oojg1v/spinterface-1.0/setup.py
Any help is appreciated!
Best regards,
Hendrik