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 am trying to implement a way to get the runtime version if editable and the install version otherwise (as mentioned in #143). I initially thought we could try to import the generated _version.py and if it doesn't exist use setuptools_scm.get_version, e.g.
try:
from ._versionimportversionas__version__exceptImportError:
fromsetuptools_scmimportget_version__version__=get_version()
but _version.py is created in the source tree for editable installs, so the first import always works. I have tested adding the following develop hook to setup.py, so at the end of an editable install it just removes the _version.py
which works - it uses the live version for an editable install, but can find _version.py and use that otherwise. But, is there a better way to do this? Could this develop build hook to delete the file be added within setuptools_scm, optionally (or the logic to create it be moved to a hook that doesn't run for editable installs)?
The text was updated successfully, but these errors were encountered:
I am trying to implement a way to get the runtime version if editable and the install version otherwise (as mentioned in #143). I initially thought we could try to import the generated
_version.py
and if it doesn't exist usesetuptools_scm.get_version
, e.g.but
_version.py
is created in the source tree for editable installs, so the first import always works. I have tested adding the following develop hook tosetup.py
, so at the end of an editable install it just removes the_version.py
which works - it uses the live version for an editable install, but can find
_version.py
and use that otherwise. But, is there a better way to do this? Could this develop build hook to delete the file be added within setuptools_scm, optionally (or the logic to create it be moved to a hook that doesn't run for editable installs)?The text was updated successfully, but these errors were encountered: