[05:00] <Chipaca> ｇｏｏｏｏｏｏｄ  ｍｏｒｎｉｎｇ！
[07:12] <jam> morning chipaca-of-the-early-morning
[08:09] <Chipaca> good morning, again :-)
[08:50]  * Chipaca brb
[10:37] <jam> Chipaca, I still need reviews on operator:359
[10:37] <jam> operator#359
[10:37] <mup> PR #359: ops/testing.py: Harness.add_resource <Created by jameinel> <https://github.com/canonical/operator/pull/359>
[10:38] <Chipaca> aaand network's back
[10:38] <Chipaca> jam: oops. Will look in 5.
[10:54] <Chipaca> ooh! i'm an arctic code contributor!
[10:54] <Chipaca> arctic code vault*
[11:30] <facubatista> ¡Muy buenos días a todos!
[11:33] <Chipaca> facubatista: buen día!
[11:33] <Chipaca> flake8-bugbear is interesting
[11:35] <facubatista> hola Chipaca
[11:37] <facubatista> Chipaca, didn't review the list super thouroughly but all stuff I saw makes sense
[11:54] <facubatista> jam, your operator#359 PR... are we "forcing" people to call addCleanup(harness.cleanup) when using resources? can't that be more automatic somehow? people surely will forgot to add that
[11:54] <mup> PR #359: ops/testing.py: Harness.add_resource <Created by jameinel> <https://github.com/canonical/operator/pull/359>
[11:56] <jam> facubatista, we can pass in the test suite to the Harness instance, or have them call cleanup(). Fixtures having a cleanup isn't an uncommon pattern.
[11:56] <jam> That said, if they don't call cleanup, it actually does still cleanup but gives a warning (TemporaryDirectory has that property)
[11:56] <jam>  morning facubatista
[12:24] <Chipaca> facubatista: btw that bug you had with github itself sounded suspiciously like the issue i had where one of the two test runs was merging something weird
[12:25] <Chipaca> facubatista, jam, https://github.com/chipaca/ops-lib-k8s/pull/2 is a thing
[12:25] <mup> PR chipaca/ops-lib-k8s#2: lots of small tweaks and cleanup <Created by chipaca> <https://github.com/chipaca/ops-lib-k8s/pull/2>
[12:26] <facubatista> Chipaca, they are aware of the "running actions on mistakenly merged commits", they just say it's very rare
[12:26] <facubatista> Chipaca, ack
[12:26] <Chipaca> trying out the juju-style 'copyright' header
[12:26] <Chipaca> must say i like it :)
[12:27] <facubatista> jam, yes, it's eventually removed (which is a good thing!), but I think there's no warning involved
[12:27] <jam> facubatista, there is, because I was trying it before calling cleanup()
[12:29] <facubatista> jam, I'm not being able to it to emit a warning in any combination of using TemporaryDirectory, and the docs doesn't mention any either
[12:29] <facubatista> jam, which are the steps you make to see one?
[12:30] <jam> facubatista, it may depend on Python version, if I do this edit:
[12:30] <jam> +++ b/test/test_testing.py
[12:30] <jam> @@ -749,7 +749,6 @@ class TestHarness(unittest.TestCase):
[12:30] <jam>                  type: oci-image
[12:30] <jam>                  description: "Another image."
[12:30] <jam>              ''')
[12:30] <jam> -        self.addCleanup(harness.cleanup)
[12:30] <jam>          harness.populate_oci_resources()
[12:30] <jam>          path = harness.model.resources.fetch('image')
[12:30] <jam>          self.assertTrue(str(path).endswith('/image/contents.yaml'))
[12:30] <jam> I get this warning:
[12:30] <jam> $ ./run_tests test/test_testing.py
[12:30] <jam> ................................./usr/lib/python3.8/tempfile.py:958: ResourceWarning: Implicitly cleaning up <TemporaryDirectory '/tmp/tmp-ops-test-resource-jn_sy0yg'>
[12:31] <jam>   _warnings.warn(warn_message, ResourceWarning)
[12:31] <jam> .............
[12:31] <jam> ----------------------------------------------------------------------
[12:33] <facubatista> TIL: https://docs.python.org/3/library/weakref.html#weakref.finalize
[12:33] <facubatista> Return a callable finalizer object which will be called when obj is garbage collected. Unlike an ordinary weak reference, a finalizer will always survive until the reference object is collected, greatly simplifying lifecycle management.
[12:34] <facubatista> Much nicer than adding __del__
[12:35] <facubatista> oh, I love the lifecycle management of TemporaryDirectory!
[12:35] <facubatista> (reading it's code)
[12:44] <facubatista> Chipaca, I also like that copyright style!
[12:44] <facubatista> will adapt it for my projects
[12:44] <facubatista> maybe will add a link to the project, though
[12:47] <facubatista> Chipaca, this "version magic management" can be separated in a different module/project? I love it, but don't want to start copying that code everywhere (maybe it's tricky because it's quite entangled with setup.py)
[12:49] <facubatista> Chipaca, +1ed with comments
[12:50] <Chipaca> yeah, ive been pondering that
[12:50] <facubatista> Chipaca, let's make it the new standard for version management across the world
[12:56] <Chipaca> facubatista: let's add a new keyword to the language
[12:56] <Chipaca> we'll call it … $$VERSION$$
[12:56] <Chipaca> or maybe $v$
[12:56] <jam> Chipaca, :)
[12:57] <Chipaca> i have forgotten cvs tags! woo hoo
[12:57]  * Chipaca likes when his head makes space with the _right_ stuff
[12:57] <Chipaca> a pleasent change
[12:57] <Chipaca> pleasant*
[12:57] <Chipaca> sigh
[12:58] <facubatista> jajaj
[13:14] <Chipaca> does juju have a 'trace' log level?
[13:15] <jam> Chipaca, yes, but Python doesn't IIRC
[13:15] <Chipaca> it's easy to add it to python :-) (we did that in syncdaemon iirc)
[13:15] <jam> Chipaca, so definitely juju internally uses TRACE and I think you can pass it to 'juju-log'
[13:30] <mup> PR operator#359 closed: ops/testing.py: Harness.add_resource <Created by jameinel> <Merged by jameinel> <https://github.com/canonical/operator/pull/359>
[13:41] <Chipaca> names are hard (tm)
[13:53] <facubatista> Chipaca, we had TRACE in syncdaemon, yes, we used it to log all messages between client and server at the byte level
[13:54] <Chipaca> ikr
[14:29] <crodriguez> if I want to edit the charmcraft tool and test my changes, do I need to package it somehow ? There's no makefile and I am not very familiar with packaging
[14:32] <Chipaca> crodriguez: edit the charmcraft tool itself, or your charm?
[14:36] <crodriguez> the tool itself. It's not including "templates" directory in the build so my charm fails to deploy correctly
[14:38] <crodriguez> Chipaca ^
[14:39] <Chipaca> crodriguez: you should be able to just 'run' the charmcraft directory with python
[14:39] <Chipaca> crodriguez: i.e. python3 ./charmcraft (or whatever)
[14:40] <Chipaca> you might need to tweak the pythonpath, depending on how you've set it up :)
[14:40] <crodriguez> ok I'll try that thank you
[14:40] <Chipaca> e.g. PYTHONPATH=. python3 ./charmcraft
[14:43] <crodriguez> hum that does not really  work https://pastebin.canonical.com/p/wrBzTnS5g4/
[14:45] <crodriguez> tried this too.. https://pastebin.canonical.com/p/4JWS3Mjmsf/ . It would be nice if the charmcraft README would explain the correct steps :)
[14:51] <crodriguez> Chipaca: I might just go back to using the submodule..
[14:56] <mup> PR operator#360 opened: make debug logs all along the ops.lib.use dance <Created by chipaca> <https://github.com/canonical/operator/pull/360>
[14:57] <Chipaca> crodriguez: so close!
[14:57] <Chipaca> crodriguez: drop the 'export' from that last one and it should work
[14:58] <Chipaca> crodriguez: bah, and then the tabulate thing, because you're not running it from the virtual env where you installed the requirements
[14:58] <Chipaca> crodriguez: agreed about having this in the README
[14:59] <Chipaca> facubatista: ^
[15:01] <facubatista> crodriguez, did you create a virtualenv for charmcraft?
[15:03] <facubatista> Chipaca, https://github.com/canonical/charmcraft/issues/88
[15:03] <Chipaca> facubatista: 👍
[15:26] <Chipaca> facubatista: question WRT the k8s component '_dir': if instead of e.g.  (self._dir / "wobble").open(...)  the coded did  self._path("wobble").open(...)  would that be clear?
[16:00] <jam> Chipaca, facubatista ?
[16:32] <facubatista> Chipaca, I don't understand why I can not merge https://github.com/canonical/charmcraft/pull/86
[16:32] <mup> PR charmcraft#86: The "list revisions from the Store" command <Created by facundobatista> <https://github.com/canonical/charmcraft/pull/86>
[16:32] <facubatista> Chipaca, it says it's waiting for Travis checks, but if I go to travis all is done and green :/
[16:33] <Chipaca> facubatista: because travis <-> github is complicated
[16:33] <Chipaca> facubatista: restart one of the workers on travis
[16:35] <facubatista> Chipaca, I don't find a "restart" anywhere
[16:35] <Chipaca> facubatista: log back in to travis
[16:35] <facubatista> https://travis-ci.org/github/canonical/charmcraft/jobs/710017112 for example
[16:35] <Chipaca> facubatista: are you seeing 'no repositories found' in the left column, also?
[16:36] <Chipaca> facubatista: i didn't have the 'restart job' either, so i logged out and back in and now it's there
[16:36] <facubatista> wtf
[16:36] <Chipaca> facubatista: something in auth is expiring wrong ¯\_(ツ)_/¯
[16:36] <facubatista> well, that worked
[16:36] <Chipaca> microservices
[16:37] <facubatista> Chipaca, there, restarted
[16:37] <facubatista> the hope is that will end up travis telling github that all is fine?
[16:37]  * facubatista bb~30'
[16:38] <Chipaca> facubatista: yup
[16:48] <Chipaca> jam: are you using actual venv, or is that short for virtualenv?
[16:48] <jam> Chipaca, pretty sure it is python venv
[16:53] <jam> Chipaca, I'll set it up a second time to make sure
[16:54] <jam> Chipaca, if I do: https://paste.ubuntu.com/p/2TbvPX7Wj8/
[16:55] <jam> I get charmcraft/__main__.py can't find module named charmcraft
[17:04] <Chipaca> yeah, repro'd it, so you're not 100% deranged
[17:04] <Chipaca> but, anyway, must do this other thing :)
[17:10] <facubatista> Chipaca, jam, store release: https://github.com/canonical/charmcraft/pull/89
[17:10] <mup> PR charmcraft#89: Store release <Created by facundobatista> <https://github.com/canonical/charmcraft/pull/89>
[18:56]  * facubatista brb, reboot
[18:58] <crodriguez> Does the new framework handle resources differently, compared to reactive?
[20:45] <facubatista> Chipaca, did we get to a conclusion about what we'll do about the "--system only in bionic" problem?
[21:01]  * facubatista eods
[21:35] <Chipaca> facubatista: 🔥🔥🔥?
[21:35] <Chipaca> facubatista: detect bionic (or the patch) and work around it
[21:35] <Chipaca> facubatista: probably the only thing we can do
[21:51] <Chipaca> facubatista: where was it that --system did _not_ do the right thing?
[21:51] <Chipaca> ah, when used with a non-ubuntu pip maybe?
[21:51]  * Chipaca tries
[22:00] <Chipaca> facubatista: so, one (ugly) way would be to detect ubuntu-patched pip by doing
[22:01] <Chipaca> from pip._internal.commands.install import InstallCommand
[22:01] <Chipaca> InstallCommand('i', 'i').cmd_opts.get_option('--system') is not None
[22:01] <Chipaca> not the pretties approach, but I'm not sure there are alternatives
[22:01] <Chipaca> --system is not mentioned in usage
[22:02] <Chipaca> I guess you could run 'pip3 install --help', and look for --system in that
[22:06] <facubatista> maybe, yes
[22:07] <facubatista> ugly, all ugly
[22:08] <Chipaca> facubatista: both of those options take a whole second to run /o\