Tootfinder

Opt-in global Mastodon full text search. Join the index!

@mgorny@social.treehouse.systems
2025-06-29 16:44:37

So #Gentoo #Python eclasses are pretty modern, in the sense that they tend to follow the best practices and standards, and eventually deal with deprecations. Nevertheless, they have a long history and carry quite some historical burden, particularly regarding to naming.
The key point is that the eclasses were conceived as a replacement for the old eclasses: "distutils" and "python". Hence, much like we revision ebuilds, I've named the matching eclasses "distutils-r1" and "python-r1". For consistency, I've also used the "-r1" suffix for the remaining eclasses introduced at the time: "python-any-r1", "python-single-r1" and "python-utils-r1" — even though there were never "r0"s.
It didn't take long to realize my first mistake. I've made the multi-impl eclass effectively the "main" eclass, probably largely inspired by the previous Gentoo recommendations. However, in the end I've found out that for the most use cases (i.e. where "distutils-r1" is not involved), there is no real need for multi-impl, and it makes things much harder. So if I were naming them today, I would have named it "python-multi", to indicate the specific use case — and either avoid designating a default at all, or made "python-single" the default.
What aged even worse is the "distutils-r1" eclass. Admittedly, back when it was conceived, distutils was still largely a thing — and there were people (like me) who avoided unnecessary dependency on setuptools. Of course, nowadays it has been entirely devoured by setuptools, and with #PEP517 even "setuptools" wouldn't be a good name anymore. Nowadays, people are getting confused why they are supposed to use "distutils-r1" for, say, Hatchling.
Admittedly, this is something I could have done differently — PEP517 support was a major migration, and involved an explicit switch. Instead of adding DISTUTILS_USE_PEP517 (what a self-contradictory name) variable, I could have forked the eclass. Why didn't I do that? Because there used to be a lot of code shared between the two paths. Of course, over time they diverged more, and eventually I've dropped the legacy support — but the opportunity to rename was lost.
In fact, as a semi-related fact, I've recognized another design problem with the eclass earlier — I should have gone for two eclasses rather than one: a "python-phase" eclass with generic sub-phase support, and a "distutils" (or later "python-pep517") implementing default sub-phases for the common backends. And again, this is precisely how I could have solved the code reuse problem when I introduced PEP517 support.
But then, I didn't anticipate how the eclasses would end up looking like in the end — and I can't really predict what new challenges the Python ecosystem is going to bring us. And I think it's too late to rename or split stuff — too much busywork on everyone.

@jtk@infosec.exchange
2025-08-02 10:28:43

Spent 30 minutes to discover #Python's csv module, which I've used often for years, defaults to CRLF on output regardless of what the source file's line endings are and what your local environment is.
I was converting a TSV to CSV and puzzling over why the resulting file was larger.
I will have to remember to set lineterminator='\n' going forward. Lossless compres…

@datascience@genomic.social
2025-06-03 10:00:01

Video tutorials for modern ideas and open source tools. #python

@Gord1i@fosstodon.org
2025-08-03 06:50:13

A fixture of the local and continental #Python, @… has done well with their keynote this year!

@mgorny@social.treehouse.systems
2025-07-01 16:20:14

One of the goals I've set for further development of #Python eclasses in #Gentoo was to avoid needless complexity. Unfortunately, the subject matter sometimes requires them. However, many of the functions added lately were already manually done in ebuilds for years.
We've started disabling plugin autoloading years ago. First we just did that for individual packages that caused issues. Then, for these where tests ended up being really slow. Finally, pretty much anywhere `python_test()` was declared. Doing it all manually was particularly cumbersome — all I needed for `EPYTEST_PLUGINS` is a good idea how to generalize it.
Similarly, `EPYTEST_XDIST` was added after we have been adding manually `epytest -p xdist -n "$(makeopts_jobs)" --dist=worksteal` — and while at it, I've added `EPYTEST_JOBS` to override the job count.
Perhaps `EPYTEST_TIMEOUT` wasn't that common. However, it was meant to help CI systems that could otherwise get stuck on hanging test.
Similarly, "standard library" version (like `3.9`) matching to `python_gen_cond_dep` was added after a long period of explicitly stating `python3_9 pypy3`. As an extra benefit, this also resolved the problem that at the time `pypy3` could mean different Python versions.

