A couple of necessary changes required to allow TIRL to be built as a python/conda package
-
The
tirl
package cannot be imported insetup.py
becausesetup.py
is executed at build time - whensetup.py
is executed, tirl will not have been installed into the environment in whichsetup.py
is 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__.py
is read in as a text file. -
Move TIRL config file initialisation from
setup.py
intotirl/settings.py
- for reasons related to the above,setup.py
is 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.yml
andtirlscripts.yml
templates 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
$TMPDIR
rather than/tmp/
for the TIRL working directory -
Add a
pyproject.toml
file so that build-time dependencies (cython and numpy) can be installed beforesetup.py
is executed