A couple of necessary changes required to allow TIRL to be built as a python/conda package
-
The
tirlpackage cannot be imported insetup.pybecausesetup.pyis executed at build time - whensetup.pyis executed, tirl will not have been installed into the environment in whichsetup.pyis being executed, and there is no guarantee that it will be available on the python module path. Instead, in order to extract the TIRL version number,tirl/__init__.pyis read in as a text file. -
Move TIRL config file initialisation from
setup.pyintotirl/settings.py- for reasons related to the above,setup.pyis executed at build time, and is almost certainly executed on a different machine than that on which TIRL will be installed and used. So it doesn't make sense to install and initialise user-specific configuration files insetup.py- this must be done at installation or run-time. -
Move the
tirl.ymlandtirlscripts.ymltemplates into thetirl/package directory so that they are installed into the TIRL package, and can be used for one-time initialisation of the user-specific TIRL configuration file and tirlscripts registry. -
Use
$TMPDIRrather than/tmp/for the TIRL working directory -
Add a
pyproject.tomlfile so that build-time dependencies (cython and numpy) can be installed beforesetup.pyis executed