@rasterweb@mastodon.social
2025-06-30 17:35:03

I still need to get around to automating this stuff a bit more, but for now I just type a few numbers each month for my biking stats...
#bikeTooter #python

A chart showing hours biked per month.
A chart showing miles biked per month.
@JGraber@mastodon.social
2025-08-01 09:54:47

#Python Friday #290: Record Audio With #PyAudio
pythonfriday.dev/2025/08/290-r

@frankel@mastodon.top
2025-05-31 16:05:00

Apache Fury (incubating)
#java #python

@kubikpixel@chaos.social
2025-07-19 13:10:05

fstrings.wtf
How good is your knowledge of Python f-strings?
:python: #python #fstrings

@guerda@ruhr.social
2025-05-30 14:31:13

Kennt jemand gute Video-Kurse /#eLearning / #mmoc für Datenanalyse mit #Python? Am Besten für Programmieranfänger*innen und auf Deutsch.
Googlen kann ich selbst, Erfahrungen wären super.
:boost_ok:

@mgorny@pol.social
2025-07-28 19:07:29

Kolejna "poważna" luka bezpieczeństwa w języku #Python.
I po raz kolejny informacja o niej trafiła do sekcji "Library" pliku NEWS, a nie do "Security".
cve.org/CVERecord?id=…

@michabbb@social.vivaldi.net
2025-07-29 21:18:16

#Semgrep static analysis tool for #code scanning at ludicrous speed 🔍
🔍 Supports 30 languages including #Python

@nobodyinperson@fosstodon.org
2025-07-13 17:27:19

Nice, #Python 3.9 is very soon EOL [1], so it is finally fine to use Structural Pattern Matching [2] (i.e. the `match` statement, a `switch` on steroids) everywhere! 🥳
[1] devguide.python.org/versions/

Screenshot of linked website, gantt chart of Python version lifetimes, cascading. Python 3.9 obly has a little bit of bar left.
@dennisfaucher@infosec.exchange
2025-05-19 18:08:41

TIL: #UV
#Python

@jamesthebard@social.linux.pizza
2025-07-10 18:15:40

So while the Z80 project on Rust is going very, very slowly, the Python side is going pretty well. Got all of the registers and flags implementations mostly done including 16-bit register swaps (EX) and full prime swapping (EXX). Using `enum.IntFlag` to set/clear flags in the F register as well which helps with legibility.
#python

@harrysentonbury@social.linux.pizza
2025-07-22 11:33:03

idk.
#python #audio
github.com/spotify/pedalboard/

@jovian34@social.linux.pizza
2025-05-30 15:18:34

Switched my most updated #Django project to #uv this morning. I was using vanilla pip and venv and building #Python from source before.
—That was it? —
Seemed crazy too easy. It all just w…

@mgorny@social.treehouse.systems
2025-06-04 02:28:36

When you spend an hour backporting #CPython #security fixes to all versions of #Python #Gentoo, because there was no planned security release, and a few hours later you spend time again bumping to the unexpected security releases.
And then you are surprised why you didn't mask Python 3.8 yet, and repeat the same mistake.
Oh, and ofc update your CPython and PyPy (fixed PyPy only in Gentoo).

@mgorny@pol.social
2025-05-28 13:02:40

Paczka Pythona, której nie idzie zainstalować na Pythonie 3.14, bo autor koniecznie musiał zaimplementować przetwarzanie AST na ponad 200 linii w `setup.py`? Dlaczego nie.
#Gentoo #Python #setuptools

@JGraber@mastodon.social
2025-05-16 16:15:25

#Python Friday #279: Sentiment Analysis in Python - #ai
pythonfriday.dev/2025/05/279-s

@mgorny@social.treehouse.systems
2025-08-01 10:22:12

#Matplotlib has a lot of "image comparison tests" that are horrible fragile. Technically, most of them permit some deviation from the reference images, but quite often I've been getting higher RMS than that. So for a long time, we've been maintaining patches that increased the tolerance in tests, and regularly either had to be rebased and updated for new tests.
At some point upstream started adding conditions permitting higher tolerance on non-x86_64 platforms. Of course, these changes forced me to rebase our patches. Curious enough, my previous overrides often happened to be close to the tolerance given for non-x86_64 platforms.
Today, it finally occurred to me that instead of updating the patch once again, I can try dropping it entirely and just sed-ing all `platform.machine() == 'x86_64'` with `False`. And guess what — down to 3 failures (related to TeΧ). And I don't have to spend 15 minutes manually doing what effectively accounted to the same thing.
#Gentoo #Python

@jamesthebard@social.linux.pizza
2025-07-25 15:31:29

Got the Roll Dice dialog box themed up about as nice as its going to get. Still might make it a touch smaller though.
#pathfinder2e #python #programming

The Pathfinder 2E TUI character sheet's new feature of rolling dice in the TUI.  The dialog box for the dice roll is now themed like the rest of the information.
@stephane_klein@social.coop
2025-07-17 14:40:06

Comment perdre deux heures bêtement avec #Requests #python et sa fonction Content-Type multipart :
notes.sklein.xyz/2025-07-17_15

@JGraber@mastodon.social
2025-06-13 07:48:53

#Python Friday #283: Play Audio Files in Python
pythonfriday.dev/2025/06/283-p

@hynek@mastodon.social
2025-06-09 11:19:51

no shade, but if your import path starts with `src.`, you haven’t understood the purpose of an src directory.
The fact that VS Code gets this wrong when fixing imports in tests is concerning.
#Python

@veit@mastodon.social
2025-06-10 05:06:41

Today the workshop on test driven development for updating legacy software starts. #TDD #Python

@nobodyinperson@fosstodon.org
2025-06-20 11:54:49

TIL that #Python's strptime can't handle unix timestamps, wtf... 😑
time.strptime("1750420325","%s")
ValueError: 's' is a bad directive
(Yes, I know there's datetime.fromtimestamp, but here I'd much prefer to keep everything with %Y %m %d et al. due to reasons)

@mgorny@social.treehouse.systems
2025-07-26 13:30:55

New on blog: "EPYTEST_PLUGINS and other goodies now in #Gentoo"
"""
If you are following the gentoo-dev mailing list, you may have noticed that there’s been a fair number of patches sent for the #Python eclasses recently. Most of them have been centered on #pytest support. Long story short, I’ve came up with what I believed to be a reasonably good design, and decided it’s time to stop manually repeating all the good practices in every ebuild separately.
In this post, I am going to shortly summarize all the recently added options. As always, they are all also documented in the Gentoo Python Guide.
"""
blogs.gentoo.org/mgorny/2025/0

@rasterweb@mastodon.social
2025-06-05 15:33:07

Okay, spent a little time with Python's Matplotlib to get this graph of miles biked so far this year...
At some point I should be able to pull the data from Run Gap's SQLite database to automate this more, and get more granular.
I still need to figure out how to space the bars and some other formatting stuff but it's a good start!
#python

A bar graph showing miles I've ridden my bike this year (by month).
@JGraber@mastodon.social
2025-07-25 10:02:08

#Python Friday #289: Record Audio With Sounddevice
pythonfriday.dev/2025/07/289-r

@jamesthebard@social.linux.pizza
2025-07-18 00:11:46

Time to write a dice roller...gonna use `lark` to parse the string so I can just type out the roll and add tags for the damage types and let it do the math. Is it overkill? Yes. Does it work? No, not yet...but that's the fun part.
#python #lark

The initial parser rules for processing dice written in Python using Lark as the parser.
@mgorny@pol.social
2025-06-21 05:49:07

Osobiście, polecałbym trzymać się z daleka od "#Python Code Quality Authority". Projekty tej organizacji zostały właściwie przejęte przez wyjątkowo toksyczną osobę. #Ruff to dobra alternatywa, z bardzo przyjaznymi autorami.

