@henryiii@fosstodon.org avatar

henryiii

@henryiii@fosstodon.org

Part of the IRIS-HEP project at Princeton. Scikit-HEP, Scikit-build, PyPA/build, PyPA/cibuildwheel, pybind11, CLI11, & plumbum.

This profile is from a federated server and may be incomplete. Browse more on the original instance.

brettcannon, (edited ) to random
@brettcannon@fosstodon.org avatar

Do you look at a project's trove classifiers to tell what Python versions are supported (e.g. does it support Python 3.13 yet)?

henryiii,
@henryiii@fosstodon.org avatar

@brettcannon This is tricky. Seeing one tells me it's ready for 3.13 and probably tested on it, but not seeing it doesn't tell me it doesn't work. Without the classifier, the next thing I'd check is to see if it has platform specific (or ABI3) wheels that work on 3.13.

henryiii, to python
@henryiii@fosstodon.org avatar

Latest manylinux/musllinux images have free-threaded CPython builds! "python3.13t"

henryiii, to python
@henryiii@fosstodon.org avatar

I've just released cibuildwheel 2.18.0, with prerelease support for CPython 3.13 - set CIBW_PRERELEASE_PYTHONS to test building 3.13 wheels! (No free-threading yet, waiting on binaries & pip) https://github.com/pypa/cibuildwheel/releases/tag/v2.18.0

henryiii, to python
@henryiii@fosstodon.org avatar

Python 3.13 beta 1 is out, which means it's time for my yearly post on what's new: https://iscinumpy.dev/post/python-313/

henryiii, to python
@henryiii@fosstodon.org avatar

This feature of uv is not talked about enough:

uv pip install --exclude-newer 2020-01-01 -r requirements.txt

I was able to recover and build a project untouched for many years using this easily!

henryiii, to python
@henryiii@fosstodon.org avatar

Google fired their Python team, including one of our pybind11 lead developers (the list of accomplishments of that team is, ah, was, impressive!) We'll need to tighten up our min version support for pybind11, so I've opened up a poll: https://github.com/pybind/pybind11/discussions/5124 3.7+ or 3.8+?

brettcannon, to random
@brettcannon@fosstodon.org avatar

Looking for a Bash one-liner to tell by exit code whether your Git checkout is dirty?

if [ -n "$(git status --porcelain)" ]; then (exit 1); fi

I sought this out for GitHub Actions so that I could set up a formatting command for a project and then check in CI if it would change anything instead of having a second command just for the check (e.g. black followed by this in CI instead of having a separate, dedicated black --check just for CI). Basically trying up the DRY on maintenance stuff

henryiii,
@henryiii@fosstodon.org avatar

@brettcannon Why not git diff --quiet? --quiet implies --exit-code.

henryiii,
@henryiii@fosstodon.org avatar

@brettcannon Ah, no, it does not, so that's why. :)

brettcannon, to random
@brettcannon@fosstodon.org avatar

Thanks to everyone who voted in https://fosstodon.org/@brettcannon/112395986863435778 ! An interesting outcome was that "chore" got a large number of write-in votes (see the replies to the poll). It was actually so consistent and numerous i wouldn't be surprised if it would have won the vote had I included it. 😅

henryiii,
@henryiii@fosstodon.org avatar

@brettcannon https://www.conventionalcommits.org/en/v1.0.0/ uses chore:, so I've always prepended my titles with chore: for these sorts of things; that's why I would probably have gone with chore. :)

henryiii, to python
@henryiii@fosstodon.org avatar

Stick these lines at the top of your noxfile.py:

nox.needs_version = ">=2024.3.2"
nox.options.default_venv_backend = "uv|virtualenv"

And install uv to make install-heavy nox jobs go much faster. You can instead try -db uv or setting NOX_DEFAULT_VENV_BACKEND=uv.

henryiii,
@henryiii@fosstodon.org avatar

@hynek No, not anymore. It used to be that you needed “name @.” for a non-editable local install. But it’s normal now.

henryiii,
@henryiii@fosstodon.org avatar

@hynek it does require https://github.com/astral-sh/uv/releases/tag/0.1.24 which has only been out a few days.

henryiii, to python
@henryiii@fosstodon.org avatar

We just released pybind11 2.12! Along with lots of fixes and features, this is also the first version to support NumPy 2.0 - please update and release new binaries of your packages before 2.0 goes final! You don't need NumPy 2 when building with pybind11! https://github.com/pybind/pybind11/releases/tag/v2.12.0 .

henryiii, to python
@henryiii@fosstodon.org avatar

cmake for Python 3.29.0 is out now! First release to use scikit-build-core internally as the build backend, Python 3.7+ required. https://github.com/scikit-build/cmake-python-distributions/releases/tag/3.29.0.1

pythonbytes, to python
@pythonbytes@fosstodon.org avatar
henryiii,
@henryiii@fosstodon.org avatar

@tonybaloney @brianokken @pythonbytes @mkennedy repr is the “programmer’s view”, while str is what it looks like as a string. You don’t have to implement str, it will default to calling repr. For example, a Card class could be have a repr of ‘Card(“Jack”)’ and a string “J”.

henryiii, to random
@henryiii@fosstodon.org avatar

Switching from mamba to prefix.dev's pixi in GitHub Actions for my book build took setup time from about a minute to 13 seconds (as long as you don’t cache). And now it’s fully locked, too! Quite happy. And it's simpler in Actions. https://github.com/henryiii/se-for-sci/pull/42

brettcannon, to random
@brettcannon@fosstodon.org avatar

I don't think there's any new info in https://snarky.ca/state-of-wasi-support-for-cpython-march-2024/ for those that follow me here, but it's a status update for CPython and WASI up until I started my parental leave.

henryiii,
@henryiii@fosstodon.org avatar

@brettcannon WASI still doesn't support compiled extensions, like numpy, cryptography, etc? That's the main reason Emscripten based distributions (Pyodide) are still far more interesting to me - Python's ecosystem is the huge selling point.

henryiii,
@henryiii@fosstodon.org avatar

@brettcannon @henryiii very interesting! I’ll look into it, probably when I get off paternity leave.

henryiii, to python
@henryiii@fosstodon.org avatar

Cibuildwheel 2.17 is out! Highlights include a new inherit table for overrides, official GHA Apple silicon (macOS-14) support (was experimental in 2.16.5), auto platform detection when running locally, and setuptools/wheel removed. https://github.com/pypa/cibuildwheel/releases/tag/v2.17.0 thanks @joerick!

henryiii, to python
@henryiii@fosstodon.org avatar

Nox 2024.3.2 is out! The new optional uv backend is blazing fast, and it has several long awaited features, like --force-python on non-parametrized sessions, venv reuse options, an envvar for backend selection, backend sequences with fallthrough, and more! (note: "virtualenv" is the Nox backend selector, it's virtualenv + pip)

video/mp4

henryiii, to python
@henryiii@fosstodon.org avatar

Build 1.1 is out, and in some cases it's over 2x faster than 1.0, such as in my favorite way to use it, "pipx run build"! https://github.com/pypa/build/releases/tag/v1.1.0

video/mp4

henryiii,
@henryiii@fosstodon.org avatar

@hugovk @pillow Nice, the savings is a constant, so the effect is fractionally largest if you have a small package (pure Python plus hatchling or other simple backend). It basically skips installing pip in the temporary env, and pip is large/slow to install and has to be installed twice (since there are two envs). We might provide backend options in the future, allowing something like uv to be used. ;) But this was a good first step!

henryiii,
@henryiii@fosstodon.org avatar

@hugovk @pillow build 1.2 is a hair faster, and offers —installer=uv, which is even faster. :)

treyhunner, (edited ) to random
@treyhunner@mastodon.social avatar

I've just updated my ~/.config/pip/pip.conf & my dotfiles repo to disallow pip installing outside virtual environments! 🎉

TIL 2 things about 's pip:

  1. pip has a config file. If I ever knew this, I'd forgotten.

  2. pip has an option that stops it from working outside of a virtual environment!

This is great for me because I use pipx and NEVER do global pip installs.

Info: https://unix.stackexchange.com/questions/492041/is-there-a-way-to-disable-pip-outside-of-a-virtual-environment

Thanks to @hynek's excellent uv video for this semi-related TIL 💜 https://youtu.be/_FdjW47Au30?si=5iRmMuWMdewRubNt

henryiii,
@henryiii@fosstodon.org avatar

@jugmac00 @treyhunner @hynek Yeah, I don't have a global pip either (homebrew). I do have a global pip3, but I'd never accidentally (or intentionally) type that. :)

hynek, to random
@hynek@mastodon.social avatar

I’m not as excited about running uv locally, b/c it’s just not a significant factor in my day-to-day life.

BUT just installing tox-uv in structlog’s CI made it go from 2:19 to 1:47 which is not life-changing, but significant. It could get a lot faster if GitHub Actions added support for it (pre-installation & caching), which would be in their own interest but not holding my breath.

Switching build-and-inspect-python-package to it made the action go from ~30s to ~20s.

https://github.com/hynek/build-and-inspect-python-package/pull/86

henryiii,
@henryiii@fosstodon.org avatar

@hynek I assume if it also could do the build (which it’s pretty close to being able to do) that would be even better?

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • magazineikmin
  • cubers
  • InstantRegret
  • cisconetworking
  • Youngstown
  • vwfavf
  • slotface
  • Durango
  • rosin
  • everett
  • kavyap
  • DreamBathrooms
  • provamag3
  • mdbf
  • khanakhh
  • modclub
  • tester
  • ethstaker
  • osvaldo12
  • GTA5RPClips
  • ngwrru68w68
  • Leos
  • anitta
  • tacticalgear
  • normalnudes
  • JUstTest
  • All magazines