-
Notifications
You must be signed in to change notification settings - Fork 33
switch to a file source for the version instead of setuptools_scm #1165
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
Conversation
|
Sorry to hear that. Since I did not see the issues firsthand, please convince me some more:
You mean for the Github release assets? But couldn't we just change the GH workflow to provide true sdists (and/or wheels) for each package? Also, we could simply configure a Moreover, for the GH release asset zip, we could try to bake in the envvar
AFAIK the build requirements are never in the venv, and they are usually fetched from the remote package index during build. Could you show me the concrete error message you got because of that? |
|
Oh, and if we do switch back to file-based, then I believe the VERSION file (or symlink) needs to be in the manifests. |
https://github.com/tboenig/gt_structure_text/actions/runs/7450175483/job/20268478771 here the system-wide old setuptools version is used. This has since been solved with a venv. |
already gone.
ok, so system pip/setuptools did not even bother to fetch the update? perhaps we need the
|
I think the repo is private - @tboenig can you make public or invite @bertsky?
I think so. But to be honest, I dont' trust that we can find a setup that reliably installs the right build environment for all combinations of python/pip/setuptools out there. But the approach here with the symlink also does not work.
And all of this trouble just for consistent versions across the packages :( Some (more or less radical) ideas:
|
I did mention this above. And your local 3.7 / 3.8 failure, did that have the VERSION in the manifest already? BTW, the setuptools_scm solution also has another pitfall: it requires you to also git-fetch the tags, which I often forget.
Like ocrd_all's Ok, but then we might as well have a git-controlled
Yes, it (surprisingly) is a non-standard configuration to have multiple version-synced packages in one repo. But changing the package names would be a major break – isn't it a bit late to do that now? |
I tried both with and without
Exactly, that's what that script would do: new_version=$1
for pkg in ocrd ocrd_utils...;do
echo $new_version > $pkg/VERSION
done
git add **/VERSION
git commit -m ":package: $new_version"
git tag v$new_versionsomething along those lines
We would not change the package names, just combine them all into a single dist It is still a breaking change of course but considering we need to streamline OCR-D as much as possible to make life easier for future maintainers, might be worth it. But users would not need to change any of the code, just require I made a quick draft of how this could work in #1166. |
I just took a cursory look: so far, the following packages require other subpackages (besides or in lieu of
That's not just my local installation, but also what PyPI seems to see as reverse dependencies. Obviously, I can quickly adapt them. |
Agreed. |
When switching to
pyproject.tomlin #1065 we also started usingsetuptools_scmwhich sets the version of theocrd/ocrd_*packages to the latest git tag or a derivative of it for intermediate versions.That is a very neat solution and really helpful for debugging but it has two drawbacks:
.gitto be present as either a directory or a reference to the module directory of the containing repo if a submodule. For non-git checkouts (e.g. when downloading the release tarball),make installdoes not worksetuptools_scmrequiressetuptools>=61which is too new for most recent Ubuntu/Debian releases (Ubuntu 20.04: 44, Ubuntu 22.04: 59, Debian 11: 52, Debian 10: 40). While we obviously strongly recommend installing to a venv, it should be possible in a 22.04 container (such as a GH Action) to clone core and runmake installwithout a venv.So I think the neatness of
setuptools_scmis not worth the problems it brings.Instead, in this PR, we add a file
/VERSIONwith symlinks to that file in the package directories and configure setuptools to look for the version in that file.This means that for every release, we need to manually update the version in
/VERSIONandgit tagaccordingly but that is basically what we've been doing for years, so it really is not much of a change.However, I'm not sure whether my solution is ideal, so if you have any other ideas on how to have a single source of version information for multiple packages, without resorting to a full-fledged monorepo solution, I'd be happy to hear.