Coding 2020-11-18
I'm going to try to keep this brief because I'm not in the best of shape right now. To take a break from the punq stuff, I'm going to try using some somewhat new tools with a small challenge I haven't tried before.
All of this is inspired by this twitter thread. The quick summary of the thread is that people aren't using decision tables with the Gilded Rose kata, and they should be. I've used decision tables some in the past. Though I didn't use them on the punq fork, I imagine they wouldn't have gone amiss there.
The other thing I want to look into is using Ward instead of pytest. I heard of Ward recently, and given how little I mess with pytest's configuration in my hobby projects, I'm not feeling particularly tethered to pytest, so I'm curious what it's like currently. The only thing I might need to do is name things somewhat un-idiomatically by Ward standards, to get Coverage.py to assign contexts properly. (Although, that's not necessary for the kata, since it only has one source file.)
Anyway, my plan is to copy over things from the virtual tabletop repo, since that has the most recent version of my project scaffolding, copy in the Gilded Rose stuff, make sure I've got everything working with pytest, then switch it to Ward. After that, I'll work on documenting the current behavior with decision tables, translate the results into tests. Refactor the code to be less of a tangle of if statements. Then, extend the decision tables in accordance with the kata, and add the new tests required by the new rows.
Let's see how far I can get with all that for now.
Some time later, I'm nearly at the end of the first sentence.
Ten minutes more and I am at the end.
I'll get to work on the decision tables tomorrow.
Stuff I learned from trying this:
- I missed the boat to comment on pip#8210. That issue seems to mean I need to adapt my current workarounds to the new resolver, because they won't work. I'm looking into the related issues now.
- Coverage.py's dynamic contexts don't play well with Ward. I believe the problem is on the coverage side, and fixing it probably requires setting some configuration options that may or may not exist yet.
Then I spaced out for about half an hour trying to figure out which pip issue fits my use case. So, I guess I'm done for now.
Good night.