python-cmd2 / cmd2

cmd2 - quickly build feature-rich and user-friendly interactive command line applications in Python
https://cmd2.readthedocs.io/en/stable/
MIT License
618 stars 116 forks source link

Consider modernizing build system to use hatch or uv #1366

Closed tleonhardt closed 2 weeks ago

tleonhardt commented 3 weeks ago

There are several more advanced build system tools which are worth exploring. The current default recommendation from python seems to be hatch. It has impressive features including declaring build/test configurations and managing venv environments. @anselor tried hatch on a couple small projects and 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.

A newer alternative that is taking the Python world by storm is uv which is an extremely fast Python package and project manager, written in Rust. uv is a single tool to replace pip, pip-tools, pipx, poetry, pyenv, virtualenv, pipenv and more. I've used this at work to replace pip in some builds and it has typically sped things up by a factor of 2x.

tleonhardt commented 3 weeks ago

1367 added support for uv venvs.

1368 fixed a few bugs with that above

uv virtual envs are now working great for cmd2 development on both the master and 3.0.0 branches.

tleonhardt commented 3 weeks ago

TODO:

tleonhardt commented 3 weeks ago

1370 Replaces the use of nox in GithHub Action pytest runs with uv, removes nox from tasks.py and removes the dependency on nox

tleonhardt commented 2 weeks ago

1375 Updates the Contributing Guide with info on how to use uv for cmd2 development

tleonhardt commented 2 weeks ago

I was initially planning on replacing the use of twine with uv publish, but that feature of uv is experimental and subject to change in backwards incompatible ways, so that would be premature at this time.