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
mautrix-telegram: patch away alembic dependency #59519
Conversation
As the package maintainer gave a 👍 I guess this should be fine. I'll merge this PR in a week unless there are further comments :) |
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.
I recall reviewing this when it was added to nixpkgs and maybe suggesting something like this being done (or perhaps thought). LGTM.
Perhaps initial-setup should be tested though.
@worldofpeace I have to admit that I didn't read the thread when this was packaged initially, this is actually the result of something I used to have in an overlay in my deployment repo that seemed useful to upstream :)
I actually confirmed that |
I think doing But now I'm thinking, how is a user going to know that they need to use |
Whenever you need
That's indeed a good question. I guess not (atm), but this should be fixable by |
I believe that should be correct. |
`alembic`[1] is a database migration tool which is invoked from the CLI when installing the telegram bridge, but never needed during the runtime. The reason why `alembic` is required here is to ensure that it exists in the Python environment when deploying the bridge. However `alembic` requires `mautrix-telegram` in its environment to create a database schema from the Python models. Such a dependency relation may be possible with tools like virtualenv, however it'll result in an infinite recursion at evaluation time in Nix. With this patch, `mautrix-telegram` doesn't depend on `alembic` anymore and provides a patched alembic (`pkgs.mautrix-telegram.alembic`) which has `mautrix-telegram` in its path. [1] https://alembic.sqlalchemy.org/en/latest/
edfdc23
to
0a94f89
Compare
@worldofpeace ack, fixed :) |
As announced, I'll merge this now. It's been approved by a collaborator and got a thumbs-up from the package maintainer. Also, |
Thanks for being so thorough ✨ |
Motivation for this change
alembic
[1] is a database migration tool which is invoked from the CLIwhen installing the telegram bridge, but never needed during the
runtime.
The reason why
alembic
is required here is to ensure that itexists in the Python environment when deploying the bridge. However
alembic
requiresmautrix-telegram
in its environment to create adatabase schema from the Python models.
Such a dependency relation may be possible with tools like virtualenv,
however it'll result in an infinite recursion at evaluation time in Nix.
With this patch,
mautrix-telegram
doesn't depend onalembic
anymoreand provides a patched alembic (
pkgs.mautrix-telegram.alembic
) whichhas
mautrix-telegram
in its path.[1] https://alembic.sqlalchemy.org/en/latest/
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)