I don’t like poetry. I find it slow, buggy, and poorly designed. It often gets in my way and I end up spending my time debugging poetry instead of actually working on my projects. Perhaps it makes packaging or upgrading dependencies a bit easier but ultimately I don’t find it adds much value on top of built-in Python tools to justify the complexity and poor user experience.

I do like uv. It’s a fast drop-in replacement for pip and venv. It’s really fast.

I use uv venv for environment management with a few shell functions:

va () {
    source .venv/bin/activate 2>/dev/null || source ../.venv/bin/activate 2>/dev/null || echo 'no .env found in this or parent directory' && false
}

va! () { 
    va || vc && va
}

vc () {
    uv venv --seed --python-preference managed "$@"
}

vd () { deactivate; }

(If you’re wondering why I look for a .venv directory in both the invocation directory and its parent, it’s because when I use git worktrees I often want to have a single .venv directory at the root of my worktrees.)

I also use uv pip for projects that use a vanilla pyproject.toml but I still do have to use poetry for some open-source or work repositories. However, I don’t normally change or update dependencies. All I normally do is poetry install in an environment to get the dependencies. But poetry install is slow and I do it enough times that I started thinking if I can use uv instead to install the dependencies. I came up with the simple bash function below:

uv_poetry_install () {
    uv pip install --no-deps -r <(POETRY_WARNINGS_EXPORT=false poetry export --without-hashes --with dev -f requirements.txt)
    poetry install --only-root
}

I use it as a drop-in replacement for poetry install and it has easily given me 10x-20x speed improvements in my tests. Poetry keeps all resolved dependencies in the poetry.lock file so poetry export command is fast. There is still a poetry install in this function but that’s only to install the package itself and its potential entrypoint scripts.

The only incompatibility between poetry export and uv pip install that I’ve found so far is how they deal with keyring authentication. This has been a recent breaking change in uv, so I fix it in my keyring-enabled version:

uv_poetry_install () {
    uv pip install keyrings.google-artifactregistry-auth
    uv pip install --no-deps --keyring-provider subprocess -r <(POETRY_WARNINGS_EXPORT=false poetry export --without-hashes --with dev -f requirements.txt | sed 's|--extra-index-url [https://us-central1-python.pkg.dev](https://us-central1-python.pkg.dev/)|--extra-index-url [https://[email protected]](https://[email protected]/)|g')
    poetry install --only-root
}