Thursday, 2025-05-01

*** darmach5 is now known as darmach12:55
sean-k-mooneyfungi: clarkb did i see talk about using spdx license specfics instead of classifer recently 17:12
sean-k-mooneysince we have had all the issue with not using pyproject.toml recently 17:12
clarkbsean-k-mooney: https://opendev.org/opendev/bindep/src/branch/master/pyproject.toml#L47-L5117:13
sean-k-mooneyas im setting up the new grian-ui repo im takign the time to do so with pyproject.toml form day one17:13
sean-k-mooneyya it might have been that that i saw17:13
clarkbbindep is acting as our pyproject.toml methods test case. And yes, but we haven't changed yet because apparently older python can't understand it17:13
sean-k-mooneyso i have a workign version for the new repo using setuptools-scm instead of pbr currently17:14
clarkbkeep in mind that you lose a number of features when you do that. I think in many cases that is probably fine but its worth being aware of17:15
sean-k-mooneyhttps://paste.opendev.org/show/bGwBlwDlf69UT4eNIGpY/17:15
sean-k-mooneyyes i had it using pbr first17:15
sean-k-mooneybut i was having issue also makeing it work with src layout17:15
sean-k-mooneyso i said i woudl try this17:15
sean-k-mooneywhat im really wondering is do we see openstack movign away form setuptools any time soon17:16
sean-k-mooneyi.e. to hatchling or uv 17:16
clarkbthings like version number generation being aware of commit message content labels (something that has created problems in the past and not something I personally think is ciritical), wsgi scripts installation goes away (but is half broken anyway), autogeneration of authors files?, sphinx integration (something that goes away when you use pyproject.toml anyway), and probably17:16
clarkbmore17:16
fungisean-k-mooney: there's also a debate raging on discuss.python.org right now about the "correct" use of that metadata, and i suspect the end result will be even more churn17:17
sean-k-mooneywell setuptools-scm can do dynmic version number 17:17
sean-k-mooneybased on git tags17:17
clarkbsean-k-mooney: it can do dynamic versions but not incrementing based on commit messages iirc17:17
clarkbsean-k-mooney: pbr will look at your most recent tag and then increase the version appropriately based on commit message content17:17
sean-k-mooneyright we cant force a bump17:17
sean-k-mooneyyep17:17
sean-k-mooneyclarkb: by the way i have not settled on not using pbr17:18
sean-k-mooneyi started with it17:18
clarkbsean-k-mooney: oh I think its fine. And I've been hoping someone would try it. I think most of the pbr functionality you lose isn't critical and being able to not maintain pbr forever would be nice17:18
fungiit's been pointed out that project information != package information, and so for example projects that embed/vendor dependencies in the packages they distribute on pypi will want to deeclare different (or at least additional) package licenses from whatever the project license is17:19
sean-k-mooneywell that why i was debating starting without it17:19
clarkbI doubt openstack would move to uv or hatchling any time soon. setuptools-scm is a much smaller leap and any changes are going to be small and incremental if history is an indiciation17:19
sean-k-mooneyi have been talkign to stephenfin about this on and off for a year or two17:19
clarkbbut I think a lot of people are not aware of the various pbr features taht do exist so its good to remind people17:19
sean-k-mooneywell bacially since the whole wsgi_srcript problem was found with pbr 617:19
clarkbsean-k-mooney: the primary feature that I think would need to remain is the ability to record the git hash of the commit the package was built from17:20
clarkbpbr does this by writing out a metadata file and if you do pbr list instead of pip list it will emit that info alongside the package version number17:20
clarkbin addition to git based versions and git based file inclusion I mean17:20
clarkbits a small but important feature for tracing the source of a package that pep440 broke by not providing a mechanism for this in the version itself17:21
fungiwell, also pbr's version calculation functionality is more feature-rich than setuptools-scm's17:21
sean-k-mooneyhttps://paste.opendev.org/show/bF8bnULgoJLL7WwRsVFB/17:21
sean-k-mooneyim not sure if that is all of it but that a reasonabel output17:21
sean-k-mooneyah ok17:22
clarkbsean-k-mooney: that doesn't include the source commit hash17:22
sean-k-mooneyi was not aware of pbr list17:22
clarkbso you can't know what commit the package was built from17:22
sean-k-mooneylet me see if just swapign back to pbr will work now that i have filed out the rest of the file17:22
clarkbfungi: ya but as long as you explicitly tag versions (like openstack does for every release now) that is basically a non issue I think17:23
fungimore that some projects rely on hinting dev version prediction using commit message footers17:23
clarkboh are projects doing that these days?17:28
sean-k-mooneyya so its a little more work to get pbr enabeld again because i will have ot undo moving everythign form setup.cfg to pyproject.toml17:28
clarkbsean-k-mooney: you don't have to undo that17:28
sean-k-mooneyfungi: clarkb  not any i have worked on17:28
sean-k-mooneyclarkb: if i dont define a setup.cfg it does not add the sha info17:29
clarkbsean-k-mooney: https://opendev.org/opendev/bindep/src/branch/master/setup.cfg you need a very minimal setup.cfg17:29
clarkbright you need a setup.cfg but its 2 lines17:29
clarkbnot a wholesale undo17:29
sean-k-mooneyoh ok 17:29
clarkblike needing a minimal setup.py17:29
fungithis should all be clear in the latest pbr docs too, i tried to make sure of that17:30
sean-k-mooneyso it build but still no sha17:32
sean-k-mooneyanyway this is not a blocker17:33
sean-k-mooneyoh do i alos need the minimal setup.py17:34
sean-k-mooneyok ya17:34
sean-k-mooneyso it works17:34
fungisean-k-mooney: the automated release changes use sem-ver headers btw, not sure how many humans do though... https://review.opendev.org/c/openstack/nova/+/94489017:36
fungis/headers/footers/17:36
sean-k-mooneythat about the only place i have seen them ya17:37
sean-k-mooneyi may have done it once17:37
fungithat helps ensure that .dev versions will target the next minor release version instead of the last version17:37
fungiso that they'll sort later than contemporary dev versions on stable branches17:39
sean-k-mooneyack, typically i us a tool to boostrap repos like this, but since many peropel are off today i wanted to do it by hand following the python packaging guide since its been a while17:40
clarkbsean-k-mooney: yes you need a setup.py beacuse if you don't supply one setuptools generates a default one that doesn't have pbr=true set. This is true even if you set pbr=true in setup.cfg/pyproject.toml for setuptools17:40
sean-k-mooneyyep17:40
clarkbI think it has to do with the way pbr hooks into setup() is actually an old distutils thing and setuptools ignores it when running out of pyproject.toml17:41
clarkbbut even if you use pyproject.toml you're still running a setup.py one way or another so its not a big deal17:41
clarkbI should say pyproject.toml with setuptools17:41
sean-k-mooneywell bar any funkyness with the versions17:41
sean-k-mooneyi now have a repo that works with or without pbr and generage something reasonable17:41
sean-k-mooneyso if we ever discontinue pbr17:41
sean-k-mooneymoving to setuptool-scm shoudl be trivial17:42
sean-k-mooneyrelease tooling aside.17:42
fungiyes, the idea with the state and direction of our example in bindep's packaging is that it's relying on very little of pbr17:43
fungiso weaning off of it from that state would be fairly painless17:43
fungiopendev/engagement is simpler still since it doesn't need older python compatibility17:44
sean-k-mooneywell new project just need 3.10+17:45
sean-k-mooney3.9 for oslo kindof17:46
sean-k-mooneysure we need to supprot older things for stable17:46
sean-k-mooneyso tools like bindep are a bit more constriaed17:46
sean-k-mooneyby the way i need ot evntually teach it that debian testing is just debian...17:47
fungiright, and even there it's mostly "modern" except for a few things that need versions of pip and setuptools that only work on python 3.9 and later17:47
fungisean-k-mooney: i thought i fixed that?17:48
sean-k-mooneymaybe i havenet tried it in a while17:48
sean-k-mooneyhttps://review.opendev.org/c/opendev/bindep/+/93219217:49
sean-k-mooneyi wonder if that is released17:49
sean-k-mooney2.12.017:49
sean-k-mooneyhum17:49
sean-k-mooneyoh it might be my fault17:50
fungiit might also be my fault if the fix was incomplete17:50
fungii mostly use sid/unstable, and noticed the problem there, but in theory testing should be more or less the same strings17:51
sean-k-mooneyso it works if i use a venv with system pyton on sid17:51
fungido you have an /etc/os-release file?17:52
sean-k-mooneyi do im wondering if it was broken in the past because i was using other python verison form nix 17:53
sean-k-mooneyvia nix home-manager17:54
sean-k-mooneyit seam to be workign perfectly fine for me now17:54
fungioh, nix sandboxes into a chroot so yeah, your outer /etc may be shadowed by it17:54
sean-k-mooneyit seam to be working with 3.11 form nix too17:54
fungiokay cool17:54
sean-k-mooneymy guess is i just had an old verion in some of my venvs17:55
sean-k-mooneyon of the reasons i was thinking about uv17:55
sean-k-mooneyis like pyenv it can provide many pyton versoin but unliek it it will pull prebuilt ones17:56
clarkbI guess the alternative to changes like https://review.opendev.org/c/openstack/nova/+/944890 would be to make more tags17:56
sean-k-mooneyi was wonderign if we could use that in our jobs at some point where we need to test newer version then are in ubuntu17:56
clarkbbut ya I don't think there is any easy way around that pbr version bumping if we're relying on it. May require setuptools-scm to become smarter or find alternatives (like more tags)17:56
clarkbsean-k-mooney: you already can for python with pyenv17:57
clarkbsean-k-mooney: https://review.opendev.org/c/zuul/zuul/+/945521 is an example17:57
sean-k-mooneyi tought pyenv alwasy compiled17:57
clarkbit does but it only takes a couple minutes for a non optimized build17:57
sean-k-mooneyclarkb: on i know we can do it in ci17:57
clarkband the runtime for non optimized builds are reasonable17:58
fungisean-k-mooney: yeah, the challenge with non-lts distros is the constant churn and breakage, particularly for image building. once upon a time we had suse tumbleweed for example and it was similarly problematic. even fedora and non-lts intermediate ubuntu versions were too hard to keep up17:58
sean-k-mooneyi was suggestign we coudl maybe speed up those jobs by using uv to provide the 3.13 build17:58
clarkbya I mean you can do that too. There is uv support in zuul-jobs17:58
clarkbI just don't think it is critical as pyenv seems to work. But maybe uv will work a bit faster and people will be happier17:59
clarkbfungi: ya and now we're struggling with the major releases too (centos 10 stream)17:59
sean-k-mooneyi got devstack to mostly work with "uv pip" last year but at the tiem it dint really like our constratis files17:59
clarkbit still isn't clear to me if uv pip supports constraints17:59
fungii think they prefer their custom lockfile format18:00
sean-k-mooneyi havent treid sicne then18:00
sean-k-mooneyfor us the issue iw we need a consitent set across repo18:00
sean-k-mooneywhich unfortuenly most of the modeern tools dont cater for18:01
fungiyou could in theory preprocess the dependencies with pip install -c and then pip freeze and feed the resolved freeze file into uv18:01
clarkbre optimized python builds vs not having similar performance my hunch is that when building unoptmized from scratch the compile is able to make use of local features that the generic optmized builds can't use for wide applicability and the result is performance that comes out in a wash18:01
sean-k-mooneyoh you mean like -macrch native18:01
clarkbsean-k-mooney: and things like sse18:01
clarkbI suspect the generic builds like distros have to be more cautious. Whereas pyenv is running ./configure and it should configure those bits18:02
sean-k-mooneyi havn't really been following any of the jit workin in 3.13+ but i suspect doign taht at runtim is goign to be more common goign forward18:02
fungicpython has a build optimization mechanism where it compiles once, runs a simplified version of its `make test` under profiling, then compiles everything again optimized based on the profiling results18:02
clarkbya thats the slow process. The first compile takes like 2 minutes on our test nodes. Then more than an hour to do the extra steps18:03
sean-k-mooneyah so the same approch as autotools18:03
sean-k-mooneyor cmake18:03
fungicorrect18:03
fungiso the added time spent doing an optimized build outweighs the performance gains for the job run with it18:04
sean-k-mooneyright that why i was suggetign that perhaps using uv to provide pre built binaries might not be terribel.18:06
clarkbsure. I'm just saying that in practice building it seems fine18:07
clarkbyou get a python that is basically the same performance as a prebuilt python18:07
clarkband the cost to build is relative small18:07
clarkbzuul-jobs already knows how to manage uv. You would just need to expand ensure-python to use it to fetch python as a pyenv alternative to test it18:08
sean-k-mooneyack. i wasnt wored about the perforamce of the resultant python, more the time/reliablity in a job18:08
sean-k-mooneyto be fair18:08
sean-k-mooneyi dont think i have ever seen the pyenv based jobs fail to build18:08
sean-k-mooneyso im not that concerned18:09

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