Suggestion: new command to bump versions of dependencies in `pyproject.toml`
See original GitHub issue- I have searched the issues of this repo and believe that this is not a duplicate.
 
Issue
It would be awesome if Poetry had a command (let’s call it upgrade) that bumped the version constraints of dependencies in pyproject.toml (as opposed to update, which afaict updates the lock file to the newest version within the constraint specified in pyproject.toml).
Some examples for how this command could behave:
poetry upgrade django: Upgrade Django to the newest version that still works with other dependencies; equivalent topoetry remove django; poetry add django.poetry upgrade django djangorestframework: As above, but with more than one package at a time.poetry upgrade django=^2.1: Set the version ofdjangoto^2.1, equivalent topoetry remove django; poetry add django=^2.1.poetry upgrade: Upgrade every dependency to the newest possible version. Equivalent to deleting the entire[tool.poetry.dependencies]section ofpyproject.tomland runningpoetry addwith a list of the names (but not versions) of every package previously in the list. (This one would be good for cookiecutter templates for projects, to make it easy to start a new project with the latest versions of everything.)
Currently, when I want to bump the version of something, I’m either running poetry remove ...; poetry add ... which moves the package to the bottom of the list in pyproject.toml, and results in uninstalling a bunch of dependencies which sometimes just get reinstalled again at the same version; or I’m manually editing pyproject.toml which means I have to look up the latest version manually, and I can’t use Poetry’s version resolution when I want to upgrade more than one package at a time.
Issue Analytics
- State:
 - Created 5 years ago
 - Reactions:118
 - Comments:45 (10 by maintainers)
 

Top Related StackOverflow Question
I’ve created a PyPI package called poetryup that does this seamlessly. Simply runpoetryupand it will update dependencies and bump their version in thepyproject.tomlfile. Enjoy!Edit 1:
poetryupv0.5.0can update dependencies to their LATEST available version by setting a flag as following:poetryup --latestEdit 2:
poetryupv0.8.0can update specific dependencies or dependencies in specific groupsEdit 3:
With the announcement of
Poetry 1.2.0and its support for plugin support,poetryuphave been ported to poetry-plugin-up. Instead of being a standalone tool, the plugin provides anupcommand toPoetryitself in order to update dependencies and bumppyproject.toml. I strongly recommend using the plugin since it provides a more native experience and comes with new features such asdry-run,no-installetc.Install the
upplugin with:Usage:
For more details visit poetry-plugin-up
I thinks the request about an
upgradecommand to update all dependencies to the latest available version is valid. So I reopen it.