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
I just noted that using get_version with flit requires all package dependencies to be installed at build time. This is because flit tries to derive the version from AST-parsing, if that fails it imports the module (and therefore all dependencies). See flit source code.
This is, for instance, annoying when building conda packages (all dependencies need to be included in the host section of meta.yml).
@flying-sheep, do you think there would be an elegant solution to this? The only thing I could think of are conditional imports in the __init__.py file, i.e. not importing dependencies when the package is imported from flit:
__init__.py
# To avoid that all dependencies need to be installed at build# time:importsysif"flit"notinsys.argv[0]:
from .fooimportbarfrom .barimportfoobar
(However, in its current version, it's not very robust and might have side-effects)
The text was updated successfully, but these errors were encountered:
I just noted that using
get_version
withflit
requires all package dependencies to be installed at build time. This is becauseflit
tries to derive the version from AST-parsing, if that fails it imports the module (and therefore all dependencies). See flit source code.This is, for instance, annoying when building conda packages (all dependencies need to be included in the
host
section ofmeta.yml
).@flying-sheep, do you think there would be an elegant solution to this? The only thing I could think of are conditional imports in the
__init__.py
file, i.e. not importing dependencies when the package is imported from flit:__init__.py
(However, in its current version, it's not very robust and might have side-effects)
The text was updated successfully, but these errors were encountered: