-
Notifications
You must be signed in to change notification settings - Fork 122
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
docs: add instructions on how to use a custom version of ops in a Charm #1092
docs: add instructions on how to use a custom version of ops in a Charm #1092
Conversation
…d run that on a custom version of Juju.
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.
Excellent idea to include this!
Trivial issue with mismatched braces, and a question about the #egg=ops
syntax.
HACKING.md
Outdated
|
||
``` | ||
#ops ~= 2.9 | ||
git+https://github.com/{your-username}}/operator@{your-branch-name}} |
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.
There are mismatched braces here.
Also, do we need the #egg=ops
thing at the end of the line here? I have always used it, but maybe it's not needed?
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.
There are mismatched braces here.
Thanks, fixed!
Also, do we need the
#egg=ops
thing at the end of the line here? I have always used it, but maybe it's not needed?
Hmm, the plain version definitely works for me. But good call, I checked the docs:
pip also looks at the egg fragment specifying the “project name”. In practice the egg fragment is only required to help pip determine the VCS clone location in editable mode. In all other circumstances, the egg fragment is not necessary and its use is discouraged.
So since editable mode isn't relevant here, I believe the #egg=
should not be included.
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, good to know.
Merged without further review, as this is a doc-only change. @tmihoc if you have further suggestions, let us know and we can always tweak later. |
Figuring out how to test changes to
ops
locally (without just monkeypatching everything) wasn't straightforward when I started - this should make it easier for new people going forward.I've included two variants:
charmcraft.yaml
file makegit
available and use standard Python dependency specification.pip
, then editing the.charm
zip file is probably simplest - I've included @benhoyt'sinject-ops.sh
script to make it easy for people.I've also added a small note about running in custom Juju versions, since that was something I had to learn today and seems like it might also come up for other people working on
ops
.