@adamchainz@fosstodon.org
@adamchainz@fosstodon.org avatar

adamchainz

@adamchainz@fosstodon.org

:django: #Django technical board member
🍕 London Django Meetup Organizer with https://fosstodon.org/@cgl
✍️ Author of three books on Django and Git
🇬🇧 London / 🇵🇹 Lisbon

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

adamchainz, to random
@adamchainz@fosstodon.org avatar

Loving all the @djangonaut mentions at @djangoconeurope, including this lightning talk from Raffaella

adamchainz, to django
@adamchainz@fosstodon.org avatar

🆙 django-upgrade 1.18.0 is out, with support for Django 5.1 (currently in alpha) and a fixer for the argument rename in CheckConstraint:

https://github.com/adamchainz/django-upgrade?tab=readme-ov-file#django-51

adamchainz, to random
@adamchainz@fosstodon.org avatar

♦️ Yay, my force push blog post was featured in this week’s @pythonbytes ! 🥳

https://pythonbytes.fm/episodes/show/384/force-push-lightly

adamchainz, to python
@adamchainz@fosstodon.org avatar

🐍♦️ Use Git to pass pytest a list of all modified test files:

pytest $(git diff --name-only '/test_.py')

Adjust the pathspec (Git’s “glob” syntax) if you have a different test file naming convention.

adamchainz, to random
@adamchainz@fosstodon.org avatar

♦️ There is a safer alternative to 'git push --force'!

🫸 Use --force-with-lease and --force-if-includes to restrict force pushes so that they don’t unintentionally overwrite commits pushed by others.

Explained in my post: https://adamj.eu/tech/2023/10/31/git-force-push-safely/

adamchainz, to django
@adamchainz@fosstodon.org avatar

I’m helping a client upgrade to django-import-export v4, and I gotta say I’m enjoying the clarity of the release notes. Every breaking change spelled out, with PR links. Thank you Matt :)

https://django-import-export.readthedocs.io/en/stable/release_notes.html

adamchainz, to python
@adamchainz@fosstodon.org avatar

A #pytest pattern I’ve recently enjoyed using:

  1. Change some function in a way that needs fixes to call sites.
  2. Run the whole test suite with pytest.
  3. Copy the list of failing test IDs from pytest’s summary into a scratch file.
  4. Fix up the found callers.
  5. Verify everything fixed by saving the list of tests with: pytest $(cat scratch/testids.txt)

#Python #Testing

adamchainz, to random
@adamchainz@fosstodon.org avatar

Just blocked a bunch more AI bots in my site’s robots.txt, thanks to this post from @cory:

https://coryd.dev/posts/2024/go-ahead-and-block-ai-web-crawlers/

adamchainz, to python
@adamchainz@fosstodon.org avatar

✍️ New post covering a small helper to return all subclasses of a given class.

https://adamj.eu/tech/2024/05/10/python-all-subclasses/

adamchainz, to django
@adamchainz@fosstodon.org avatar

✍️ New post on my new package django-harlequin.

🦆 This package provides a small launcher command for Harlequin, the Terminal-based SQL IDE by Ted Conbeer.

💽 Try it out and let me know what you think!

https://adamj.eu/tech/2024/05/07/django-harlequin/

adamchainz, to django
@adamchainz@fosstodon.org avatar

✍️ New post covering a admin extension I wrote to prevent a certain kind of inter-request state leakage.

Perhaps niche, perhaps worth adding to Django?

https://adamj.eu/tech/2024/04/29/django-admin-prevent-leaking-requests/

adamchainz, to python
@adamchainz@fosstodon.org avatar

✍️ New post covering a “diffing” unit test in , which checks copy-paste-tweaked code is in sync with the upstream library.

I used this technique recently on a upgrade and I’m curious if anyone else has done similar.

https://adamj.eu/tech/2024/04/26/python-diffing-unit-test/

adamchainz, to random
@adamchainz@fosstodon.org avatar

I got another commit in 🥳

The book-driven development continues…

https://github.com/git/git/commit/89c6d6c74c61ae7013215b31b8612fd708899fbf

adamchainz, to python
@adamchainz@fosstodon.org avatar

✍️ New post with a little recipe for generating “line number paths” for classes and functions.

from inspect import getsourcefile, getsourcelines
print(f"{getsourcefile(obj)}:{getsourcelines(obj)[1]}")

✏️ I use this pattern sometimes for batch edits.

https://adamj.eu/tech/2024/04/25/python-line-number-paths-inspect/

adamchainz, to random
@adamchainz@fosstodon.org avatar

Looking back at sales data for last Black Friday, https://BlackFridayDeals.dev really helped drive many sales of my books. It’s great there’s a focal point for developer-related deals, and I’ll definitely ensure to post there for future sales.

adamchainz, to random
@adamchainz@fosstodon.org avatar

It’s time to believe in trans rights

adamchainz, to random
@adamchainz@fosstodon.org avatar

I had a great time talking last night, we had a really engaged audience who asked many good questions.

https://fosstodon.org/@djangolondon/112286202502892368

adamchainz, to django
@adamchainz@fosstodon.org avatar

Looking forward to distributing these newly acquired fantastic stickers at @djangolondon tonight.

Made by @sjbitcode & @adamghill , see: https://alldjango.com/stickers

adamchainz, to django
@adamchainz@fosstodon.org avatar
adamchainz, to random
@adamchainz@fosstodon.org avatar

Ooh, new newsletter just dropped from Carlton... I’m looking forward to the first full Stack Report issue

https://fosstodon.org/@carlton/112258636006734175

adamchainz, to random
@adamchainz@fosstodon.org avatar

🆙 I just released an update to Boost Your DX. This update adds some extra content and has a bunch of edits based on reader feedback. The PDF is now ten pages longer, for a total of 363.

🤑 Also, there’s a 10% discount for today only. Gumroad are waiving their fees for their birthday celebration, and I’m passing the savings on to you.

👉 Buy the book here: https://adamchainz.gumroad.com/l/bygdx

♦️ Or read more about the update here: https://adamj.eu/tech/2024/04/04/bygdx-update/

adamchainz, to python
@adamchainz@fosstodon.org avatar

🏎️ Last night, I fixed a segmentation fault bug in my testing library time-machine.

🤷 There were several outstanding issues about segmentation faults with unclear causes, and I didn’t have time to dive into them.

🐛 Then I received a new bug report from Marcin Sulikowski with a minimal reproduction. This research pointed directly at the problem and revealed the other reports as duplicates.

👏 Clear and reproducible bug reports are very valuable contributions!

adamchainz, to django
@adamchainz@fosstodon.org avatar

👏 Massive congratulations to Sarah Boyce (@sarahboyce) for being chosen as the new fellow.

https://www.djangoproject.com/weblog/2024/mar/22/welcome-our-new-fellow-sarah-boyce/

adamchainz, to django
@adamchainz@fosstodon.org avatar

✍️ New post on some work I’ve done optimizing Django’s system check framework.

💡 This is a bit of a long post, about 3k words. I hope you learn something from it.

https://adamj.eu/tech/2024/03/23/django-optimizing-system-checks/

adamchainz, to python
@adamchainz@fosstodon.org avatar

⏱️ After 6.5 years, pywatchman released a new version at the beginning of the month, including 3.10+ support. Yay!

🦄 Django’s runserver can use pywatchman to drastically reduce the CPU cost of autoreloading. gets pywatchman to send it file change notifications from the OS rather than polling every file every second.

✍️ In January, I removed the watchman section from Boost Your Django DX due to the incompatibility. But now I can restore it. 😊

https://pypi.org/project/pywatchman/#history

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