/srv/irclogs.ubuntu.com/2020/05/11/#smooth-operator.txt

jammorning all05:37
mup_Issue operator#269 opened: Warn that model.unit.is_leader() can raise an exception <Created by timClicks> <https://github.com/canonical/operator/issues/269>07:57
Chipacamorning!08:02
mup_PR operator#218 closed: Add relation-created events <Created by dshcherb> <Closed by jameinel> <https://github.com/canonical/operator/pull/218>08:36
mup_PR operator#259 closed: Relation created event <Created by jameinel> <Merged by jameinel> <https://github.com/canonical/operator/pull/259>08:36
Chipacajam: I'm going to create a separate 'docs' branch on github to debug the rtd, then propose a pr from that08:40
jamChipaca, sounds good to me. The RTD docs that I saw linked over the weekend seemed to be missing all the actual *content* :)08:40
Chipacajam: yeah, not sure what i broke :-(08:41
jamChipaca, for user facing docs, I'm looking to remove __init__ comments and move them into class docstrings08:44
jamChipaca, do you have a preference on type annotations between typing.Mapping and 'dict' ?08:45
jamChipaca, the HTML title for https://www.sphinx-doc.org/en/master/ seems to say 4.0.0+ but pypi is 3.0.3 and you're saying that stable is <2 ?08:46
Chipacajam: wrt typing.Mapping and dict, I'd go with dict for now for brevity08:49
jamChipaca, for the class docstring, it feels a little weird because you want to document how to use the class as well as how to construct it, and the former is 'variables' while the latter is 'args'.08:49
Chipacajam: sphinx-doc.org/en/stable is 1.8 yes08:49
jamChipaca, that specific link takes me to en/master08:50
Chipacaer08:50
Chipacajam: https://www.sphinx-doc.org/en/stable/usage/configuration.html08:50
jamah, www matters08:50
Chipacaor maybe the deep link vs directory? dunno08:51
Chipacajam: tbh my first reaction was 'why on earth are you getting sphinx<2', noticing it's what's tagged stable came later08:51
jam:)08:52
jamChipaca, type annotations seem to poke at the 'recursive import' problem.08:52
Chipacai haven't asked my friend on the inside as to whether there's a way to change that (it doesn't seem to be documented that you can)08:52
jamsorry, circular import problem08:52
Chipacajam: using strings instead of obects doesn't help in that case?08:53
jamChipaca, I didn't know you could08:53
Chipacajam: i'm not sure it helps, i'm asking :) it's there for things like class C taking a D and class D taking a C08:54
jamChipaca, https://www.python.org/dev/peps/pep-0563/08:54
Chipacabut not sure it copes with imports08:54
jamand reading through https://stackoverflow.com/questions/39740632/python-type-hinting-without-cyclic-imports08:54
jamwhich seems to say you can use 'if TYPE_CHECKING' to pre-import stuff08:54
jamChipaca, from __future__ import annotations changes all type annotations to strings08:55
jambut only works for py 3.7??08:55
Chipacajam: note that PEP is 3.7+08:55
Chipacayeh08:55
jamI also don't know if I strictly cannot do what I want, I just noted that as I was trying to add a type annotation I was going to have to add an import just to satisfy that which felt like I was going to quickly run into circular imports08:58
jamChipaca, I'm not a big fan that Optional gets remapped to Union[...,None]09:06
Chipacajam: yeah i get why but i wish it had its own stringify09:07
jambecause a default value might not be None, and loses the human message of what Optional is for09:07
Chipacayep09:14
Chipacaaha! found the issue :)09:23
Chipacajam: https://operator-framework.readthedocs.io/en/docs-tri/09:41
jamChipaca, is that your recommended theme ?09:43
jamit generally looks like the content is there09:43
Chipacajam: that's the default rtd theme09:43
Chipacajam: which has a few nice features (like the 'edit on github' button)09:44
Chipacajam: I don't know if it's enough to make type annotations work. They _should_ but i haven't tested.09:45
Chipacai'll propose these changes into master now09:45
mup_PR operator#270 opened: docs: more tweaks so everything works on RTD <Created by chipaca> <https://github.com/canonical/operator/pull/270>09:47
Chipacaeeee, my laptop got back09:48
* Chipaca gets coffee09:49
mup_Issue operator#271 opened: Relation.role should be 'peer' not 'peers' <Created by jameinel> <https://github.com/canonical/operator/issues/271>10:26
Chipacajam: "raises" is also interesting in that list10:45
Chipaca'that list' being the one in napoleon/docstring.py:14210:46
jamChipaca, yeah. raises I think I used in one place for Harness10:48
Chipaca:+1:10:51
facubatistaMuy buenos días a todos!10:55
Chipacafacubatista: o/!11:00
Chipacafacubatista: just in time :-D11:00
Chipacanot sure why i thought you weren't coming to this one11:00
vgrevtsevhi team, a question: is there any example of using a new `dispatch` hook within the charms? the only reference I found was in the juju source code itself, which is better than nothing, but maybe someone have an example handy?11:53
Chipacavgrevtsev: right now, all you do is symlink 'dispatch' to the main charm python file and that's it11:54
Chipacavgrevtsev: and if you don't care about pre-dispatch jujus, you don't need hooks/ at all11:55
vgrevtsevhm, so it won't make any difference in the charm behaviour atm then?12:00
vgrevtsevdo you know where can I get more information about the dispatch hook, is it somewhere available or it's kind of hidden knowledge? :) https://discourse.juju.is/t/charm-hooks/1040 there's no info yet...12:02
jamChipaca, for now I added it as a URL in the description, I didn't see a way to have it as a more concrete object12:10
Chipacavgrevtsev: you calling it a 'dispatch hook' makes me think you're misuinderstanding it12:10
Chipacavgrevtsev: it's not a hook12:10
Chipacavgrevtsev: it's a way of dispatching hooks12:10
Chipacavgrevtsev: mostly it should be invisible to charm developers12:10
vgrevtsevChipaca: probably, will be happyto learn what's it is in reality! I'm kinda new to the things so I'm sorry for a stupid questions :)12:11
Chipacavgrevtsev: that is, today in juju the way it handles say an 'install' hook is by looking for hooks/install12:11
Chipacavgrevtsev: once 2.8 is out it'll look for 'dispatch', and if that exists it'll run it instead of hooks/install, telling it 'yeah please run the install hook'12:12
Chipacavgrevtsev: that's all it is12:12
vgrevtsevok, got it12:12
vgrevtsevso, the new framework already supports this way of dispatching the hooks?12:12
Chipacavgrevtsev: there is an initial implementation of support for it, and we'll be improving it with time, but yes12:13
Chipacavgrevtsev: right now it supports a dispatch that's a symlink to the charm code12:13
Chipacalater we'll support some other scenarios :)12:13
mup_PR operator#272 opened: ops/charm.py: Update the Docstrings to Google style <Created by jameinel> <https://github.com/canonical/operator/pull/272>12:13
Chipacafacubatista: plz can i have review of #270? (or i could just land it if you're busy(12:14
mup_PR #270: docs: more tweaks so everything works on RTD <Created by chipaca> <https://github.com/canonical/operator/pull/270>12:14
Chipaca))12:14
* Chipaca ~> lunch12:15
facubatistaChipaca, meeting?12:31
Chipacayes12:31
karimsyemissing a link to the google meeting13:00
facubatistaindeed, I was about to say that13:01
Chipacakarimsye, jam, facubatista, added meet link13:02
* facubatista brb13:32
Chipacalaptop is indeed back, but i can't get the hardrive back into it because they've tightened the t5 screws harder than my screwdriver can handle :-(13:46
Chipacaso i've got a nice paperweight until i get a new screwdriver13:46
mup_PR operator#270 closed: docs: more tweaks so everything works on RTD <Created by chipaca> <Merged by chipaca> <https://github.com/canonical/operator/pull/270>13:47
mthaddonjam: is it worth t0mb0 investigating the "defer events stacking up" issue given our discussions earlier today, or is it no longer worth him doing that at this point? (I think he was planning to do this on Wednesday)13:47
Chipacamthaddon: I'd like to know what it was you were seeing, fwiw13:50
mthaddonChipaca: ack, thx13:51
jammthaddon, at the very least it would be good to confirm that my prediction is accurate13:51
* mthaddon nods13:51
jamChipaca, my working guess is that it is the 'same hook' that happens multiple times, and all of those instances of 'config-changed' end up as events in a queue13:51
Chipacajam: but why would that have trouble in a low memory deploy13:55
Chipacathat's what i'd like to figure out (and potentially fix)13:55
jamChipaca, I don't see how it has memory consequences as much as having "I've defered config-changed 10 times and now I get them all one-after-another"13:56
jam(defering config-changed never sounds like the right thing to do, because if the config is wrong, you have to wait until you get a new config-changed telling you that it might be correct now)13:56
Chipacajam: right, but IIUC there were memory issues13:56
jamChipaca, right, if that's true, then we definitely want to understand why13:57
facubatistaChipaca, do you have some WD40?14:00
facubatistajam, if I set manually the state to "maintenance" while installing some stuff, shall I manually set it out of that when finish? or that should happen automatically as the install hook ended fine?14:09
jamfacubatista, Juju won't change states for you, as the state might span multiple hooks14:09
jamChipaca, #252  would appreciate your approval14:10
mup_PR #252: ops/testing.py: document Harness in Google style <Created by jameinel> <https://github.com/canonical/operator/pull/252>14:10
facubatistajam, ack, thanks14:10
Chipacajam: #252 GTG14:46
mup_PR #252: ops/testing.py: document Harness in Google style <Created by jameinel> <https://github.com/canonical/operator/pull/252>14:46
Chipacajam: https://pastebin.ubuntu.com/p/mRZKVKV4Gc/ :-(15:30
* facubatista -> lunch15:32
* facubatista is back16:16
Chipacahttps://github.com/sphinx-doc/sphinx/pull/7655 (fingers crossed)16:28
mup_PR sphinx-doc/sphinx#7655: Make sphinx.util.typing.stringify render optional unions better <Created by chipaca> <https://github.com/sphinx-doc/sphinx/pull/7655>16:29
* Chipaca steps away for dinner & etc17:05
* facubatista brb18:51
Chipacafacubatista: can you s/charm/charmcraft/ in charmcraft#1?20:02
facubatistaChipaca, ah, the name of the tool in argparse?20:04
Chipacafacubatista: and the files and the readme20:04
facubatistaah20:05
facubatistaChipaca, pushed20:18
Chipacafacubatista: +1 with some non-blocking nits21:02
facubatistaChipaca, thanks21:02
Chipacafacubatista: next time you push a commit to that pr it should trigger travis21:02
facubatistaChipaca, awesome21:02
mup_PR operator#273 opened: Moved create_model and create_framework from framework tests to a factory helper <Created by facundobatista> <https://github.com/canonical/operator/pull/273>22:29

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!