Closed dihm closed 4 months ago
@philipstarkey I've gone ahead and made commits that implement all of the above suggestions. Happy to back out any that are beyond the pail.
Going to go ahead with these changes since nothing heard. Will start working through the other projects to update to this standard.
This provides further fixes to how we use
setuptools_scm
as noted in comments on #106.This should fix the random build issues (of which I still cannot replicate the successful build from two weeks ago). Basic premise is that
setuptools_scm
will use whatever is in thepyproject.toml
to determine the version scheme if it is getting version by inspecting files (ie not installing). It will usesetup.py
to override thepyproject.toml
settings when installing, and it will use__version__.py
to override everything when importing the package.There are a few minor choices we could make here beyond what is currently in the PR:
os.getenv
calls insetup.py
and__version__.py
are no longer required. I'm not sure they are even needed with this change. Should we just remove them?setuptools_scm
is a sort of runtime dependency of all the packages right now. If you have a.git
folder, it will fail ifsetuptools_scm
isn't installed. I'm inclined to wrap that in a try/except so it just falls back toimportlib_metadata
instead and keep this off the official dependency list. That said, we could also just enforce it as a dependency for everyone, even it they are installing from pip.setup.cfg
to thepyproject.toml
and only have one metadata file.node-and-date
from the local scheme when installing, (particularly for editable mode). Then we wouldn't need the overrides insetup.py
which I suspect might be fragile going forward. It also makes the package versions underconda list
a bit less noisy (so only havev3.3.0.devN
instead ofv3.3.0.devN+SHA.date
) and doesn't remove much information since the node/date info in an editable install is all but worthless anyway for how quickly it stales. Having that info at import time where it can update automatically is the only place I see it having real value.These changes, assuming they are sufficient, will need to be ported to all the repos. So @philipstarkey, any thoughts before I get cracking on that?