* MNT Upgrade ruff to 0.6.4
Currently used version, 0.2.1, is quite old at this point.
Not a lot needed to be changed:
- Change ruff version in setup.py
- Remove deprecated ignore-init-module-imports option for ruff
- Type comparison should use is and not ==
- Use f-string instead of % formatting
- Some line wrapping and empty lines
* Oops
* Ban use of `os.*env`
* Fix `clear_environment` to actually clear environment variables
Assigning to `os.environ` does not clear the environment (Ruff B003)
* Have environment context managers restore state even if the block raises
* Add tests for environment CMs