@stephane_klein@social.coop
2025-06-13 12:42:32

Je viens de découvrir la fonction "inspect.cleandoc" de la librairie standard de #Python.
notes.sklein.xyz/2025-06-13_14

@JGraber@mastodon.social
2025-05-30 09:24:29

#Python Friday #281: Language Detection in Python - #ai #nlp

@jovian34@social.linux.pizza
2025-05-15 17:28:38

I will be giving my first #Python talk at PyOhio in July. Very excited!
pyohio.org/2025/program/talks/

@michabbb@social.vivaldi.net
2025-07-13 20:50:52

Agentic Document Extraction – #Python Library for Complex Document Processing 📄
powered by landing.ai
🔍 Extracts structured data from complex documents with tables, pictures & charts - retu…

@pre@boing.world
2025-05-10 11:39:45

The Python library "YFinance" decided to force an upgrade. They did this by making the old version report a rate-limit error on every request.
Confusing.
Would have been better if they reported a "old version not supported" error or something instead. So that wasted some time.
That upgrade had dependencies which have dependencies upon a newer version of Python, so needed a whole OS upgrade really.
Which failed. Bricking the Rasp PI it was running on.
Oh well, complete rebuild of the whole machine and software it runs from scratch then.
That took all day yesterday. At the end I notice that the touch-screen doesn't touch. Needs drivers.
The drivers haven't been upgraded in six years. They brick the machine again when trying to install them on Debian Trixie.
Luckily, I kept good notes and could rebuild it all again much faster with no mistakes and knowing what to do and all the required custom software changes already made and saved.
So now I spent a whole day on annoying upgrade work because a single Python library decided to break the old version, and my Rasp Pi has no touch-screen. Which isn't ideal for a machine mostly operating as a fancy light switch for all the LED strips in the house.
This happens all the time in software. Millions of man hours wasted, so much hardware dumped because the drivers get abandoned.

In other news: Microsoft abandons Windows 10 any day now. Good luck to everyone faced with doing that lap on the upgrade treadmill.
I still have more work to do to bring up this RaspPi's software to where it was, but it'll have to wait, other things to do. At least it's back to sending me the nightly finance report and controlling the LED strips. If without a touch screen now.
#software #upgradeTredmil #python #microsoft

@mgorny@social.treehouse.systems
2025-07-25 17:34:51

If someone wants to investigate a curious issue:
#Python 's subprocess module reports the exit status for a signaled process as (128 signal) for upstream (similarly to how bash's `$?` works), but -signal (as documented) for me.
#Gentoo #Linux

@guerda@ruhr.social
2025-06-09 08:03:59

Nachdem die Frage zu spezifisch scheint: Kann jemand einen Videokurs, online Kurs, elearning etc. für #Python empfehlen?
Am Besten auf Deutsch.
Dankeschön!
:boostRequest:
ruhr.social/@guerda/114…

@mgorny@social.treehouse.systems
2025-07-24 03:59:47

#Python world be like:
"Oh, hi, we wrote a new library implementing this spec."
"Hey, it looks like it doesn't conform to the spec, it doesn't pass the examples from it."
"Oh, you're right, we'll fix it ASAP."
…and that was over 3 years ago.
And yet projects keep adding a dependency on this library which has a single "pre-alpha" release 3.5 years ago and whose very first bug report points out it's incorrect.

@mgorny@social.treehouse.systems
2025-06-22 15:02:24

Modern programmers: "oh, let's hijack all #Python package managers in your bashrc without asking for consent, what could possibly go wrong."
And the best joke is, I didn't even really install the package — I was just making a random bugfix and running its test suite in a virtual environment.
#Gentoo #security

@JGraber@mastodon.social
2025-07-18 11:11:10

#Python Friday #288: 5 Helpful Tricks for #UV
pythonfriday.dev/2025/07/288-5

@mgorny@pol.social
2025-06-21 06:37:03

Wspaniały dzisiejszy #Python: #Gentoo uruchamia testy w paczkach związanych z #ProtoBuf z pomocą #PyTest-forked, żeby obejść s…

@mgorny@social.treehouse.systems
2025-07-22 15:29:46

@…, do you think we should aim at replacing `flaky` with `pytest-rerunfailures`? I see quite a lot of #Python packages are using `@flaky.flaky` decorator directly, even though they are using #pytest otherwise.

@jamesthebard@social.linux.pizza
2025-07-22 16:59:20

After some refactoring, learning about `hatch`, moving more files around, and generally abusing `test.pypi.org`: I've uploaded `diceparse` to PyPI. Still need to update the web documentation, but it now feels like a proper project at this point.
I still need to add a CLI part so you can just roll dice after installing the package, but I'll handle that later. Also need to tweak the README.md a bit as well...

A screenshot of the `diceparse` package in PyPI on version 1.0.6.
@JGraber@mastodon.social
2025-07-22 19:05:54

Freshly blogged: Awesome Awesomeness List #dotNet #Python #ai

@mgorny@social.treehouse.systems
2025-07-15 14:24:39

New in #Python world: #setuptools now vendors deep dependencies with LGPL license. Not that I do mind (but some people and companies do!) — but these dependencies aren't even used! I mean, `autocommand` is just a dependency of some scripts in `jaraco.text` that aren't used by setuptools.
Oh, wait, I actually do care, because I need to fix LICENSE in dev-python/ensurepip-setuptools.
github.com/pypa/setuptools/iss
github.com/pypa/setuptools/iss

@mgorny@pol.social
2025-06-07 08:38:34

Czas na okresową kontrolę katalogu ~/.cache:
ccache: 4G
uv: 2.2G
pre-commit: 2.1G
rattler: 1.7G
mozilla: 1.1G
thumbnails: 1G
evolution: 550M
fotema: 511M
pip: 404M
Kto by tam zakładał, że /home nie jest nieograniczone?
#Gentoo #Python

@mgorny@social.treehouse.systems
2025-07-20 16:33:43

Always nice when upstream accepts a trivial fix even though the obvious bug doesn't affect them right now.
#Gentoo #Python

@jamesthebard@social.linux.pizza
2025-07-20 07:39:20

Got the documentation for the dice parser software online and now I can close the laptop and relax a bit. I think it still needs some cleaning up, but it's good enough for now.
#python

A screenshot of the front page of the DiceParser documentation written using mkdocs.
@mgorny@social.treehouse.systems
2025-07-28 19:06:50

Yet another "HIGH severity" vulnerability in #Python.
Once again found in "Library" section of the NEWS, not in "#Security".
cve.org/CVERecord?id=CVE-2025-
github.com/python/cpython/pull

@JGraber@mastodon.social
2025-06-06 05:56:19

#Python Friday #282: Working With Temporary Files
pythonfriday.dev/2025/06/282-w

@mgorny@social.treehouse.systems
2025-05-28 13:01:55

A #Python package that can't be installed on Python 3.14, because the author had to implement a 200 line custom AST parser in `setup.py`? Yeah, why not.
#Gentoo #packaging #setuptools

@JGraber@mastodon.social
2025-06-27 11:31:13

#Python Friday #285: Intermediate Text-to-Speech With Pyttsx3 #ai #nlp

@mgorny@social.treehouse.systems
2025-06-15 18:25:39

What am I doing instead of resting? Well, I'm playing with generating EPYTEST_DESELECT from `epytest --junit-xml=…`
#Gentoo #PyTest #Python

@nobodyinperson@fosstodon.org
2025-07-14 09:24:46

Wait, does #uv just make #Python work without #FHS shenanigans on :nixos: #NixOS? 🤨

@michabbb@social.vivaldi.net
2025-07-13 20:41:18

Works with #Python #JavaScript #TypeScript #Go supporting frameworks like

@mgorny@social.treehouse.systems
2025-06-07 08:38:34

Time for the periodic check of my ~/.cache directory:
ccache: 4G
uv: 2.2G
pre-commit: 2.1G
rattler: 1.7G
mozilla: 1.1G
thumbnails: 1G
evolution: 550M
fotema: 511M
pip: 404M
Not assuming infinite space in home directory is overrated.
#Gentoo #Python

@mgorny@social.treehouse.systems
2025-05-29 05:33:57

A bad #Python bump morning in #Gentoo:
1. A project that couldn't be bothered to make a release with a security fix for 4 years finally made a release. Of course, if you make one release in 7 years, it is definitely a good idea to replace your build system with a broken #PythonPoetry #setuptools hybrid.
2. Another project made a release with a bunch of test failures — that were fixed in "master" branch already at the time, but I guess nobody bothered testing the release branch.
3. Just discovered that a bunch of projects are using pkg_resources namespaces again — and we were supposed to have gotten rid of them years ago! Of course it's #Google. And on top of that, since pkg_resources are now throwing deprecation warnings, they are indirectly breaking random other test suites.
On the positive side, test_lolwut is failing for me in redis-py.

@mgorny@social.treehouse.systems
2025-07-29 11:43:40

When you use #RustLang to write safe code, but what you get is a data corruption #heisenbug instead.
#Gentoo #Python

@JGraber@mastodon.social
2025-05-23 15:43:50

#Python Friday #280: Sentiment Analysis With #Bert of #Goodreads Reviews - #ai

@JGraber@mastodon.social
2025-06-20 06:46:08

#Python Friday #284: Basic Text-to-Speech With Google Translate #ai #nlp

@mgorny@social.treehouse.systems
2025-05-27 10:34:30

#Python #packaging be like:
"Remember the totally random #PyTest plugin that died in 2018, that we forced you to add to #Gentoo, because we decided to start using it for no good reason? Well, we just stopped. Also, we just found a #NIH plugin that reinvents flaky test handling for the third time, enjoy!"
(Fortunately, it's compatible enough with pytest-rerunfailures, so we can ignore it.)

@jamesthebard@social.linux.pizza
2025-07-07 14:51:00

AHAHAHA COME AT ME AI
#programming #python #mos6502 #assembly

A screenshot of the mos6502 codebase in VSC along with the `pytest` results.
@mgorny@social.treehouse.systems
2025-06-21 06:35:50

Nowadays in quality #Python: #Gentoo is running #ProtoBuf-related test suite via #PyTest-forked to workaround protobuf segfaulting during GC.
Of course, it implies random programs can segfault on exit too.
github.com/protocolbuffers/pro
gitweb.gentoo.org/repo/gentoo.

@mgorny@social.treehouse.systems
2025-06-24 04:38:06

Yes, yes, please fork #PythonRequests and a bunch of other high-profile #Python libraries as its dependencies, and add some more #NIH dependencies to that. Oh, yes, and definitely overwrite the original packages in the process! What could possibly go wrong?
#packaging

@mgorny@social.treehouse.systems
2025-05-28 05:00:15

#PyYAML rejected #freethreading support. As a result, a new fork has been created with freethreading support. Given the fork's focus on freethreading, it supports only Python 3.13 . Given the lack of environment markers for freethreading (yet), packages end up depending on PyYAML-ft for >=3.13 (including non-freethreading builds), and PyYAML for <3.13.
Isn't #Python #packaging great?
#Gentoo

@JGraber@mastodon.social
2025-05-09 11:20:02

#Python Friday #278: Optimise the #LLM Client - #AI

@mgorny@social.treehouse.systems
2025-06-23 19:52:19

In other news, I've sent a few fun patches to improve epytest in #Gentoo.
This includes forcing short summaries, creating junit .xml for machine processing, and most importantly, EPYTEST_PLUGINS to handle specifying the plugins to load. The goal is to eventually move away from plugin autoloading by default.
#PyTest #Python

@JGraber@mastodon.social
2025-07-11 10:44:45

#Python Friday #287: #PyTorch With #GPU Support - #ai

@JGraber@mastodon.social
2025-07-04 13:12:18

#Python Friday #286: Advanced Text-to-Speech With Coqui TTS - #ai #nlp

@mgorny@social.treehouse.systems
2025-06-16 10:22:27

Some fun facts about #Python limited API / stable ABI.
1. #CPython supports "limited API". When you use it, you get extensions that are compatible with the specified CPython version and versions newer than that. To indicate this compatibility, such extensions use `.abi3.so` suffix (or equivalent) rather than the usual `.cpython-313-x86_64-linux-gnu.so` or alike.
2. The actual support is split between CPython itself and #PEP517 build systems. For example, if you use #setuptools and specify `py_limited_api=` argument to the extension, setuptools will pass appropriate C compiler flags and swap extension suffix. There's a similar support in #meson, and probably other build systems.
3. Except that CPython freethreading builds don't support stable ABI right now, so building with "limited API" triggers an explicit error from the headers. Setuptools have opted for building explicit about this: it emits an error if you try to use `py_limited_api` on a freethreading interpreter. Meson currently just gives the compile error. This implies that package authors need to actively special-case freethreading builds and enable "limited API" conditionally.
4. A some future versions of CPython will support "limited API" in freethreading builds. I haven't been following the discussions closely, but I suspect that it will only be possible when you target that version or newer. So I guess people will need to be building two stable ABI wheels for a time — one targeting older Python versions, and one targeting newer versions plus freethreading. On top of that, all these projects will need to update their "no 'limited API' on freethreading" conditions.
5. And then there's #PyPy. PyPy does not feature a stable ABI, but it allows you to build extensions using "limited API". So setuptools and meson just detect that there is no `.abi3.so` on PyPy, and use regular suffix for the extensions built with "limited API".

@mgorny@social.treehouse.systems
2025-06-21 05:47:56

My personal recommendation would be to stay away from the "#Python Code Quality Authority". The projects have been pretty much taken over by a toxic and mean-spirited person. #Ruff is a good replacement, with very friendly upstream.
#PyCQA

@mgorny@social.treehouse.systems
2025-07-05 15:24:22

A while ago, I've followed the example given by #Fedora and unbundled ensurepip wheels from #Python in #Gentoo (just checked — "a while ago" was 3 years ago). This had the important advantage that it enabled us to update these wheels along with the actual pip and setuptools packages, meaning new virtual environments would get fresh versions rather than whatever CPython happened to bundle at the time of release.
I had considered using our system packages to prepare these wheels, but since we were already unbundling dependencies back then, that couldn't work. So I just went with fetching upstream wheels from PyPI. Why not build them from source instead? Well, besides feeling unnecessary (it's not like the PyPI wheels are actually binary packages), we probably didn't have the right kind of eclass support for that at the time.
Inspired by @…, today I've tried preparing new revisions of ensurepip packages that actually do build everything from source. So what changed, and why should building from source matter now? Firstly, as part of the wheel reuse patches, we do have a reasonably clean architecture to grab the wheels created as part of the PEP517 build. Secondly, since we're unbundling dependencies from pip and setuptools, we're effectively testing different packages than these installed as ensurepip wheels — and so it would be meaningful to test both variants. Thirdly, building from source is going to make patching easier, and at the very least enable user patching.
While at it, I've refreshed the test suite runs in all three regular packages (pip, setuptools and wheel — we need an "ensurepip" wheel for the last because of test suites). And of course, I hit some test failures in testing the versions with bundled dependencies, and I've discovered a random bug in #PyPy.
github.com/gentoo/gentoo/pull/ (yes, we haven't moved yet)
github.com/pypy/pypy/issues/53

@mgorny@social.treehouse.systems
2025-06-06 05:13:54

New reason not to use #PythonPoetry just dropped: they reinvented "reproducible builds", poorly. The problem is, they missed the purpose of reproducible builds entirely and they use it for source distributions too, and when you don't use SOURCE_DATE_EPOCH, they force all files to epoch (as in timestamp 0) instead of leaving them alone.
Like, all source distributions created by Poetry and uploaded to #PyPI now have 1970 timestamps that, simply speaking, break stuff. The most absurd thing is that ZIP can't handle that timestamp, so they override it and use another date for wheels 🤦.
#Gentoo #PEP517