cmd2 icon indicating copy to clipboard operation
cmd2 copied to clipboard

Migrate to pyproject.toml & hatch

Open anselor opened this issue 1 year ago • 1 comments

The default recommendation from python seems to be hatch now. It has impressive features including declaring build/test configurations and managing venv environments. In my trial of it on a couple small projects I found it to be much faster than using nox to set up venvs.

The problem is it currently doesn't support a monorepo project with multiple modules or plugin modules. There is a development ticket (https://github.com/pypa/hatch/issues/233) that documents it and it is under active development now. Once that is complete we should be able to migrate to hatch with minimal fuss.

anselor avatar Oct 18 '24 16:10 anselor

I like the idea of moving to something like either hatch or uv and getting rid of nox for running our tests in multiple python environments.

I tried moving to a more modern Python project setup where everything is in pyproject.toml and there are no setup.cfg or setup.py files, but I couldn't get that working properly with nox.

On a semi-related note, I'd already replaced the mix of flake8, black, and isort for auto-formatting and linting with ruff which is far faster.

tleonhardt avatar Oct 18 '24 17:10 tleonhardt

#1336 handles the moving to ruff from black, isort, and flake8

tleonhardt avatar Oct 22 '24 18:10 tleonhardt

#1343 Moved the doc8 config to pyrproject.toml from setup.cfg

tleonhardt avatar Oct 23 '24 15:10 tleonhardt

#1344 Moves the mypy config to pyproject.toml from setup.cfg

tleonhardt avatar Oct 23 '24 16:10 tleonhardt

#1345 Moves pytest config to pyproject.toml from setup.cfg and deletes setup.cfg entirely

tleonhardt avatar Oct 23 '24 18:10 tleonhardt

#1364 is a PR that sets the [project] configuration in pyrproject.toml and ruggedize a couple unit tests

#1365 fully removed setup.py and relies purely on pyproject.toml for the build

tleonhardt avatar Nov 03 '24 18:11 tleonhardt

I'm going to resolve this and create a new issue for considering moving to hatch or uv

tleonhardt avatar Nov 03 '24 18:11 tleonhardt

I created #1366 to encompass the future work for moving to something like uv or hatch

tleonhardt avatar Nov 03 '24 18:11 tleonhardt