Skip to content

Provide version fallback in case scm fails to infer version during installation #524

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

Merged
merged 1 commit into from
Apr 1, 2025

Conversation

dasmy
Copy link
Contributor

@dasmy dasmy commented Apr 1, 2025

Fix installation if setuptools-scm version inference fails.

In the specific case, baybe was installed format the git repository inside a docker container that did not provide the git command, leading setuptools-scm to fail. Same happens if for any reason the .git directory is missing (e.g. when downloading a tarbal from github).

The fallback version is set to 0.0+unknown to ensure we adhere to PyPa (https://packaging.python.org/en/latest/specifications/version-specifiers/#examples-of-compliant-version-schemes) while still ensuring any user will be able to recognize this as a non-standard version identifier.

Fixes #521

@dasmy
Copy link
Contributor Author

dasmy commented Apr 1, 2025

While I am at it - any hints on how to fix the Lockfiles-CI failure?

In the specific case, baybe was installed format
the git repository inside a docker container that
did not provide the ` git` command, leading
setuptools-scm to fail. Same happens if for
any reason the .git directory is missing (e.g.
when downloading a tarbal from github).

The fallback version is set to `0.0+unknown` to
ensure we adhere to PyPa (https://packaging.python.org/en/latest/specifications/version-specifiers/#examples-of-compliant-version-schemes
) while still ensuring any user will be able to
recognize this as a non-standard version
identifier.
@dasmy dasmy changed the title Fix installation from git inside Docker containers where git is not installed Provide version fallback in case scm fails to infer version during installation Apr 1, 2025
@AdrianSosic
Copy link
Collaborator

While I am at it - any hints on how to fix the Lockfiles-CI failure?

All good, you can ignore those. The LinAlgErrors keep sporadically showing up, we haven't found a reasonable fix yet. The lockfiles fail is just reminder to relock files in case dependencies have changed (is triggered whenever toml is touched – not ideal yet but fulfills its purpose)

@AdrianSosic AdrianSosic merged commit d8259ce into main Apr 1, 2025
9 of 12 checks passed
@AdrianSosic AdrianSosic deleted the fix/521 branch April 1, 2025 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants