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

MarkMaglanaHi. Sharing my early attempts at using the test harness for feedback. I <3 how it simplifies my unit test drastically! https://github.com/relaxdiego/charm-k8s-grafana/commit/38fa63ad8918d0a178986ccc2032d8999402939204:55
MarkMaglana(Ignore the FrameworkAdapter for now. I'm seeing the light and may soon have no need for it)04:55
MarkMaglanaQuestion: What is the recommended way to get the model name? I've been using `os.environ["JUJU_MODEL_NAME"]` in my code but I suspect that's not the smartest way.05:41
jammorning all06:40
jamMarkMaglana, good to hear you're finding Harness good to use.06:41
jamMarkMaglana, I don't think we currently expose JUJU_MODEL_NAME from the framework. something like self.model.name sounds like the place to put it06:41
jamcan you file a github issue?06:41
jamMarkMaglana, along with your use case as to what you need the model name for06:42
jam(generally charms shouldn't care, but I think for K8s you need it to configure pod names)06:42
MarkMaglana@jam thanks for the reply! yes you got it right, it's for getting the underlying k8s pod's status so i can report its liveness/readiness back to Juju via OF.07:08
MarkMaglanai'll go ahead and file that github issue07:10
MarkMaglana13:41:26 <jam> MarkMaglana, good to hear you're finding Harness good to use. <--- As a friend used to say "the best code is the one I don't have to write!" and I adhere to that where feasible. :-)07:21
jammorning Chipaca08:04
* Chipaca is being phone support rn08:04
Chipacanow yes08:07
Chipacajam: morning! :-)08:07
jamChipaca, how's the new/old laptop treating you? did they fix the issue?08:11
Chipacajam: I haven't been able to get the hard drive back into it yet, they tightened the screws past what my screwdriver could do (have ordered a new one)08:11
Chipacamy T5 head died to bring me this information08:12
jamChipaca, wow, a whole new laptop just for a couple screws :)08:12
jam(ah the joy of english ambiguity)08:12
Chipaca:)08:12
Chipacai probably could've phrased it better (but why would i)08:12
jamyou were perfectly understandable, I just enjoy puns08:13
Chipacaalso, that laptop is coming up for its 3rd anniversary, so shold i really call it 'new'08:13
jammy laptop is now 'bowed' so I'll need to get something new before the next sprint. Whenever we actually meet in person again :)08:15
jamits also fairly old, so I've been wanting to update it anyway08:17
mup_Issue operator#274 opened: Currently no way to get the model name <Created by relaxdiego> <https://github.com/canonical/operator/issues/274>08:18
mup_PR operator#252 closed: ops/testing.py: document Harness in Google style <Created by jameinel> <Merged by jameinel> <https://github.com/canonical/operator/pull/252>08:18
Chipacajam: bowed?08:23
Chipacamakes me think the battery's bulging, but that's probably the wrong meaning08:24
jamChipaca, nope, that's exactly what I mean08:25
Chipacayouch08:25
Chipacayou removed the battery, yes?08:25
jamChipaca, I drained the battery so it isn't powered, but it is a Mac and I don't have the little torx. I need to take it to the shop08:25
Chipacaah. little torxes and the little prying pluck needed, right?08:26
Chipacajam: my old canonical-bought mac laptop developed that, and the shop here swapped the battery for a new one for 50£ IIRC (pre-corona obvs)08:26
Chipacathat first my is about possession, not ownership fwiw08:27
jamyeah, it only really started bowing about 2 weeks ago, and I only use it when traveling so it hasn't been high priority08:27
Chipacajam: i'd be freaking out about it catching fire, but that's probably because everything around me is flammable08:28
Chipacaalso inflammable08:28
jamChipaca, I've been looking at some of the network-get support. It is straightforward to let people do 'pre-canned' responses, but I'd like to actually design something that is better for testing your stuff08:29
Chipacait was the only time i've noticed these houses are basically chimneys filled with kindling08:29
jamshould I start with  the former as I design the latter? or skip it because we don't really want people to have to know the details08:29
jamand/or we should probably talk through what we think are ideals for how people would interact with networking and charm testing.08:30
Chipacajam: the latter sounds more powerful, but the devil is in the details (and schedules)08:30
jamChipaca, indeed.08:30
Chipacajam: want to timebox some design and see where we get?08:31
jamsounds reasonable08:31
facubatistaMuy buenos días a todos!08:31
Chipacawhaaat08:31
Chipacafacubatista: cucha nene08:31
jammorning facubatista08:32
facubatistahola Chipaca, jam :)08:32
Chipacajam: on an unrelated note, did you see my bug+patch to sphinx?08:33
jamChipaca, link?08:34
jambtw, https://github.com/canonical/operator/pull/272 needs your eyeballs08:34
mup_PR #272: ops/charm.py: Update the Docstrings to Google style <Created by jameinel> <https://github.com/canonical/operator/pull/272>08:34
Chipacajam: https://github.com/sphinx-doc/sphinx/pull/765508:34
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>08:34
jamChipaca, ah, so that was doing Optional if you had exactly 1 type and None as the other option?08:36
Chipacajam: it was doing Optional[foo], but not Optional[Union[foo, bar]]08:36
Chipacaie it was doing Union[foo, None] but not Union[foo, bar, None]08:37
jamChipaca, presumably if you did Union[foo, None] it would also translate that to Optional[foo] as well ?08:37
Chipacayep08:37
Chipacajam: btw, compare https://operator-framework.readthedocs.io/en/latest/#ops.testing.Harness and https://operator-framework.readthedocs.io/en/docs-tri/#ops.testing.Harness08:39
facubatistaChipaca, #!/bin/bash -> #!/bin/sh ... I always don't know if (why) it's better to use `sh` there08:39
jamChipaca, i'm a bit surprised to see all Unions end up with Optional08:39
jambut if that is all they track, then I guess08:39
Chipacafacubatista: smaller and faster08:39
Chipacajam: yeah i was surprised as well (but the current Optional becomes Union isn't very good either)08:40
jam'dash' is the current /bin/sh which is Posix compliant, but not Bash compliant08:40
facubatistaChipaca, and for anything not "real command line usage", the same than bash?08:40
facubatistaoh:08:40
facubatista$ ll /bin/sh08:40
facubatistalrwxrwxrwx 1 root root 4 ago 11  2018 /bin/sh -> dash08:40
facubatistanice08:41
Chipacafacubatista: unless you need bash features in your script, then yes08:41
jamhttps://wiki.archlinux.org/index.php/Dash claims it is 4x faster than bash and smaller footprint08:41
Chipacasome things in bash are nice / very convenient08:41
jamit doesn't have support for things like arithmetic in shell IIRC08:41
jamI remember when Ubuntu switched and it broke a lot of scripts that assumed /bin/sh was bash08:41
Chipacaarithmetic yes, that's posix afaik08:41
Chipaca$ sh -c 'echo $((1+1))'08:42
Chipaca208:42
Chipacano $RANDOM though08:42
facubatista$ python3 -c "print(1+1)"08:43
facubatista208:43
facubatista:p08:43
Chipacano brace expansion08:43
Chipacano a..b expansion08:43
facubatistaChipaca, for the docstring, what about "Must override in each command with its respectively core working code."?08:43
Chipacafacubatista: what is 'core working code'?08:43
facubatistaChipaca, *the code* of the command that makes the command do what the command does08:44
facubatistathe rest is just boilerplate to make that code run08:45
jamapt install devtools comes with 'checkbashisms'08:45
jamthough it is written in perl...08:45
Chipacajam: shellcheck will look at the #! line and tell you about them in excruciating detail08:46
jamhttps://mywiki.wooledge.org/Bashism08:47
Chipacafacubatista: how about something more like "this is called to have the command do its work, and should be overridden by the command implementation" or something?08:47
jamkeyword 'function', for loops, extended globs08:48
facubatistaChipaca, I never know the "tone" of the docstrings when "imperative" doesn't fit08:48
Chipacajam: command substitutions also08:49
jamChipaca, https://operator-framework.readthedocs.io/en/latest/#ops.testing.Harness doesn't seem to have a link for the types08:50
Chipacafacubatista: threading.Thread's run method says "Method representing the thread’s activity.\n\nYou may override this method in a subclass. [...]"08:50
jamwith: https://operator-framework.readthedocs.io/en/docs-tri/#ops.testing.Harness I can click to jump to CharmBase08:50
Chipacajam: yep, and latest has the types in the signature which gets messy08:51
jam(and I personally prefer Parameters as a section that doesn't cause the params to indent as far)08:51
facubatistaChipaca, improving also the docstrings of that whole class08:51
Chipacajam: is there anything in docs-tri that's off?08:51
Chipacaor, is there anything in latest that's better than the one in docs-tri08:52
Chipacaturns out it was easy to get rtd to use latest sphinx :-)08:52
jamChipaca, I do find latest harder to read for advanced type signatures, I find it kind of snazzy for simple ones, eg: https://operator-framework.readthedocs.io/en/latest/#ops.testing.Harness.set_leader08:52
jamlatest looks 'more like the source' but definitely Harness.__init__ gets ugly08:53
Chipacayeah, on both points08:53
Chipacai can probably put the types back in the signature, and they might be a bit better than latest08:54
* Chipaca tries08:55
jamChipaca, I'm used to typed languages, so seeing types in my signatures is expected and comforting. I don't know that others feel that way :)08:57
jamI think there are pros and cons of either path. I really like being able to go to the link of "what is this type" so you can figure out how you might want to interact with it.08:58
Chipacajam: setting the type hints back in the signature does not look any better than on 'latest' with the newer sphinx, meaning add_leader looks good but e.g. update_config already looks scary08:59
jamdoes key_values: dict = None give a better result?08:59
jamand List[str] vs Iterable[str]09:00
Chipacajam: also it's not a link in the signature :-/09:00
* Chipaca checks09:00
jamThe goal was to not say "this has to exactly be a list object" but Iterable feels overly abstractd09:00
jamsaying list felt bad when I set it to the empty tuple as the default value :)09:01
jam(cause if you set it to [] then linters complain that you're setting a default to a mutable value)09:01
facubatistaright, don't use [] as default, ever09:02
Chipacasaying list and setting it to default to a tuple would also cheese off mypy09:02
facubatistawell, 99.999% ever :p09:02
* Chipaca was already thinking of counter-arguments to "ever"09:02
facubatistajam, "iterable" is a totally firm thing in Python, sounds good09:03
Chipacajam: no it doesn't look particularly better with List/Dict instead of Iterable/Mapping09:03
jamfacubatista, yeah, I do remember doing it in the past, and using it to populate a dict or something, and then suddenly adding a value here was adding it there too09:03
Chipacastill wraps09:03
facubatistaChipaca, I used {} once in real code :D09:03
Chipacashocking09:03
facubatistabut not as a "default parameter", just a "dict I wanted to have inside the function definition between calls for caching"09:03
Chipacaso, ok, i'll push the change from docs-tri to a pr once again :)09:04
mup_PR operator#275 opened: explicitly ask for a newer sphinx on rtd <Created by chipaca> <https://github.com/canonical/operator/pull/275>09:06
jamChipaca, you asked for it to be merged into docs-tri09:08
jamso it doesn't show any diff and says already merged09:08
Chipacahah09:08
mup_PR operator#275 closed: explicitly ask for a newer sphinx on rtd <Created by chipaca> <Merged by chipaca> <https://github.com/canonical/operator/pull/275>09:08
* Chipaca <~ dumb banana09:08
jamChipaca, you can change the target branch after proposing it09:09
facubatistaChipaca, just pushed the charmcraft branch09:10
facubatistalet's see how travis goes09:10
Chipacajam: docs-tri on rtd now has the charm changes09:11
Chipacaif you're wanting to look at that09:12
Chipacaneed to fix that pr now :)09:12
mup_PR operator#276 opened: explicitly ask for a newer sphinx on rtd <Created by chipaca> <https://github.com/canonical/operator/pull/276>09:14
Chipacamy new T5 arrived! brb09:18
facubatistawee, "a man and a screwdriver", the movie09:26
jamChipaca, that seems very fast09:28
Chipacajam: i'm spoiled, geographically09:33
facubatistaChipaca, more important: were you able to open the laptop?09:40
Chipacafacubatista: yes! uefi's all messed up and my bios has more enterprisey features than when it went off but everything seems ok09:46
facubatistagood09:46
facubatistajam, re #269 ... I understand why calling other_unit.is_leader() is a bad thing, and I think it's better to raise an exception than answering False or None... but if "you should not call is_leader on a different unit", maybe we shouldn't expose it?09:50
mup_Issue #269: Warn that model.unit.is_leader() can raise an exception <Created by timClicks> <https://github.com/canonical/operator/issues/269>09:50
jamfacubatista, that was my point as well, trying to not have the method vs having it but being a runtime error09:51
jambut it means having multiple Unit types one representing *you* and one representing all the other units09:51
facubatistaotoh, it looks weird if Unit (as the object) exposes the method *sometimes*09:51
facubatistajam, thinking out loud, what if we deprecate Unit.is_leader, and we add something `self.is_unit_leader()`?09:52
jamI don't think this is going to be the only thing that you can do on yourself that you couldn't do on another.09:54
jamso I'm not opposed to having a different type for the Unit representing you09:54
facubatistaOTOH, I feel better to do `wrong_unit.is_leader()` and getting SomeError("You're calling is_leader on a different Unit that yours, which doesn't make sense") than a silly AttributeError09:58
facubatistaSo, current solution is the best (TM)10:01
facubatista(maybe we could improve the exception message)10:01
facubatistajam, this is all yours: https://github.com/canonical/charmcraft/pull/110:02
mup_PR charmcraft#1: Draft to show several characteristics <Created by facundobatista> <https://github.com/canonical/charmcraft/pull/1>10:02
jamfacubatista, yeah, I think it is a fair trade for where we are at. AttributeError hints at a programmer error as well to me (and your editor won't try to fill it in for you)10:02
facubatistajam, but AttributeError is obscure, when you have that method in "other" units... like, using it, getting the error, reading it and thinking "mmm... the Unit has not is_leader method???", going to the code, *seeing it*, seeing other code that uses it just fine, etc10:04
facubatistagetting SomeError(VERY_GOOD_EXPLANATION) would totally help10:05
jamyeah, that is what we've been using RuntimeError for, figuring out language that people understand for that is probably the point10:05
facubatistajam, I'd improve the message... "cannot determine leadership status for remote applications" looks like "the process wasn't able to do that at that time"10:07
jaminvalid request: leadership status of remote units is not available10:08
jaminvalid request: you can't do that dave10:08
jamis_leader is only valid for yourself10:08
facubatista"is not available" <-- again, looks like messaging failed or network glitch10:09
facubatistaI'd totally go with "you can't do that dave"10:09
facubatistaand we can have a counter, if you call that more than three times, the exception message turns into Daisy Bell lyrics10:11
jamleadership status of remote units is not visible to other applications10:12
jamleadership status is only visible for your own application10:12
__chip__eeee10:14
__chip__eeeₑₑₑ10:15
__chip__ₔₔₔəəə10:15
__chip__convincing my laptop that I _didn't_ have windows, nor did i want to 'repair' it for the lack, was harder than i expected10:16
__chip__now i need to sync my work back and I'll be set :-D10:17
Chipacaanyway, time for a break10:18
Chipaca__chip__: can i get you a coffee?10:18
__chip__Chipaca: please10:18
jamChipaca, I'll go make one now, come by anytime to pick it up10:18
__chip__jam: 👍10:19
facubatistaChipaca, jam, is the "charm docs daily" currently a thing?10:23
jamfacubatista, it has not been happening but we've been stopping by to check each day10:24
facubatistajam, "polling"10:24
__chip__facubatista: "it's complicated"10:24
* facubatista is complicated10:25
MarkMaglanajam and and __chip__ aren't really in the same house/neighborhood are they?10:33
jamMarkMaglana, __chip__ is Chipaca's other machine10:33
jamand no, we're continents apart10:33
jamhence why I can offer to make as many coffees as I want10:34
jam:)10:34
MarkMaglanalol OK. then can I have a cup as well, pretty please?10:34
__chip__jam: just one10:35
__chip__continent i mean10:35
jamMarkMaglana, happy to10:35
jamI'm going to have a hard time sleeping with all these extra coffees lying around10:36
jamCan't let them go to waste10:36
MarkMaglanamight as well add some cold brew in that mix topped by whole milk foam and some simple syrup.10:38
__chip__dalgona also10:38
jamI have not had dalgona before10:39
jamseems interesting10:39
__chip__what's up with the failures in travis wrt the test main charm?10:40
__chip__jam: we'd have it frequently in high school, before it was called that10:41
__chip__we just called it 'batido'10:41
facubatistaMarkMaglana, each team member is from a different continent :p10:44
jamfacubatista, clearly the next hire should be NZ/Australia so we can maximize our worldwide coverage10:44
facubatistaAntarctica FTW10:45
MarkMaglanafacubatista i'm in one of those southeast asian archipelagoes.10:45
MarkMaglanaarchipelagos? archipelagoes? anyway, group of islands.10:45
facubatista:)10:48
jamfacubatista, but if Antarctica then couldn't they be in *any* TZ ?10:50
jamfacubatista, Chipaca coming along to meet with gnuoy ?11:00
facubatistayes11:01
MarkMaglanajam: When you get the chance, can you shed some light on this thing I'm getting blocked at? I was attempting to remove one of the Grafana charm's delegators as well as the FrameworkAdapter and came across an issue. See commit https://github.com/relaxdiego/charm-k8s-grafana/commit/b689a77cb2714075b2c88e5fe6442e26f1ca033e11:15
facubatistajam, Chipaca, for later: did we consider that saving state in the controller may be expensive? e.g. if the controller is in another DC/cloud11:23
mup_Issue operator#277 opened: Helper library of common operations <Created by stub42> <https://github.com/canonical/operator/issues/277>11:42
__chip__jam, facubatista: i'm going to be 5 minutes12:01
facubatista__chip__, ack, will heat water for the mate, then12:01
jamChipaca, __chip__ still need your eyeballs on https://github.com/canonical/operator/pull/27212:46
mup_PR #272: ops/charm.py: Update the Docstrings to Google style <Created by jameinel> <https://github.com/canonical/operator/pull/272>12:46
mup_Issue operator#278 opened: Unit.status not unit tested <Created by jameinel> <https://github.com/canonical/operator/issues/278>12:50
facubatistajam, I'm failing to relate my blog to apache :/ ... I see that one of the items apache2 provides is:12:55
facubatista  apache-website:12:55
facubatista    interface: apache-website12:55
facubatista    scope: container12:55
facubatistathen, my blog requires:12:55
facubatista  apache:12:55
facubatista    interface: apache-website12:55
facubatista    scope: container12:55
facubatistabut then I get12:56
facubatista$ juju add-relation bdv:apache apache2:apache-website12:56
facubatistaERROR no relations found12:56
jamfacubatista, do you have "subordinate: true" in your metadata.yaml ?12:56
facubatistamaybe I needed to do something different when deploying?12:56
facubatistaoh12:56
jam(I hadn't told you about it because I had forgotten it, but as I'm writing docs I came across it again)12:57
facubatistajam, no problem that you didn't tell me, I'm a little frustrated about not finding this myself in the docs12:57
facubatistaok, upgrade no longer works because I changed the application's subordinacy, let's remove and redeploy12:59
facubatistaah, and then the `juju deploy` sits there in 'waiting' until I relate it to the other app13:02
facubatistait could totally say that in the message13:03
__chip__jam: 272 gtg13:05
jam\o/13:09
mup__PR operator#272 closed: ops/charm.py: Update the Docstrings to Google style <Created by jameinel> <Merged by jameinel> <https://github.com/canonical/operator/pull/272>13:10
=== mup__ is now known as mup_
jamfacubatista, Chipaca does typing have a type like Optional but meaning "you *can* set this, but you really shouldn't"? :)13:28
facubatistajam, I've been checking its docs, after you used it... it looks is an explicit way that you can use that, or the default... IOW:13:29
facubatistaif you do    def foobar(foo: Optional(int) = None):13:29
facubatistafoo is optional, yes, as it has a default13:29
facubatistabut the Optional would mean that you can actually pass an int, and you can even pass None!13:30
facubatistawithout the optional, at typing level, you could pass an int or nothing13:30
facubatistathat is what I understood from reading a little the docs, never really tried it13:30
jamfacubatista, standup?13:31
mup_PR operator#279 opened: ops/model.py: Document public methods and types <Created by jameinel> <https://github.com/canonical/operator/pull/279>13:32
jamChipaca, pip3 install --upgrade --user flake8 made it fail for me, but because there is a new pycodestyle which "has no attribute 'break_around_binary_operator'"14:14
jampip3 freeze our deps :)14:15
jamugh, it seems flake8 had a long standing pycodestyle <2.4.0 but tip of flake8 says 2.6.0 but doesn't actually work with it?14:18
jamso test suite passes if I do: pip3 install --upgrade --user flake8==3.7.* autopep8 pycodestyle==2.5.* mccabe pyflakes==2.1.*14:22
jamit fails to run with flake8==3.8.* which needs pycodestyle 2.6.0 but doesn't actually work with it AFAICT14:22
jam(in neither case does it cause E402 errors, which is what we see on Travis)14:23
__chip__newsflash: ops doesn't work with python 214:39
* __chip__ glares at his new venv14:40
__chip__jam: was the problem with the doc of RelationData that things like :class:Application weren't getting rendered correctly?14:42
__chip__jam: what category in the discourse shold the readme point to?15:28
__chip__/c/charming?15:28
__chip__i'm also going to point at /c/docs/operator-framework15:28
jam__chip__, the issue is that RelationData's docstring was completely absent15:28
jamI was trying to figure out if :class:Application worked or if you need :class:`ApplicationData`15:28
__chip__jam: i'm not seeing that, fwiw, with either version of sphinx here15:29
jambut it didn't render anything or complain15:29
__chip__jam: without the `s it doesn't render it as a link (so it outputs the string verbatim)15:29
__chip__including the :class:15:29
__chip__jam: but again, that's here where it is rendering :)15:29
__chip__strange that there it isn't15:30
__chip__i built a new env to see if i had anything left over that would be doing it, and no15:30
__chip__and i tried with both sphines in a new env each time, also no15:30
jam__chip__, https://imgur.com/U4WQcvp15:30
__chip__no == it did render, i mean15:30
__chip__jam: that looks like you're not picking up the :members:15:31
__chip__jam: ie the defaults from docs/conf.py15:31
jam__chip__, so it is because I was looking at context.html which was renamed to index.html, but index.html isn't getting the right theme (from what I can tell), so I thought it was the wrong dok15:33
jamdoc15:33
jam__chip__, wiping out the dir and recreating it revealed the wrong html file15:34
__chip__jam: the default theme will be different in the local build, it'll be a very spartan thing now rather than the green friendly one15:34
jamright, that's what I'm seeing, but at least I'm seeing the fields I added :)15:34
__chip__I could explicitly say 'use the tbd theme' but that's an extra requirement15:34
__chip__rtd*15:34
__chip__the rtd theme is bigger than sphinx :-D15:35
__chip__jam: did you see my question about the discourse?15:36
__chip__(while i have you here :)15:37
jam__chip__, So your request for ``{name: stuff}`` means that links don't work. eg: {relation_name: [ :class:`Relation` ]}15:38
jamfor discourse...15:38
__chip__jam: ah. ufa.15:38
jamI think timclicks wants us to use https://discourse.juju.is/c/charming15:38
jam__chip__, ufa ?15:39
__chip__jam: "rats"15:39
__chip__as an interjection i mean15:40
jam__chip__, I'm happy for whatever rendering we like for it. I don't have to have links, but I do kind of like the cross reference15:40
__chip__me too15:40
__chip__indeed i like it a little more than i want code to look like code, in small snippets at least15:40
jamIt seems to help the "what is this thing, oh that's what it is, what can I do with it" in a nice way15:41
* __chip__ nods15:41
jamI can say "map of foo => :class:`Bar`" if you don't want it to look so much like code15:41
jamIt is a pattern I use a lot because we have a lot of maps in our structs15:42
jamclasses even15:42
__chip__maybe working into a sentence is better15:42
__chip__as in "a map of foo to :class:`Bar`" or sth15:43
__chip__dunno15:43
__chip__jam: i can confirm that setting html_theme to 'sphinx_rtd_theme' renders things almost exactly like on rtd15:44
jam__chip__, I'll try out the sentence structure.15:45
jamI think the big thing was realizing that index was, indeed, the correct rendering, and not a mistake15:45
jamI can live with it15:45
__chip__ok15:46
__chip__i can add it to docs/requirements and make it explicit, should help us when we start tweaking the theme15:46
__chip__pushed that15:48
__chip__facubatista: dev-requirements.txt, or requirements-dev.txt? i know we had this discussion before but don't remember the outcome15:49
facubatista__chip__, I prefer requirements-dev.txt, as you locate it more easily when listing the directory15:49
jam__chip__, do you know why https://github.com/canonical/operator/pull/276/files looks like it is r15:49
mup_PR #276: explicitly ask for a newer sphinx on rtd <Created by chipaca> <https://github.com/canonical/operator/pull/276>15:49
jambringing in my charm.py changes?15:49
facubatista__chip__, btw, are you working on that? I am15:50
__chip__jam: i don't, i probably need to rebase or something15:50
__chip__jam: i'll clean it up before my eod15:50
jam__chip__, I also prefer requirements-dev because of sorting15:50
__chip__facubatista: i am not, but i'm updating the README that assumes it's done :-D15:50
__chip__jam: facubatista: fffantastic15:51
facubatista__chip__, ack15:51
__chip__jam: it seems happier now (all i did was rebase to master)15:56
mup_PR operator#280 opened: Included the dependencies in requirements files, updated README and .travis <Created by facundobatista> <https://github.com/canonical/operator/pull/280>15:56
facubatista__chip__, ^15:56
jam__chip__, my guess is that the land-with-squashing is causing one of your patches to look like an additional change15:56
__chip__facubatista: wouldn't it be enough to say ==5.3.*?15:56
facubatista__chip__, I don't know, are you sure they use 100% semver?15:57
__chip__facubatista: I am 3.75% sure about absolutely everything15:59
__chip__but it adds up in weird ways15:59
facubatista__chip__, +/- ?16:00
__chip__516:00
facubatista:)16:00
karimsyedid you guys read this - https://discourse.juju.is/t/experimental-new-feature-k8s-charms-as-operators/284916:23
karimsyedoes it support/conflict with anything you guys have planned?16:24
karimsyeI am guessing I can still use the operator framework to do things like read models,units,applications states and their config16:29
facubatistakarimsye, thanks, will read16:31
__chip__karimsye: it neither supports nor conflicts with what we have planned so far, and we don't currently have concrete plans to really support that feature16:31
karimsyefacubatista: thanks16:31
__chip__karimsye: but we do have a blanket 'make things better' for juju on k8s, which might include this (or other work) as juju changes16:32
__chip__facubatista: i think i saw you say something about having a signature like foo(n: Optional[int] = None)16:49
__chip__facubatista: if i understood you correctly, you were further saying that   foo(n: int = None)  was OK as well?16:51
facubatista__chip__, today, 10:29.ar16:51
__chip__facubatista: yeah, i'm asking if that second part was what you meant to say16:52
facubatistaIIUC, foo(n: int = None) means that if you pass a parameter, it must be an int (you may not pass it)16:52
__chip__foo(n: int = None)  is wrong16:52
__chip__because n = None can't be done if n is int16:52
facubatistaaccording to whom?16:53
__chip__hmm16:53
__chip__hold on maybe i misunderstood16:53
__chip__i was sure i had run this past mypy and it had complained16:54
__chip__gasp16:54
__chip__mypy is now saying that Optional happens automatically16:54
__chip__look:16:55
__chip__given def foo(n: int = None) -> int:16:55
facubatista__chip__, https://paste.ubuntu.com/p/pJHQGvttyy/ ?16:55
__chip__    return 2*n16:55
* __chip__ looks16:55
__chip__tal cual16:55
__chip__but now change it to → int and return 2*n16:55
__chip__it looks like this only works with None, you can't do shenanigans like foo(n: int = 'hello')16:56
__chip__but for =None, it automatically makes it Optional16:57
__chip__that's Neat16:57
__chip__this is new, or when i tested i bungled the test :)16:57
facubatista__chip__, the problem is the value in multiplication, not the signature16:57
__chip__facubatista: yes but that's where you see that it's promoted the n to Optional16:57
__chip__it says the operand is of type "Optional[int]"16:57
facubatista__chip__, this is fine: https://paste.ubuntu.com/p/vtcgXWNhG7/16:57
__chip__yep16:58
__chip__so maybe we can do without those Optionals in our annotations16:58
__chip__i'll give it a pass over later16:58
__chip__right now i need to soft-eod and go for a short run and make dinner16:58
facubatista__chip__, it looks Optional is now optional :p17:00
facubatista__chip__, see https://paste.ubuntu.com/p/8bmYJSxY79/17:00
__chip__facubatista: or is it that optional is Optional17:00
facubatistaas it's "optional at Python level", it just does the right thing (tm)17:00
__chip__facubatista: but, again, only if None afaict17:01
facubatista__chip__, see `bar` in my last pastebin17:01
__chip__facubatista: and def foo(n: typing.Union[str, int] = None) -> int: return 2*n    and you see that it's promoting the Union to Optional, and then the stringify of that optional union has the same issue as it does in sphinx17:02
__chip__facubatista: there's no promotion there17:02
__chip__typing.Optional just means "it can also be None"17:03
__chip__because typing.Optional[SomeType] is just typing.Union[SomeType, NoneType]17:03
facubatista__chip__, I don't care about that special case, as everything else seems to work just fine without using Optional17:03
__chip__k17:04
facubatista__chip__, I mean17:04
__chip__anyway, soft-eod for me17:04
facubatista__chip__, it looks everything "is just fine" without using Optional at all17:04
__chip__afaict yes17:04
__chip__i'm going to try (later) and see what breaks if anything :)17:04
__chip__oh rats, https://github.com/sphinx-doc/sphinx/pull/729817:10
mup_PR sphinx-doc/sphinx#7298: py domain: Add py:property directive to describe a property (refs: #7068) <domains:py> <enhancement> <refactoring> <Created by tk0miya> <https://github.com/sphinx-doc/sphinx/pull/7298>17:10
__chip__we're going to get into trouble with descriptors17:10
__chip__with both mypy and sphinx17:10
__chip__afaict17:10
__chip__booo17:10
__chip__ANYWAY I WAS SUPPOSED TO BE GONE17:10
* facubatista bb~1h17:23
* facubatista didn't go :p17:29
* facubatista bb~1h for real now17:51
* facubatista is back19:12
=== mup__ is now known as mup_
__chip__ok, i'm out21:04
__chip__facubatista: amañá!21:04
facubatista__chip__, chaus21:04
__chip__facubatista: i lied!21:21
__chip__muahahaha21:21
facubatistajajaja21:21
__chip__facubatista: could you review #281?21:21
mup_PR #281: make flake8 happy again <Created by chipaca> <https://github.com/canonical/operator/pull/281>21:21
mup_PR operator#281 opened: make flake8 happy again <Created by chipaca> <https://github.com/canonical/operator/pull/281>21:22
__chip__facubatista: both you and jаm have (i think?) written the same thing but mixed up with other stuff21:22
facubatista__chip__, indeed; there +1'ed it21:23
__chip__facubatista: thank you for buying the conflict :-)21:23
* __chip__ pokes travis21:24
facubatista:)21:26
mup_PR operator#281 closed: make flake8 happy again <Created by chipaca> <Merged by chipaca> <https://github.com/canonical/operator/pull/281>21:26
__chip__facubatista: anything i can review for you?21:30
facubatista__chip__, I lost track, tomorrow need to do a pass on everything21:30
facubatistaI think I have feedback on everything, though21:31
__chip__facubatista: ok21:31
__chip__facubatista: you've also been here since forever21:31
__chip__almost as long as me (but i went off and had dinner and watched some netflix)21:31
facubatista__chip__, I took a nap :)21:31
__chip__facubatista: ah, good :)21:31
* facubatista is not 25 since a long time ago21:31
__chip__facubatista: i can resolve that conflict for you if you want21:49
__chip__s/if you want/if you don't mind/21:49
facubatista__chip__, no worries, I will work it out tomorrow22:03
__chip__grrr, squash merge i hate you so much22:06
__chip__"i've seen this change before, let me just search for the commit hash"22:06
__chip__hahaha nope22:06
facubatista__chip__, we can stop squashing22:08
* facubatista hates squashing, it's human solution to a technical problem22:08
* __chip__ likes butternut squash22:09
* __chip__ zzzs22:18

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