-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
override version via an environment variable #199
Comments
I have the exact same issue here. It is frustrating that there is no environment override. I am trying to test several packages from the git repo and this is the hack I have to perform to set the package version https://github.com/costrouc/python-downstream-testing/blob/master/overrides.nix#L37. |
Since it doesn't look like this issue has gained much traction here is the workaround I am using with nix. Note that postPatch = ''
# versioneer hack to set version of github package
echo "def get_versions(): return {'dirty': False, 'error': None, 'full-revisionid': None, 'version': '${version}'}" > dask/_version.py
substituteInPlace setup.py \
--replace "version=versioneer.get_version()," "version='${version}'," \
--replace "cmdclass=versioneer.get_cmdclass()," ""
''; |
This is what Fedora uses in nb2plots:
|
This would be helpful for building inside Docker containers. Sometimes it's handy to |
I think there's a common issue of finding some fallback version, and I've tagged the open issues that bring up different aspects of this with the fallback label. It would be good to try to address this with each of these use cases in mind. |
I could also use this e.g. for adding an external project as a subtree in a git repository. |
I started an override-only PR at #238, but don't have time to put into writing the tests right now. If you'd like to take over the PR, I should be able to review. |
- Otherwise `versioneer` will report that the version is "dirty" as explained under python-versioneer/python-versioneer#199
Is it possible to ovveride the version via an environment variable ? if not would it be possible to add the feature ? setuptools provides the convenient variable SETUPTOOLS_SCM_PRETEND_VERSION="0.25.0"; for instance.
My usecase is that pandas if (very) often broken for me so I often need to use the development version.
When fetching the code from github via nix, it fetches a tarball thus it misses the .git files.
This ends up with pandas having a
0+unknown
version. Because my setup.py enforces pandas >= 0.24.2, the pip check fails:The most straightforward solution in my case would be to export the
VERSIONEER_VERSION="0.25.0";
to fix the install. Right now, I remove the pandas' version check from program's setup.py, which is annoying.The text was updated successfully, but these errors were encountered: