Tootfinder

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

@JGraber@mastodon.social
2024-04-26 18:00:49

#Python Friday #224: Better HTTP Status Codes for #FastAPI
impro…

@MrBerard@pilote.me
2024-04-27 09:15:28

If you are learning Python, I'm making a clicker-style game (but that doesn't threaten the lifespan of your mouse) at 1400 BST (1300 UTC).
Live coding: Cookie clicker, but without clicking (or cookies) #python #...

@crell@phpc.social
2024-05-17 13:14:04

No, #Python, this really is a gotcha, and a stupid one at that.
docs.python-guide.org/writing/

@mgorny@social.treehouse.systems
2024-06-18 04:37:38

Now in #Python discussion forums: #Apple apparently has some broken auto-review that rejects everything including Python, because of — apparently — `itms-services://` occurring inside Python's standard library (in tests).
#GAFAM

@hynek@mastodon.social
2024-05-13 15:59:34

Before I start churning out my pre-PyCon releases, how about a build-and-inspect-python-package that adds GitHub-style build provenance attestations by just adding one setting (and one permission)!? #python

@veit@mastodon.social
2024-06-09 10:00:48

Whow, #Python leads the current Tiobe Index by a wide margin: python-basics-tutorial.readthe

Tobe Index in June 2024
@nobodyinperson@fosstodon.org
2024-06-12 11:47:47

Missing: a :python: #Python package to make flowcharts with #pythonRich, i.e. to draw arrows between (auto-arranged) renderables.
g…

@frankel@mastodon.top
2024-06-08 17:12:02

#Python's many command-line utilities
pythonmorsels.com/cli-tools/

@carloshr@lile.cl
2024-06-17 15:07:09

El gran problema de #python es el puto indentado. Si llegas a combinar tabulación y espacios todo se vuelve un caos 😫

@jamesthebard@social.linux.pizza
2024-06-14 13:26:00

So, looks like the way the Python `requests` module parses string arrays into parameters was very different than what the NWS API was looking for so I was only getting `Severe` watches and warnings and none of the `Extreme` ones. It's already been a busy morning...lol. #python #weather

@mgorny@social.treehouse.systems
2024-06-15 08:59:00

I've added `dev-python/legacy-cgi` to #Gentoo, as a "forward-port" of the removed #Python `cgi` (and `cgitb`) module to Python 3.13. That said, it's only a stop-gap solution to make semi-dead packages work and not something you should rely on, so it's marked as deprecated immediately after being added.
Also, ideally please avoid keeping it installed in your dev environments. Once installed, all `import cgi` statements will suddenly start working, so you're going to miss Python 3.13 incompatibility issues (and therefore miss the dependency on this package).

@mgorny@pol.social
2024-06-17 15:54:11

Czasem ludzie się mnie pytają, dlaczego stabilizuję paczki Pythona w #Gentoo po dwóch tygodniach, zamiast typowych czterech.
Odpowiedź jest prosta: oczekiwać, że testy w paczkach Pythona nadal będą działać cztery tygodnie po wydaniu to trochę dużo.
#Python

@datascience@genomic.social
2024-06-16 10:00:01

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

@underdarkGIS@fosstodon.org
2024-06-06 15:39:59

Note to self: Between #QGIS versions 3.34.5 and 3.34.6, the packaging for the #Windows version of QGIS changed from #Python 3.9 to Python 3.12.
Will have to test if/how

@JGraber@mastodon.social
2024-06-14 18:00:52

#Python Friday #231: Split a #FastAPI Application Into Manageable Parts

@cdp1337@social.veraciousnetwork.com
2024-06-15 14:56:04

Why should folks doing #Development use test-driven development?
I wrote a #Python utility to help me collect and manage systems from a variety of platforms. Originally it started as a one-off so I wasn't concerned about tests, but the code continued to grow as …

@chrysn@chaos.social
2024-05-13 10:39:15

There is a new version, 0.4.8 of aiocoap, the asynchronous #Python library for #CoAP.
Nothing fancy in terms of features, but some improvements on error handling, type annotations (#mypy has joined CI) and platfor…

@mgorny@social.treehouse.systems
2024-05-18 16:19:06

Technically, a large part of what amounts to #Gentoo #Python 3.13 porting could be automated. In fact, we already have most of the pieces — tooling to find next candidates, update PYTHON_COMPAT, run tests. Why do I do it semi-manually then?
Well, for a start it gives me an opportunity to look into the ebuilds. Look for old issues, improve code, sometimes discover we ought to have removed something a long time ago. At the same time, looking at build logs also sometimes makes me notice incorrectly working tests (particularly, tests not failing correctly on failure).
Not to mention it gives me a bit of purpose when the damn fever prevents me from doing anything requiring more focus.

@joe@toot.works
2024-05-31 13:23:36

If anyone wants to come hang out with me later, I am giving a short "Crafting Intelligent Python Apps with Retrieval-Augmented Generation" talk online at 12:30 (Milwaukee time)
#AI #RAG #Python

@crell@phpc.social
2024-05-13 15:27:09

Teaching #Python folks the joys of clear and explicit object type definitions. An interesting experience...
#Programming

@farshidhakimy@chaos.social
2024-05-09 12:16:00

Kann man in #Python eigentlich Variablen z.B. mit #Redis oder anderen Key-Value-Stores ersetzen und dabei so wenig Code wie möglich verändern?
Sodass die Variablen sozusagen auf allen Servern in Echtzeit den gleichen Wert haben?

@jamesthebard@social.linux.pizza
2024-06-11 20:01:21

Ah, things I found interesting...
- Figuring out if there are `NaN` numbers in a Python list: `any(i != i for i in float_list)`.
- Replacing single newlines while ignoring double newlines: `"\n\n".join([i.replace("\n", ' ') for i in cool_string.split("\n\n")])`
#python

@kernellogger@fosstodon.org
2024-05-30 17:50:20

Wait, what? Building #Linux now (e.g. since [1], which is in 6.10-rc1) requires #python[2]? At least when building the msm graphics driver? Uhh, interesting. 🧐
[1]

@underdarkGIS@fosstodon.org
2024-06-06 15:39:59

Note to self: Between #QGIS versions 3.34.5 and 3.34.6, the packaging for the #Windows version of QGIS changed from #Python 3.9 to Python 3.12.
Will have to test if/how

@mgorny@social.treehouse.systems
2024-04-26 18:52:25

Great, #IPython finally fixed #PyTest 8 compatibility.
Oh, wait… they've just fixed one trivial issue and declared it fixed, without actually testing at all or looking at the bugs already reported. Quality work!
#Gentoo #Python

@JGraber@mastodon.social
2024-05-24 18:00:16

#Python Friday #228: HTTP Basic #Authentication in #FastAPI #security

@mgorny@pol.social
2024-06-16 17:26:17

Ćwiczenie na dziś: ile paczek #Gentoo uda się sportować do Pythona 3.13 w czasie, który potrzeba na zbudowaniu paczek binarnych dla nowych jąder.
Następne w kolejce jest ćwiczenie trudnego `git rebase`.
#Python

@UP8@mastodon.social
2024-06-06 10:39:38

🧮 50x faster conda environment solving with "sharded" repodata
(… nice to see that Python packaging systems are finally discovering that cache matters!)
prefix.dev/blog/sharded_repoda

@simon_brooke@mastodon.scot
2024-04-29 15:18:30

The available open source libraries for generating human models (MakeHuman, ManuelBastioniLab) appear to be written in #Python. I need something like this, but I'm working primarily in #Clojure. I'm wondering whether it would be easier to load one of the existing libraries into Jython and try to …

@tinoeberl@mastodon.online
2024-05-30 17:29:48

Kann man #Python eigentlich auf einem alten #Android Handy laufen lassen?
Bestimmt, oder? 🤔
Und Cron-Jobs?
Bestimmt, oder? 🤔

Ein Comic-Fragezeichen mit neugierigen Augen.
@mrysav@social.linux.pizza
2024-06-11 02:15:19

One thing that #python has on #ruby is that - to my eyes - I can write a mess of spaghetti code without running it in python and think "I think this is going to work."
Of course, running it is key...

@hynek@mastodon.social
2024-05-11 07:44:02

Come for wisdom on tox & Nox – stay for unrelated gems that will improve your life! #python #video
youtu.be/ImBvrDvK-1U

@mgorny@social.treehouse.systems
2024-05-27 04:05:49

If anyone is still wondering whether #setuptools is a good #PEP517 build system, let me point out that right now it vendors… (checks notes) 12 packages, including two different versions of more-itertools.
Of these packages, 5 use setuptools and 1 uses hatchling. Ironically, it's the packages maintained by setuptools upstream that use the former and therefore introduce cyclic dependencies. Third parties seem to be more concerned that their packages are used by setuptools and therefore should use minimal build systems to avoid the cyclic dependency problem.
In other news, setuptools finally acknowledged the cyclic bootstrap problem with `wheel`, and started vendoring it.
#Gentoo #Python

@nobodyinperson@fosstodon.org
2024-05-04 11:42:49

I think I have finally™️ (for the third or so time) found myself a solution for :python: #Python development on :nixos: #NixOS that allows me to just work with #pythonPoetry et. al. as on other distros.

@MrBerard@pilote.me
2024-05-12 10:53:33

BeeTeeDubs, I'm going live in ten with a #LiveCoding #Python Tutorial drawing flags with turtle graphics.
Really it's about abstraction and decomposition.
#ComputerScience

@JGraber@mastodon.social
2024-06-07 18:01:49

#Python Friday #230: Fix the PydanticJsonSchemaWarning in #FastAPI

@jamesthebard@social.linux.pizza
2024-06-10 21:26:16

Severe Thunderstorm Watch here in Charleston, SC, which means it's time to breakout the NWS program...now using `webfsd` to serve the generated images. I am skipping a few types of events, but it's nice to have a real-time thread of watches/warnings as they come in. #weather #python

A screenshot of two terminal windows and Visual Studio Code being open on a desktop.  The top-left terminal window shows the processed NWS events to include the event type, area, and the filename of the image generated.  The terminal window on the top-right shows webfsd serving the images generated.  The VSC window shows the update Python code to process the alerts as they come in.
@cdp1337@social.veraciousnetwork.com
2024-05-09 05:11:23

#Python
As I'm working on my #networking diagnostic script which relies on my OS abstraction layer for system information I built a number of years back, I decided it would make more sense to formally port this API up to pypi as a standalone library. (It doesn…

@mgorny@social.treehouse.systems
2024-05-12 13:11:12

These is one of these days when it occurs to you: "hey, packages using #Python and #RustLang, may have *both* Python and Cargo-level tests." And then you spend a lot of time going over all Rust-enabled dev-python/* packages and adding `cargo_src_test` where appropriate.
As it turns out, many of them did. Most of these don't actually link to libpython, so I suppose it's fine to test them once. Pydantic-core does, so I test per-impl (but also can't test on PyPy). Cryptography has Rust-level tests that don't even build (they fail at linking).
#Gentoo

@mgorny@pol.social
2024-06-14 15:57:23

Po kolejnej rundzie portów do Pythona 3.13 w #Gentoo, przychodzi mi do głowy ten mem z wielką, zatłoczoną autostradą, tyle że z komentarz:
Tylko jeszcze jeden microframework! Obiecuję wam, jeszcze jeden microframework i wszystkie problemy zostaną rozwiązane!
#Python

@joe@toot.works
2024-05-02 22:33:46

I'm close to having @… sorted out. With a new API comes slightly different data points. #python

@mgorny@social.treehouse.systems
2024-04-27 08:16:12

Time for your daily dose of #RustLang complaints. Yep, the ecosystem is doing great.
#UV depends on tokio-tar library. Tokio-tar is broken on #PowerPC, doesn't have a bug tracker (!) and seems to be quite dead, with a bunch of PRs ignored since 2022 (last activity mid-2023). Nevertheless, I've filed a PR to fix PowerPC, with little hope that it'll be merged, released and that we could get UV working on PowerPC.
On top of that, it seems that tokio-tar was forked in early 2021 from async-tar. It doesn't seem to have synced the few commits from 2021, and async-tar is dead since late 2021. But at least it has a bug tracker to keep track of how dead it is.
Rewriting stuff in Rust is great. Maintaining it afterwards for the sake of reverse dependencies isn't.
#Gentoo #Python

@JGraber@mastodon.social
2024-05-03 18:00:50

#Python Friday #225: Set a Response Header With #FastAPI
improvean…

@tinoeberl@mastodon.online
2024-05-28 22:22:29

Hübscher Kommentar im #Quellcode:
# Erstelle eine schöne XML-Struktur
#python 🤪

@astrojuanlu@social.juanlu.space
2024-06-14 08:26:27

Made it safely to #PyDataLondon tutorials! Now attending Adam Hill's one on #Prefect #python #pydata

@jamesthebard@social.linux.pizza
2024-06-12 16:33:06

Hrmm, this might be a slight issue...pretty sure the map shouldn't be "generic white box"... #python

A picture of a Discord embed showing a Flash Flood Warning expiration/update.  The map is just a white rectangle which is a slight issue.
@mgorny@social.treehouse.systems
2024-05-18 17:51:32

One more thing about porting #Gentoo packages to a new #Python version is that every time you discover how many *new* packages are now abandoned and broken. However, the rate at which packages are abandoned is not what's most the most terrifying thing — it's how many other packages still use these packages, years after the last commit, years after distro developers had to start patching them to have them work at all.
I'm talking of clint (2015), I'm talking of passlib (2020, though author reappeared recently), WebOb (2021), Genshi (2022). I'm talking of Bottle whose author doesn't seem to be able to accept `cgi` removal from stdlib. I'm talking of Aesara that used to be a fork of Theano, and that apparently has been forked again. I'm talking of HttpBin that was abandoned in 2018, then revived by PSF, but it's far from being well-maintained right now.
The world has moved on, apparently.

@dennisfaucher@infosec.exchange
2024-05-13 17:06:31

Just stumbled on this now that I have a server with an actual GPU. Host a jupyter server with GPU access.
docker run --gpus all -it --rm -p 10000:8888 -v "${PWD}":/home/jovyan/work quay.io/jupyter/datascience-notebook:2024-04-29
#Docker #AI #Python #NVIDIA

@cdp1337@social.veraciousnetwork.com
2024-05-08 03:33:48

#HomeLab #Python #Linux
Making progress on this network diagnostic script.
Thus far it reports:
Interface...
* name
* type
* status

Terminal application listing technical network stats useful for debugging a network connection
Terminal application listing technical wireless network stats useful for debugging a network connection
@hynek@mastodon.social
2024-05-27 21:46:39

My final act before vacation is done: structlog 24.2.0! #Python
Enjoy a bunch of bug fixes, better Logfmt support, and some optimizations!
github.com/hynek/structlog/rel

@joe@toot.works
2024-05-02 22:33:46

I'm close to having @… sorted out. With a new API comes slightly different data points. #python

@nobodyinperson@fosstodon.org
2024-05-03 11:36:24

Can one pre-build a buildFHSUserEnv in configuration.nix and then have a command like 'fhs' that yanks you into a shell with all your environment.systemPackages in an FHS layout?
All my tries have given me either infinite recursion errors or other problems.
Seems like a way out of the #Python development misery on

@mgorny@social.treehouse.systems
2024-04-25 14:54:23

Essentially, distro developers are firefighters, putting out fires made by careless upstreams.
What I've wasted time on, today:
- making the non-standalone test suite of #Hatchling (sigh) work without #UV again, so that a critical build dependency of a growing number of #Python packages could be tested everywhere
#PassLib not to break random stuff via printing warnings when using newer #BCrypt versions
#ImageIO work using an offline copy of test data, rather than cloning its git repository at the beginning of tests
#Gentoo

@jamesthebard@social.linux.pizza
2024-06-12 20:10:26

Went ahead and posted the code for the NWS weather stuff to GitHub for ya @… however I'm not vouching for its quality. #python #programming

@mgorny@pol.social
2024-05-09 05:41:48

Wczoraj dodałem Pythona 3.13.0b1 do #Gentoo, razem ze wsparciem na poziomie eclass oraz pierwszą partią portów (z PyTestem włącznie).
Na razie tylko dla amd64, bo musimy przetestować mpdecimal.
#Python

@mgorny@social.treehouse.systems
2024-06-17 15:53:22

Sometimes people ask me why I stabilize #Gentoo #Python packages after 2 weeks, rather than following the usual standard of 4 weeks.
The answer is simple: expecting tests in these packages to still pass whole 4 weeks after the release is a bit much.

@jamesthebard@social.linux.pizza
2024-06-05 19:43:27

Alright, I've got the maps being generated and shared via a quick `python -m http.server` command and being fronted by my `nginx` server. Everything looks good from outside the network. Now we wait for the next watch/warning to pop. #programming #python

The output of the script showing new watches/warnings being processed from the NWS API.
@nobodyinperson@fosstodon.org
2024-05-03 11:36:24

Can one pre-build a buildFHSUserEnv in configuration.nix and then have a command like 'fhs' that yanks you into a shell with all your environment.systemPackages in an FHS layout?
All my tries have given me either infinite recursion errors or other problems.
Seems like a way out of the #Python development misery on

@mgorny@social.treehouse.systems
2024-06-16 17:26:43

Today's exercise: checking how many #Gentoo packages can be ported to #Python 3.13, while new kernel binary packages are building.
Then I'm going to have a hard exercise in rebasing.

@jamesthebard@social.linux.pizza
2024-06-12 12:33:26

Ran the NWS updates script overnight, didn't see any errors and the image directory has a ton of images in it which makes me happy. Still have a bit more cleanup to do, but a really good sign. #weather #python

The log output for the script that pulls NWS alerts from the API and generates maps with cool red polygons on it.
A picture of the images directory where all of the NWS alert images are served from.
@mgorny@social.treehouse.systems
2024-06-16 17:26:43

Today's exercise: checking how many #Gentoo packages can be ported to #Python 3.13, while new kernel binary packages are building.
Then I'm going to have a hard exercise in rebasing.

@joe@toot.works
2024-05-30 21:14:08

@… Every time you run the script, it gets the JSON feed from the Kopp’s website, builds a collection in a #ChromaDB vector database, populates it with what today is, what today’s flavor is, and what tomorrow’s flavor is, and then uses that for the embedding. I wasn’t expecting to need to tell it what today’s date is.
#Ollama #Python

@nobodyinperson@fosstodon.org
2024-05-02 13:51:11

What would cause :git: #git to shell out at 'git -C repo fetch --all'?
I call git via #Python's subprocess module (no, not with shell=True) and it apparently shells out to my default :fish_shell: #fishShell

@jamesthebard@social.linux.pizza
2024-06-11 19:16:52

Alright, time to see if all the changes worked. Of course, to test it I'll need nature to provide some severe storms which seems kinda wrong... #python #weather

A picture of the desktop showing two terminal windows, one polling and processing NWS API messages, the other serving generated map images.  Beside those is Visual Studio Code showing part of the map generation code.
@mgorny@social.treehouse.systems
2024-06-14 15:56:27

After another round of #Python 3.13 porting in #Gentoo, I'm imagining that huge crowded highway meme, except it's saying:
Just one more microframework! I promise you, one more microframework and all problems will be solved!

@schrht@social.linux.pizza
2024-06-03 15:59:51

What I could do: Continue working on my flat so that I might eventually have a desk again, with luxuries such as an external screen or an actual keyboard.
What I am doing: Being hunched over my laptop, abusing #Python with the little knowledge I can gather from the back of my brain to write a small application to share my vast collection of reaction

@jamesthebard@social.linux.pizza
2024-06-11 17:50:10

Started cleaning up the code a bit and documenting everything before I post it. There are still a few issues, but the app runs solidly enough to process the NWS API messages at a regular interval. #python #weather

A screenshot of Visual Studio Code showing the `Bounds` class with everything documented using docstrings.
@mgorny@social.treehouse.systems
2024-06-06 15:31:54

For a project that's supposed to avoid the vices of C, #CPython sure crashes a lot.
This time I was bisecting a regression in 3.13.0b2 that causes the interpreter crash when `freezegun` is imported. And no, not because freezegun was doing something hacky. Just some crazy internal extension state thingy.
#Gentoo #Python

@JGraber@mastodon.social
2024-05-17 18:00:34

#Python Friday #227: Hash a Password With #Bcrypt #security #FastAPI

@mgorny@social.treehouse.systems
2024-05-12 18:35:17

By the way, if you find my #Python 3.13 porting or other #Gentoo work helpful, please consider donating to my cat food fund.
#donation

@risottobias@tech.lgbt
2024-05-04 04:11:14

# !/usr/bin/env python3
# small_universe_test.py
import pandas as pd
const lightyear = 9461000000000000
const size = 930000000000 * lightyear # 8798730000000000000000000000
# largest number on some registers is 9223372036854775807 or 18446744073709551615
universe = sphere(radius=size,x=0,y=0,z=0,t=0)
pd.Series(universe, filling_function)
pd.Plot()
#cosmology #astrophysics #python

@mgorny@social.treehouse.systems
2024-05-14 19:13:45

#CPython 3.13 has some new fun flags for #Gentoo ricers.
USE=jit − enable to get Just-in-Time compiler and make stuff faster. Note that you're also going to see random segfaults, etc.
USE=gil − disable to get rid of Global Interpreter Lock and get a freethreading #Python. Expect some random breakage, race conditions, etc.

@mgorny@social.treehouse.systems
2024-06-14 01:51:36

When someone reports a crash bug and the release fixing it only mentions "improving performance".
Well, I guess unaligned writes may degrade performance. Having #RustLang extension crash #Python ain't important after all.
#Gentoo

@joe@toot.works
2024-05-14 23:06:17

I just scheduled two @… Open Space sessions. If you are interested in AI and RAG, I am going to be presenting "Crafting Intelligent Python Apps with Retrieval-Augmented Generation" on May 31 and June 28 (in case you can't make the first date).
#ThatConference #AI #LLM #RAG #Python

@mgorny@social.treehouse.systems
2024-04-24 14:07:11

#UV is truly the future of #Python packaging.
Except that its test suite relies on specific version of random packages happening to be the newest in #PyPI (and some other random third-party package index) at any given time. Which means that the test suite already fails *a few hours* after a release.
Oh, and upstream does drive-by updates to these broken assumptions while making other changes.
So… how are we supposed to mark any version stable in #Gentoo if we can't even hope for any single version to pass tests for a few days?
Also, that test is actually meaningless now, due to test assumptions no longer matching.
#RustLang

@jamesthebard@social.linux.pizza
2024-06-02 16:49:26

Making progress on the push notifications. Targeting Discord at the moment, but I think that the maps really help out with the information. Not satisfied with the formatting, but I'm not sure how much I want to dedicate to it. #programming #python

A Discord embed that shows a Severe Thunderstorm Warning issued by Norman OK.  It contains the Affected Areas, Description, and a map with the warning polygon.
@mgorny@social.treehouse.systems
2024-04-24 14:07:11

#UV is truly the future of #Python packaging.
Except that its test suite relies on specific version of random packages happening to be the newest in #PyPI (and some other random third-party package index) at any given time. Which means that the test suite already fails *a few hours* after a release.
Oh, and upstream does drive-by updates to these broken assumptions while making other changes.
So… how are we supposed to mark any version stable in #Gentoo if we can't even hope for any single version to pass tests for a few days?
Also, that test is actually meaningless now, due to test assumptions no longer matching.
#RustLang

@JGraber@mastodon.social
2024-05-10 18:00:50

#Python Friday #226: Fine-Tune the #OpenAPI Documentation in #FastAPI

@mgorny@social.treehouse.systems
2024-05-12 16:45:48

How about tests that fail in a completely nondescript way if your hostname is 12 characters long? I mean, the bash prompt gets into output and breaks matching in one environment, and doesn't in an environment with a shorter hostname.
As it turns out, it was caused by putting a wrong path to bashrc override while adding zsh support to #ArgComplete. I guess most people didn't get a long enough bash prompt to hit the failure.
#Gentoo #Python

@jamesthebard@social.linux.pizza
2024-05-31 17:41:05

Okay, after a few hours of troubleshooting I've got the county and warning polygons rendering correctly. So much profanity, but it works. Aspect ratio and zoom levels also seem to work. Next up: linking the messages with the images. #programming #python

A Flood Watch set of county polygons rendered in Plotly on top of a MapBox/OpenStreetMap map  The counties are bordered in red and colored in a more transparent red.
The breakdown in `geopandas` with respect to the counties in the Flood Warning along with some troubleshooting information.
@mgorny@social.treehouse.systems
2024-05-09 05:39:34

I've added #Python 3.13.0b1 to #Gentoo yesterday, along with the initial eclass support and a few baseline ports (up to PyTest).
It's amd64-only for the time being, since we need to keyword mpdecimal.

@mgorny@social.treehouse.systems
2024-06-07 16:09:54

In the past, many NumPy-based projects built their wheels against `oldest-supported-numpy` package to ensure the best ABI compatibility between multiple #NumPy versions.
Then NumPy 2 came and reversed that — now you need to build against NumPy 2 rather than 1.x, to gain ABI compatibility with both versions.
That said, if you want to maintain support for #Python 3.8, then you have to hack even more:
#Gentoo

@mgorny@social.treehouse.systems
2024-05-18 06:53:52

Well, we know that some upstreams are hostile to downstream testing.
However, how about they actually encrypt tests, so that only their CI can run them?
#Gentoo #Python

@mgorny@social.treehouse.systems
2024-06-07 15:41:11

Please don't use #Mercurial. It's not well-maintained software.
People like to point out that Mercurial works great for a few BigTech corporations. That's great for them. The side effect is that the development is focused on these corporations, and if you find a bug that doesn't affect them, you better be ready to provide a fix yourself.
#Python 3. The first release with Python 3 was made *two months* before Python 2 went EOL.
#RustLang. Funny thing is, Mercurial with Rust extensions enabled still doesn't work on Python 3.12. Apparently, they've chosen to use some NIH Python/Rust bridge rather than PyO3.
#Gentoo

@mgorny@social.treehouse.systems
2024-05-14 12:40:54

Here's my newest optimization idea for #Gentoo #Python: for pure Python packages and packages using the stable #CPython API, let's reuse previously built wheels if they're compatible instead of building them separately for each Python implementation.
This is mostly a major gain for the lot of packages using #setuptools when you're using multiple PYTHON_TARGETS, since calling into that build system has a significant cost. However, it also saves some actual compiling in the packages using the stable API (particularly, Rust packages).
github.com/gentoo/gentoo/pull/
bugs.gentoo.org/931689

@mgorny@social.treehouse.systems
2024-06-04 15:46:57

It took me almost 3 hours but #PipX 1.6.0 is now in #Gentoo, with an updated test shim that makes it possible to test using fake wheels and is only 70 KiB (vs. upstream that uses ~160 MiB for every single implementation).
What's more important, this time it isn't a handmade proof-of-concept anymore but a proper script with instructions that can be used to easily deal with future releases.
#Python

@joe@toot.works
2024-05-03 12:24:28

I’m rewriting @… to use a new API (because the old one doesn't work right anymore), rewriting it to be in #Python instead of #Node, and moving it from #Pipedream to a local #Docker container on my homelab machine.
You can probably expect a few articles on @… about this.

@JGraber@mastodon.social
2024-05-31 18:00:55

#Python Friday #229: #OAuth2 and #JWT to Protect a #FastAPI Application

@cdp1337@social.veraciousnetwork.com
2024-05-04 01:57:40

#Homelab #Linux #Networking
So if you are looking for a #Python

@mgorny@social.treehouse.systems
2024-05-11 06:06:00

Of course, there's a #PEP517 backend for #SCons, one of the most horrible build systems ever made by humankind.
Of course, it managed not to implement PEP517 correctly.
#Gentoo #Python

@mgorny@social.treehouse.systems
2024-05-10 18:45:57

You know what's great about #Python stable ABI? That you can take a binary package of, say, cryptography, and it will work on CPython 3.13, even though it's been built with older CPython version.
You know what's not so great about #PyO3? That you won't be able to build this package using Python 3.13 because it's going to reject it as "too new". Even if the package in question is only using the stable ABI compatible with CPython 3.9. Sigh.
So, of course, everything on #Gentoo will be blocked, until individual packages update their dependencies to use PyO3 new enough to support 3.13.
#RustLang

@mgorny@social.treehouse.systems
2024-05-11 08:42:44

Just hit my first JIT-related #CPython 3.13 test failure. Curious enough, it doesn't seem that the `gc.collect()` hack works, the way it does for #PyPy.
#Gentoo #Python

@mgorny@social.treehouse.systems
2024-06-10 14:45:26

So I'm bumping a package and the test suite fails with suspicious timestamp-related failures. So I do the obvious thing, and set TZ=UTC. It still fails. I do a quick math, and the timestamp difference looks weird — 8 hours.
I clone the repo to try to reproduce the problem. While that, I check how upstream runs tests and notice a comment:
# system should be in "America/Los_Angeles" timezone for all tests to pass
Well, okay. Then I make a bet that kloczek has already filed a bug about tests passing without actually bothering to try to figure it out. Of course he did:
#Python #Gentoo #PLD

@mgorny@social.treehouse.systems
2024-06-09 03:19:38

Does #setuptools maintainer think it is a good idea to use setuptools as a #PEP517 build system?
Yep, he probably does. And to prove it, he installs `docs` straight into `site-packages`.
#Gentoo #Python

@mgorny@social.treehouse.systems
2024-05-07 13:10:02

The most recent #Django releases, 5.0.5 and 4.2.12 are broken. Most likely they were done on #Windows, and that obviously is sufficient to break stuff.
[UPDATE: 5.0.6 and 4.2.13 are good. Thanks a lot!]
So far, we've noticed the following issues:
1. The directory is named lowercase `django-X.Y.Z` instead of capital-case `Django-X.Y.Z` (the filename remains capital-case).
2. All files have CRLF line endings instead of LF.
3. All files that should have the executable bit, have lost it.
As a result, the releases don't pass their own tests.
I hope to report this upstream, but their Trac is down now. So you can't even download the releases right now.
#Gentoo #Python

@mgorny@social.treehouse.systems
2024-05-05 05:43:36

This function has a certain XKCD#221 vibe to it. Perhaps the package originates from Debian? (remember CVE-2008-0166?)
#Python #Gentoo #WTF