In the middle of the desert you can say anything you want
TODO, this look really really really good. Explanation of the relationship between python logging root logger and other loggers
(+ Love the way it’s split into separate
pytest took seconds at the “Collecting…” stage.
I had a directory with a lot of tiny files (
./data_1234/) in the poetry package folder, and blamed it initially.
SO1 told me that the syntax to ignore a folder is
[tool:pytest] norecursedirs = subpath/*
Wildcards are nice and
data*/* was the first attempt.
Then I without success tried this:
After a one-hour saga, I found that the culprit was a package that I was using. The tests imported my package, which imported the slow package, and it takes seconds to do so.
‘Collecting’ seems not to be only “find test files”, but it reads them and imports them and all their dependencies.
Waiting time went back to normal as soon as I commented out importing my package from the test.
From within an issue, use the dropdown left of “Create merge request” -> Create branch, will create a branch with the format “issue_n-issue_title”, for example
If you use a directory structure like this:
resources/ src/project_name/ tests/ [...]
then you get these directories in the same order regardless of the name of the project! Then it’s always uniform, muscle memory has a chance, etc.
<Ctrl-C> of a program running inside pdb (
python3 -m pdb myscript.py or whatever) doesn’t kill the program, but drops you in the debugger!
Useful when you suspect there’s an infinite loop somewhere, and want to see what exactly is the program doing when it starts using 120% of your CPU
Installed noisetorch, it complained about CAP_SYS_RESOURCE like the last time and I fixed it by installing polkit like the last time, didn’t work though.
Issue seems to be that by default Mint has the home partition mounted with nosetuid1, confirmed by doing
Fix was to put the binary in
/opt, the prompt is the same but after entering the password it works and I see the expected interface.
Use-case - using limited mobile internet.
vnstat is nice.
sudo apt install vnstat, service has to be started/enabled through systemctl as usual.
Logs traffic with 5-minute granularity, so for the first 5 minutes after install will say that there’s not enough information :)
vnstat -5 returns the last hours in 5-minute interval,
-m is hourly/daily/monthly.
-i selects the interface (otherwise all existing non-zero ones will be shown).
Saw this in the python pandoc cookbook1
holder[index:index+1] = split_home(elt)
Never thought I could assign multiple elements to a slice!
pdbpp is a drop-in replacement for
pdb, and I like it more than
ipdb for some reason.
Installing it makes it the default one imported when importing
pdb (incl. by pytest, python’s
Really nice tutorial: pdb++, a drop-in replacement for pdb (the Python debugger) | PythonRepo
Vanilla-pdb cheatcheet: Python Debugger Cheat Sheet - Kapeli
Features not present in pdb that I love:
lloutputs the text of the current function
stickyupdates the function listing with each new line, giving a nice interactive visual feeling to the debugging process
pytest -s works to make it play nice with the stdouts generated by pdbpp.
Just discovered this! In vim, if I skip the pattern, it’ll take the one last searched for: