@calpaterson@fosstodon.org avatar

calpaterson

@calpaterson@fosstodon.org

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

calpaterson, to random
@calpaterson@fosstodon.org avatar

It takes me a long time to write blogposts and certain ones in the past have (at least felt) like they have taken weeks...

Recently I totted it up and I reckon I take about 1.5 hours to produce 1 minute of reading time. So longer posts like my past one about Bank Python which are 30 minute reads...yes they felt hard because they were a lot of work!

calpaterson,
@calpaterson@fosstodon.org avatar

@hl allow me to share my process with you:

  1. i write it, and edit and rewrite over and over. after many rounds of edits i get to a final draft

  2. then i have my wife proof-read it. she is a former book publisher and very very good at finding typos and mistakes. we take them all out

  3. i do another round of edits on my own, putting lots of new mistakes in

  4. publish

calpaterson, to random
@calpaterson@fosstodon.org avatar

Spent a lot of this week fixing several bugs in csvbase that people found.

I've always done test-first development. csvbase apparently has 89% test coverage (I just checked) and most of that 11% is non-production stuff or experiments. The test base has caught a huge number of bugs and regressions but still - a lot of mistakes get through.

I've never understood how anyone manages to write real production code without tests. Am I doing something wrong?

calpaterson,
@calpaterson@fosstodon.org avatar

@lewiscowles1986 I have never tried mutation testing, but I am interesting in giving it a go.

Property based testing I do use in certain places but more often I am doing example-based testing with parameterised examples. My reservation is that every commercial project I've seen it used it it's been too slow

calpaterson,
@calpaterson@fosstodon.org avatar

@lewiscowles1986 i think broadly speaking 30s is a good target. i currently get 9s without using parallelism (but parallelism does work)

mutmut seems pretty interesting

re:sqla 2.0 - close to ready. most (all?) of the future=True switches are on. Just other stuff to do

calpaterson,
@calpaterson@fosstodon.org avatar

@jamescooke I had a quick look at mutmut yesterday. It got working with no config which was impressive

I ran it for about an hour or so while I did nursery run.

It ran about 500 mutations in that time. 50% passed and 50% failed. of the failures:

  1. a small minority were code i prefer not to test, like the exact contents of log messages

  2. all the rest were dead code that should be removed

so a useful exercise, and i'll carry on with it, but no bugs found yet

CC @lewiscowles1986

calpaterson,
@calpaterson@fosstodon.org avatar

@jamescooke @lewiscowles1986 you can annotate certain lines to be immune from mutation which looks essential for non-trivial codebases

calpaterson,
@calpaterson@fosstodon.org avatar

@lewiscowles1986 @jamescooke here's an example of a mutation that i didn't care about

it's possible to add an assertion to cover this, but i am happy that it's typechecked + runs through

i don't track bugs that i fix on the spot. perhaps i could, but i think that might be too heavyweight for the project's maturity level. csvbase is really only a step or two on from MVP :)

calpaterson,
@calpaterson@fosstodon.org avatar

@lewiscowles1986 @jamescooke one example of a bug that has come up several times, though, is failing to seek a file back. here's my current solution for that

imo file handling is a lot like manual memory management (because that's what it is!)

calpaterson,
@calpaterson@fosstodon.org avatar

@lewiscowles1986 @jamescooke an example use. there is a lot of this because obviously if you materialise a csv file eg as a list of dicts you timeout

calpaterson,
@calpaterson@fosstodon.org avatar

@lewiscowles1986 @jamescooke usually the whole file is being read but if you turn 50mb of csv into lists+dicts or whatever you will usually exceed memory and/or timeout

and i want to raise the limit on uploaded csv file sizes to at least 100mb

calpaterson,
@calpaterson@fosstodon.org avatar

@lewiscowles1986 @jamescooke so streaming the file is essential

as is rewinding as necessary - because various scanners run on the first part of the file, eg to infer delimiter, charset, column types, etc

calpaterson, to random
@calpaterson@fosstodon.org avatar

A new blogpost, this time about fun stuff that was put in HTTP/1.1 and so is already implemented everywhere

https://csvbase.com/blog/8

calpaterson, to random
@calpaterson@fosstodon.org avatar

@hugovk recently got me into using discord for organising @HelPy

I've just created a discord 'server' for csvbase here: https://discord.gg/zXHZNvv22N

Get in on the ground floor of this jillion dollar movement to spread csv files (or be first against the wall when the revolution comes)

calpaterson, to random
@calpaterson@fosstodon.org avatar

A new blogpost, mainly about the wonders of fsspec, the little known but 20th most popular python library in the world:

https://csvbase.com/blog/7

adamchainz, to random
@adamchainz@fosstodon.org avatar

Yeah, pretty much how I feel about Tailwind and co. Let’s use the cascade!

https://front-end.social/@heydon/111957906169157692

calpaterson,
@calpaterson@fosstodon.org avatar

@adamchainz I'd have liked to have read this and understood the issue but the author's desire to be creatively insulting completely got in the way. Never liked this kind of tech writing and don't understand what the incentives are that make people publish stuff like this

calpaterson, to random
@calpaterson@fosstodon.org avatar

A friend of mine has written a helper tool for the (very common, ime) case where you have to make commits across multiple git repos

https://github.com/samlader/gmux

very useful for multi-repo setups

adamchainz, (edited ) to python
@adamchainz@fosstodon.org avatar

⏰ Just released time-machine 2.13.0. This is my package for mocking date/time in tests (much faster than freezegun).

This version adds support for timedelta, mocking of time.monotonic(), and exposure of the shift() method in the pytest fixture.

Thanks to contributors: Nate Dudenhoeffer, @soxofaan , and Anthony Sottile.

https://github.com/adamchainz/time-machine/blob/main/CHANGELOG.rst#2130-2023-09-19

calpaterson,
@calpaterson@fosstodon.org avatar

@adamchainz @soxofaan nice. many thanks for this, it makes a big difference and i've used it on many projects

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