-
-
Notifications
You must be signed in to change notification settings - Fork 63
version.py template should not import setuptools_scm if package is installed from a distribution #461
Comments
Hmm. I never used the template thingy in my projects, so I am not sure what is the correct solution here. Looks like astropy core is using this too. Maybe @astrofrog or @Cadair can comment. Thanks for bringing this to our attention! |
This was added because people wanted the version to be updated correctly without re-running |
Yes, that would do it. |
Sorry if I'm missing something here, but once |
@astrofrog, why not check to see whether |
I can open a PR here introducing the same system as the astropy main package now uses, we copied this to our projects as well and it works great but is a bit of a pain to setup. It would thus be great to have it in the template. You can see a stripped-down example here: Note the |
The version.py template (the
VERSION_TEMPLATE
string constant in setup.py) unconditionally attempts to importsetuptools_scm
:setuptools_scm
is an expensive import because it importspkg_resources
, which enumerates all installed packages (see pypa/setuptools#926). On my MacBook with an SSD, this is the main cost of importing any Astropy affiliated package, adding 0.3 seconds of overhead. I have seenimport pkg_resources
orimport setuptools_scm
take seconds or more on NFS filesystems on computing clusters. It should be avoided where possible.The text was updated successfully, but these errors were encountered: