[03:00] Issue operator#303 opened: ints in pod spec somehw become scientific notation [03:12] hi there. [10:44] anybody with a python 3.7 around? [11:30] Muy buenos días a todos! [11:31] Chipaca, I can prepare a docker with it, what do you want to test? [11:31] facubatista: nah, just to be precise in a comment [11:31] facubatista: good morning to you too! [11:31] ok [11:31] :) [11:32] facubatista: i started playing with getting an ops version in there [11:32] I've brought my release day clothes today! [11:32] and went down a bit of a rabbit hole [11:32] facubatista: excellent! [11:32] facubatista: I'm stopping for lunch in 30' but things are looking good [11:33] Chipaca, "getting an ops version in py 3.7"? not sure what that means [11:33] facubatista: i wrote this thing, that i'm backing out for now but will push for early 0.7 [11:34] facubatista: https://paste.ubuntu.com/p/PBS2TQxVrg/ [11:34] facubatista: sorry, the 3.7 was not directly connected to 3.7 [11:35] facubatista: just that in 3.5 and 3.6 ast.parse('"42"').body[0].value is ast.Str, and in 3.8 it's ast.Constant [11:35] facubatista: and so I added if isinstance() with a comment # >= 3.8 [11:36] Chipaca, ah! I got master(ish), it could be of use [11:36] facubatista: i wanted to check if that was accurate, or if the change was in 3.7 already [11:36] ah, understand [11:36] facubatista: the documentation is a tiny bit unclear on this; it's been a transition that happened between 3.5 and 3.8 :) [11:37] facubatista: in 3.8 ast.Constant was used for 'all constants', and ast.Str is deprecated, but it's been a transition [11:37] facubatista: it's not super important :-) [11:37] nobody uses 3.7 anyway :-p [11:37] jajaja [11:37] probably true [11:38] facubatista: and all this is because we can't import ops to get ops.__version__ because yaml [11:38] (boo hiss etc) [11:39] Chipaca, which is what normally happens [11:39] facubatista: so i wrote some code :-) [11:39] facubatista: https://paste.ubuntu.com/p/x7kTxBPDwK/ [11:43] Chipaca, I get it; my solution (in charcramft early version) was way less elegant, but didn't depend on internals, so it's more robust to be executed later in the wild (it's more fragile in the sense that we may break it changing some code, but that would be catched by the test) [11:43] Issue operator#304 opened: Use git describe to log version when running from git [11:46] facubatista: which internals? [11:50] PR operator#305 opened: Tweaks to the README, setup.py, etc, for release [11:50] facubatista: ^ [11:50] Chipaca, "internals" -> ast nodes [11:51] Chipaca, on the PR [12:13] Chipaca, reviewed [12:50] facubatista: picky, picky [12:51] facubatista: hmm, with '.' in reqs 'pip install -r reqs' installs ops, which might be surprising; wdyt? [12:52] Chipaca, yes, you do not want that [12:52] ok, i'll revert [12:52] facubatista: wdyt of making install_requires load requirements.txt? [12:53] as this is a lib, +1 [12:58] facubatista: hm, the internet seems to think we're using reqs wrong :) [12:59] Chipaca, we're stretching it, requirements.txt is normally used to "run" something; this is a pure lib, you don't "run" it [13:00] Chipaca, you normally install it, and with install_requires in setup.py it will bring the needed dependencies [13:00] facubatista: looks like doing '-e .' instead of '.' does what we want [13:00] that said, how do you express "if you want to use this lib from this branch, you need also these libs to use it"? [13:01] Chipaca, we don't *really need* the requirements.txt file (we do need the requirements-dev.txt one, though) [13:03] facubatista: 'python setup.py develop'? [13:03] facubatista: but the -e . in reqs dtrt so \o/ [13:04] Chipaca, I don't trust doing stuff like 'python setup.py develop' for those libraries that you may be using and developing *at the same time* [13:04] facubatista: ok [13:05] facubatista: can you check that '-e .' does the right thing in that sense, for you? [13:05] facubatista: (when install_requires is ["PyYAML"]) [13:06] Chipaca, I can check it, I would test it IRL, for that you need to fix first the find_packages thing [13:07] facubatista: what fix to the find_packages thing? [13:08] Chipaca, https://github.com/canonical/operator/pull/305#discussion_r432440861 [13:08] PR #305: Tweaks to the README, setup.py, etc, for release [13:08] facubatista: remind me again, what version of setuptools did you have? [13:10] Chipaca, an old one, which is my exact point: you need to specify somehow that the installation procedure needs a modern setuptools if you want to use that method in setup.py [13:10] Chipaca, otherwise people will not be able to install the lib [13:11] btw, I'm in Bionic, not that I have really old stuff [13:12] facubatista: we don't have namespace packages anyway :) [13:12] * facubatista brb [13:14] facubatista: what would you say to recording a video of these things working in concert? [13:17] Chipaca, I'm not sure there's a "history to tell" that is best shown in a video than in a tutorial [13:17] facubatista: tutorial then :-D :-D [13:19] facubatista: unrelatedly: you know that 'ops $version up and running' thing? it gets annoying :-| [13:20] facubatista: WDYT of instead having it add [ops:$version] to each log line? would that be less annoying? [13:21] ie '%(asctime)s %(levelname)-8s %(message)s' → '%(asctime)s %(levelname)-8s [ops:$(version)s] %(message)s' [13:21] * Chipaca butchered that line but hopefully the idea survived [13:22] Chipaca, remember I wanted to gain "visibility of log lines from the OF"? maybe this "inline version" a good way [13:22] i remembered :) [13:23] facubatista: ok i'll do that [13:31] facubatista: getting my headset [13:33] oops [13:49] Issue operator#306 opened: Add [ops:] to operator log lines [14:00] Chipaca, what do we consider more "basic"? the 'install' hook or the 'start' hook? [14:14] facubatista: what does 'basic' mean? [14:14] facubatista: they both have the same Ph :-p [14:14] JAJAAJ [14:14] Chipaca, "barely first thing you need to see/understand" [14:15] if we hook on one event, which one is that? start or install? [14:15] facubatista: i think people not doing k8s will only be dimly aware of the 'start' one, and people doing k8s will know of 'install', so probably install [14:15] facubatista: but, 'if we hook on one event', that depends on the juju version :-) [14:16] facubatista: if you can assume 2.8, then 'install' always [14:16] ack [14:16] facubatista: one thing about 'charmcraft build' that i noticed, that was surprising to me [14:16] facubatista: is that the .charm is named after the directory you're in, instead of using the name from the model [14:17] facubatista: ie i think it should use the 'name' from metadata.yaml [14:17] mmm, yes [14:17] facubatista: (not for today) [14:17] Chipaca, good idea [14:17] facubatista: (issue plz?) [14:17] ox courz [14:17] facubatista: for the tutorial, make the directory be the same as the model name so we don't lie but also don't surprise people :-D [14:20] perfect [14:23] Chipaca, we should make a meeting around charmcraft issues, at least for "basic setup" like creating a couple of milestones, prioritizing, etc [14:23] we have 8 open already! :D [14:24] facubatista: i was about to create milestones but then realised we hadnt agreed on cadence so i punted [14:24] facubatista: but yes [14:25] facubatista: would having the same cadence as ops be reasonable? [14:25] Chipaca, "punted"? [14:25] facubatista: 'lo patié' [14:25] punted [it] [14:25] facubatista: i called defer() [14:25] :) [14:27] Chipaca, one "big number" release per month sounds good; we can have "small number" releases in the middle if we want some urgent fix or whatever [14:27] facubatista: 👍 [14:27] * facubatista is not sure about calling those major/minor/patch/etc [14:27] facubatista: this is charmcraft 0.1.0, right? [14:27] Chipaca, we can go with that, yes [14:28] Chipaca, probably we should define "all that charmcraft needs to support" before getting to 1.0; we need to have this in mind when we review all the commands [14:29] facubatista: created 0.2.0 and later milestones for charmcraftrmrmr [14:29] thanks [14:31] facubatista: #305 ready for re-review i think [14:31] PR #305: Tweaks to the README, setup.py, etc, for release [14:37] Chipaca, at install level, all is fine: https://paste.ubuntu.com/p/psw4Tpf35g/ [14:39] Chipaca, +1ed [14:41] facubatista: woo [15:04] Issue operator#290 closed: recommend install hook over start [15:04] PR operator#305 closed: Tweaks to the README, setup.py, etc, for release [15:09] facubatista: https://pypi.org/project/ops/0.6.0/ [15:10] Chipaca, rocanrol: https://paste.ubuntu.com/p/SJHGzjdP7m/ [15:11] facubatista: con fritas [15:11] Chipaca, did I comment you about this new feature? see line 8 in the pastebin [15:11] facubatista: you did not [15:12] fades, the easiest way to try Python libraries since libraries were invented [15:13] * Chipaca resurrects 'import pip.' [15:13] * Chipaca does not [15:14] i'm going to get a cuppa tea and come back to write a README [15:46] Chipaca, Houston, we have a etc, etc [15:46] facubatista: charmcraft#14 if you would [15:46] PR charmcraft#14: update README.md to be more introductory [15:46] facubatista: what did i break? :-| [15:46] Chipaca, let's do a HO, but first let my try something [15:47] facubatista: is the problem charmcraft-side, or ops-side? [15:47] Chipaca, charmcraft [15:48] facubatista: ok. what's the problem? [15:48] 2020-05-29 12:38:13,904 charmcraft.commands.build DEBUG :: no such option: --system [15:49] Chipaca, let's HO in the standup url [15:58] I'm going for a run, will bbiaw [16:13] * facubatista is back [16:38] Chipaca, branch: https://github.com/canonical/charmcraft/pull/15 [16:38] PR charmcraft#15: Don't use --system parameter in pip install [16:38] Chipaca, first draft of the tuto: https://gist.github.com/facundobatista/d3b7de7a624915227de051cba079e3d6 [16:39] really in alpha [16:39] * facubatista brb [17:03] * facubatista is back [17:10] Chipaca, now the tutorial is "beta" :p [17:45] facubatista: --system isn't needed when used with --target, right? [17:45] facubatista: or are we breaking something else and we'll need to revisit? [17:45] (not now but eventually i mean) [17:46] Chipaca, I couldn't find anything that should be fixed [17:47] facubatista: I APPROVE [17:47] facubatista: next week, can i convince you to not do branches on the project itself? [17:47] Chipaca, you could try [17:48] facubatista: ok :) [17:48] i'll do my best [17:48] facubatista: travis is being all travis-y [17:49] facubatista: did you look at charmcraft#14 ? [17:49] PR charmcraft#14: update README.md to be more introductory [17:49] nop, will now [17:49] facubatista: thankyoup [17:52] Chipaca, approved, with a comment [18:00] Chipaca, my branch is ready to land but has only one approve [18:02] facubatista: there is no branch [18:03] * facubatista checks his spoons [18:03] facubatista: wait, does this mean we're Done? [18:03] Chipaca, what about the tutorial? [18:03] facubatista: not needed for release :) [18:03] Chipaca, you should push to PyPI [18:03] facubatista: yes [18:04] facubatista: but first I should tag [18:04] facubatista: wait, we need one more to actually bump the version [18:04] d'oh [18:04] facubatista: do you want to do the honours? [18:05] ok [18:06] facubatista: at some point, let's move all our copyright headers to the juju style [18:06] Chipaca, ok [18:07] much cleaner [18:07] Chipaca, as long lawyers rest in peace, I'm ok [18:07] Chipaca, https://github.com/canonical/charmcraft/pull/16 [18:07] PR charmcraft#16: Version 0.1.0 [18:08] facubatista: +1 [18:10] hi all - first of all, congrats with the first release \o [18:11] second... I'm writing a test and encountered a little problem, hope someone can help :) [18:11] so, tl;dr I'm trying to access a StoredState from the test, but it fails -> https://paste.ubuntu.com/p/BPkFy8zmjP/ [18:12] any ideas or advices are very appreciated :) [18:15] man, stop breaking our stuff :-p [18:15] :) [18:15] :'( [18:16] * facubatista bb~1h [18:18] vgrevtsev: where does the charm in line 13 come from? [18:19] it's a `charm.py` file. and `on_config_changed_handler` is a function nmame [18:19] name* [18:20] here is it: https://paste.ubuntu.com/p/ty3YtMtCvx/ [18:21] vgrevtsev: i mean, what created it? [18:21] `import charm`, that's it [18:21] https://paste.ubuntu.com/p/TyXhMSyTXC/ line 98 [18:22] vgrevtsev: i have no idea what any of those things are :-( [18:22] :( [18:23] ok, let me ask another question then: what's the right way to access the StoredState object or mock it? I tried to initialize it in the test itself (in `setUp`), but sounds like it requires a framework context [18:23] vgrevtsev: there seems to be a whole other framework involved in this [18:27] vgrevtsev: are you asking about the framework-private stored state, or about the stored state of your charm? [18:27] I wish I knew the difference... [18:28] the framework uses a stored state object for some internal stuff, but i don't think you should care about that [18:28] so i'm assuming it's for your charm [18:28] I think I'm asking about the latter - I need to store some state during the hook execution and then check it [18:28] vgrevtsev: so the way you do that is by asking for it explicitly, something like [18:28] class MyCharm(CharmBase): [18:28] _stored = StoredState() [18:29] That's what I did... [18:29] (except of the `_stored` naming) [18:30] vgrevtsev: so if you need to test that your charm is saving the right thing in that stored state attribute, you can either replace it with a double, or mock it, or query it directly [18:30] it's just a python dict-that-ends-up-in-a-sqlite [18:31] I wonder why Harness instance doesn't have a `charm` object (it returns None) instead of anything [18:31] `Note that the Charm is not instantiated until you have called` ah,....... [18:31] Well. [18:31] Gimme a sec. :-D [18:31] vgrevtsev: did you harness.begin()? [18:32] I did (now). And the error is different now: "RuntimeError: unable to define an event with event_kind that overlaps with an existing type .TestEvents'> attribute: http_api_relation_created" [18:33] vgrevtsev: hmm, that's probably a wart we're wanting to fix, that has a workaround that i forget but give me a bit [18:34] vgrevtsev: you have more than one test that's creating a harness on the same charm class, right? [18:35] Chipaca: no, that's not correct. I have one test class with one test, creating a Harness object from the inside of the test function [18:36] vgrevtsev: I'm afraid I'm going to ask you to file a bug, and chase jam about it [18:36] i'm pretty sure he knows exactly what to do with that [18:36] Sure. [18:37] i might be wrong :) [18:37] I assume jam is already eod? [18:37] vgrevtsev: he's eow [18:37] yeah true, it's friday :D [18:37] so should i be, but i'm waiting to do a release before disappearing :-) [18:37] vgrevtsev: his week goes sun-thu, to make it more fun [18:38] oh wow [18:38] and travis is taking ages! and my beer is going cold! [18:38] well, that last one isn't necessarily bad [18:59] charmcraft 0.1.0 is out [19:00] facubatista: have a great weekend! the tutorial is looking good, I'd like to include a link to it in the status email (going out Monday) === Chipaca changed the topic of #smooth-operator to: general discussion of the operator framework || github.com/canonical/operator || ops 0.6.0 RELEASED (pip install ops) || charmcraft 0.1.0 RELEASED (pip install charmcraft) || have a great weekend [19:04] Chipaca, mmm... we may have a bug [19:04] facubatista: lies! [19:04] facubatista: we only have hard to understand features [19:04] :-p [19:04] jajaja [19:05] facubatista: contá contá [19:05] Chipaca, https://is.gd/rxVXTp [19:06] facubatista: what's that? [19:06] Chipaca, why its setup.py is trying to read requirements.txt? [19:06] that is not in master [19:06] what did you push? :p [19:06] facubatista: that's also missing commands/ [19:07] facubatista: i pushed 0.1.0 [19:07] what is that [19:07] ok let me fix this [19:07] https://pypi.org/project/charmcraft/#history [19:07] Chipaca, something pushed 2 days ago [19:08] facubatista: try now [19:09] Chipaca, don't yank it, really delete it [19:09] we don't want anybody try to use it even specifying 0.1.1 [19:09] yeah [19:10] i don't understand the thinking behind pypi's workflow [19:10] you can't delete a yanked version [19:10] Chipaca, can you un-yank it? [19:10] yes [19:10] but then it'll be the tip again [19:10] and then delete it [19:11] or just release 0.1.2 [19:11] facubatista: actually it looks like i can delete it if i enter the CRUD URL by hand … o\ [19:12] done [19:13] Chipaca: so actually `_stored` did the magic for some reason, I don't know why [19:13] `harness.charm._stored.set_default(is_started=False)` & `harness.charm._stored` worked fine [19:13] weeeeee [19:13] $ fades -d charmcraft -x charmcraft version [19:13] Version: 0.1.0 [19:13] WELL [19:13] no [19:13] vgrevtsev: please file the bug :-) [19:13] the same code produces the different results [19:14] Yeah I was filing the bug [19:14] vgrevtsev, thanks [19:14] vgrevtsev: my brain is way ahead of me WRT this EOW thing [19:14] not that it was a whole lot better before mind you :-) [19:14] no worries Chipaca - i'm just sending my thoughts to the channel not expecting anyone of you to answer :) [19:14] facubatista: sorted, then? i can go? :-) [19:15] vgrevtsev: :-) cheers man [19:15] Chipaca, let's get drunk [19:15] * facubatista prepares a mate [19:15] * vgrevtsev looks at the clock, 22:15... [19:15] facubatista: actual LOL [19:15] who said "beer"? [19:15] vgrevtsev: i think i did [19:15] vgrevtsev, \o/ [19:16] i've got an IPA for ops, and another for charmcraft [19:16] * Chipaca likes the hoppy stuff [19:16] * Chipaca goes [19:16] facubatista: buen fin de semana! and see you Monday. Not too early. [19:16] Chipaca, have a nice weekend, eso [19:16] facubatista: we still need to review your charm :-) but we got the release out so i'm super happy [19:17] now i need to tidy my thoughts and write that status email [19:17] :) [19:17] but first, beer, sleep, weekend [19:17] 👋 [19:22] Issue operator#307 opened: Race condition: RuntimeError: unable to define an event with event_kind that overlaps with an existing type [19:22] ^ that's me [19:26] vgrevtsev: niiice [19:27] * Chipaca sips his beer [19:27] (no coding after beer is being supped) [19:27] in fact, it might be high time to go play civ [19:28] * vgrevtsev counts time down before The Last of Us Part II release [19:32] * Chipaca wonders if said counting down is done using some form of liquid timekeeping device [19:35] Issue operator#308 opened: have a code of conduct [19:36] Issue operator#309 opened: KeyError: 'JUJU_MODEL_NAME' while emitting event from Harness [19:37] :-( [19:37] it's me again.... [19:38] Chipaca: oh yes, indeed, liquid time machine... [19:39] you can activate it being near your laptop at 8pm and then suddenly realise it's Sunday 5am already and you're in the middle of nowhere [19:39] but it was fun :-D