Tuesday, 2022-11-22

*** tkajinam is now known as Guest216202:04
*** tkajinam is now known as Guest217403:28
*** pojadhav- is now known as pojadhav05:03
*** tkajinam is now known as Guest217905:36
*** pojadhav- is now known as pojadhav05:57
*** dasm|off is now known as dasm13:55
*** frenzy_friday is now known as frenzy_friday|doc14:43
*** blarnath is now known as d34dh0r5314:53
rosmaitagmann: i know we cancelled tomorrow's TC meeting, but will you personally be around at that time?15:01
*** pojadhav is now known as pojadhav|afk15:32
noonedeadpunkfwiw, we've got issues with pbr and new setuptools that were released on Saturday. Not sure if it was spotted yet, but `python setup.py --version` now returns not only version, but `[pbr] Generating ChangeLog` as the line before version.16:18
noonedeadpunksetuptools used to be constrained in u-c for X and partially for Y but not on Z anymore.16:18
fungioh fun, you might consider raising that in #openstack-oslo16:19
noonedeadpunkI will ask releases team about what they think about it...16:19
noonedeadpunkoh, should it be oslo? ok16:19
fungiwell, pbr is an oslo deliverable. not sure what you wanted to ask the release team though16:19
noonedeadpunkAs tbh I'd love to get setuptools constrained...16:20
noonedeadpunkBut I think I'm going same road to nowhere with that16:20
fungithat's harder than it sounds, since it gets automatically installed by pip before version constraints can be applied in many cases16:20
fungiand pip isn't designed to automatically upgrade/downgrade existing setuptools versions while installing packages that need setuptools either16:21
fungibut also, calling setup.py directly is entirely deprecated in setuptools since several versions now16:21
fungi(use of setup.py isn't deprecated, but running it as a command is)16:22
*** dasm is now known as dasm|off16:23
fungialso, recent versions of pip install setuptools to a separate isolated "build" environment, which means you may end up with a different version of setuptools used for installing than the version of setuptools which may or may not end up installed in your actual target environment16:23
noonedeadpunkeventually it's true that nobody should run setup.py like that....16:24
fungithis also gets increasingly complex if you use setuptools as a pyproject.toml build-system.build-backend16:24
noonedeadpunkI think that pip can be leveraged same way16:24
fungiwhat's running `python setup.py --version` in this case? is it something pbr is doing itself, or some external process running that?16:25
funginote that if pbr is installed in the environment, it has its own cli entrypoint too16:26
noonedeadpunkok, I didn't know about "build" environment - so if you run pip install setuptools==65.5.1 it won't result in using these setuptools in venv?16:26
fungiif you directly `pip install setuptools==65.5.1` in a venv, and then you `pip install somethingelse` in that same venv, the version of setuptools used to install somethingelse (if it uses setuptools at all) may be a completely different one ephemerally installed to a temporary isolated build env16:27
noonedeadpunklikely I should just fix way of finding version instead16:27
noonedeadpunkok, I totally missed that part ^16:28
noonedeadpunkthanks, I will not bug anyone anymore :)16:28
fungiyeah, it is no longer assumed that all python packages will rely on a common setuptools version, so each package may call a different version of setuptools at installation (or hatch, or flit, or various other pep 517 compliant build backends)16:29
noonedeadpunkgood to know, thanks a lot!16:30
clarkbfwiw pyproject.toml is the only reliable way for an individual project to control what setuptools version it will install with16:30
funginoonedeadpunk: if you can point to where setup.py --version is being called, i might be able to suggest alternative approaches16:31
clarkbif you `pip install setuptools==x.y.x foo` foo isn't installed with setuptools x.y.z they are installed side by side using whatever setuptools already exists16:31
fungiclarkb: but also with pep 517 a totally different version of setuptools may be installed in a temporary isolated build env for each package, so "already exists" is not how i would think of it16:32
fungiyou can in fact have venvs without any setuptools installed in them at all even though the packages installed into them used setuptools to install16:32
clarkbfungi: right I mean for projects likle openstack without pyproject.toml16:32
clarkbif you are using "legacy" setuptools then you cannot control setuptools in any way16:32
clarkbthis is why I have continuously encouraged openstack to stop trying to constrain setuptools16:33
clarkbits near useless16:33
noonedeadpunkyeah, so I though of it as - I get setuptools installed in venv and then installing like keystone and assuming it will use setuptools from venv16:33
clarkbif instead openstack wishes to have control over setuptools in this way the only reliable method is via prproject.toml16:33
noonedeadpunkBut I got that this assumption is wrong as of today16:33
noonedeadpunkOk, yes, now I get quite clear picture I beleive and it makes sense now16:34
funginoonedeadpunk: it may work for the exact case you specified, but it depends a lot on how the project is packaged and is likely to change dramatically in the future so you should consider setup.py as an implementation detail and not a stable api16:34
noonedeadpunkyeah, it's better not to do that and more importantly not to rely on that16:35
clarkbI think pbr had a version command ?16:35
clarkbthere is pbr freeze and I think a couple of other related utilities to gather that sort of info. That might be mor ereliable?16:35
noonedeadpunkI'm jsut not sure that pbr is installed at the point when it's executed16:35
noonedeadpunkbut it's different question I guess16:36
noonedeadpunkwell, that used to be reliable for 5 years until this saturday :)16:37
noonedeadpunkanyway16:37
funginoonedeadpunk: yeah, that's why i asked for a pointer to where it's being used. depending on what information you're trying to get for what from where exactly, the alternative solutions may differ16:37
clarkbnoonedeadpunk: while I agree that python packaging needed a major overhaul I'm not sure I agree with upstream in leaving existing tooling behind so aggressively. But ya thats the path they've chosen. And honestly openstack might need to investigate switching to it. The new tooling can do a fair bit of what PBR offers but not all of it. Investigation would be needed to determine16:40
clarkbif that is a problem or not16:40
clarkbif it is a problem more effort in updating PBR to accomodate the new stuff is a good idea. fungi and I have poked at it here and there, but I don't have the time to devote to proprely updating pbr to the new world or pypa expectations16:40
fungiclarkb: a solution i use which doesn't rely on pbr being installed at runtime is to use importlib.metadata (or pkg_resources with python 3.8 and earlier) to get the base version and also to read the pbr.json file as metadata if it exists so i can append git_version info when available16:41
fungialso allows me to simulate the effects of pbr freeze for purposes of listing the versions of all installed packages, and further breaking them down into categories for the calling project, its direct dependencies, and the indirect dependencies they've pulled in16:44
noonedeadpunkfungi: actually yes, I used that method quite a lot to determine path to libraries16:44
clarkbthe problem with pkg_resources and importlib is they are the number one performance killer for python command line tools16:45
fungiand i'm doing that in a project which relies on pbr's pyproject.toml build-backend support, so it seems to be a forward-compatible approach16:45
clarkbits fine for long lived services but for example it completely kills osc performance16:45
fungiclarkb: right, i only call those routines *if* the version is requested16:45
fungiso it does make any calls that want to report the version slower (depending on the size of the venv), but as long as you avoid looking up the version every time you invoke a cli for example, it's fine16:46
fungithe place where that's harder to solve is if you're truing to use pkg_resources/importlib for entrypoint discovery, since you likely do need to do that on every invocation (unless you can cache the lookup reliably between runs)16:47
clarkbya thats the main bit that kills osc16:48
clarkbI'm just completely allergic to the tools now as a result16:48
fungianyway, this has probably veered waaaay off-topic for the tc channel, mostly my fault, sorry!16:48
noonedeadpunkSo basically when I need that - is once during bootstrap to define version we're running in vars file16:48
clarkbthey were written with no consideration for performance then hidden in central python package utilities and everyone wonders why python is slow16:48
noonedeadpunkhttps://opendev.org/openstack/openstack-ansible/src/branch/master/scripts/bootstrap-ansible.sh#L15916:48
noonedeadpunkand yeah, pbr is not installed at that point16:49
noonedeadpunkI don't think it installed at all tbh16:50
clarkbnoonedeadpunk: it will install as soon as yo uinstall any openstack repos16:50
clarkbsince they all depend on it as a setup requires and many as an actual dependency16:51
noonedeadpunknot in that venv16:51
clarkbwhen you run setup.py --version it does16:51
fungiit will if they include pbr as an install_requires (not if pbr is only listed as a setup_requires)16:51
noonedeadpunkhttps://opendev.org/openstack/openstack-ansible/src/branch/master/setup.py#L1916:52
fungibut also the project isn't being installed in that case, from what i can see16:52
fungiit's running a specific venv's python interpreter to call setup.py from a git workdir for something which has presumably not been pip installed into that venv16:53
noonedeadpunkI guess project is https://opendev.org/openstack/openstack-ansible/src/branch/master/scripts/scripts-library.sh#L8416:53
noonedeadpunkalso my sandbox does have project among pip info16:54
noonedeadpunks/info/freeze/16:54
noonedeadpunkI think the only reason setup.py --version is used to save ourselves from parcing16:54
noonedeadpunkwas super simple kind of...16:55
*** frenzy_friday|doc is now known as frenzy_friday17:36
gmannrosmaita: yes, I will be around tomorrow18:00
*** dasm|off is now known as dasm20:31
*** dasm is now known as dasm|off22:25

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!