-
Notifications
You must be signed in to change notification settings - Fork 31
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
Git versioning and modern packaging #1065
Conversation
CI failure is macos only – no idea what's going on there. |
@kba I resolved the conflict by keeping an empty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for preparing this, I've now finally tested it, esp. love the version-from-git-tag mechanic.
Everything works fine except make install-dev
. If I try pip install -e
in ocrd_models, I get an error like
setuptools.extern.packaging._tokenizer.ParserSyntaxError: Expected end or semicolon (after version specifier)
ocrd_utils == 2.59.2.dev7+g9fbddff75.d20231214 == 2.59.2.dev7+g9fbddff75.d20231214
I think the issue is that finalize_options is called twice, I don't know why but this simple workaround fixes it for me:
-self.distribution.install_requires = [
- req + vers if req.startswith('ocrd') else req
- for req in self.distribution.install_requires
-]
+self.distribution.install_requires = [
+ req + vers if req.startswith('ocrd') and '==' not in req else req
+ for req in self.distribution.install_requires
+]
If that's okay with you, I'll commit that and we can merge this before the next release.
BTW: Do you think there's a way to have a single place to define the build
class and import it in the setup.py
s? Not a big issue since I don't expect us to have to change setup.py
anymore in the future, but it would be neat.
Very strange. I don't recall seeing that – perhaps it's one of the recent setuptools changes...
Sure, sounds reasonable – please go ahead.
I did think about inheriting this, but gave up quickly IIRC. |
OK, added the fix, now everything seems in order. I'll merge and release tomorrow. |
macos still fails but I'll debug that separately. |
This brings our packaging up to speed, including our surprisingly challenging case of mutually pinned "sub-distributions". I had to comment out the actual requirement ocrd → ocrd_network to break a dependency circle, which is nececssary because otherwise pip goes completely crazy and downloads some arbitrary other versions and then complains of broken requirements. I also improved the makefile.