poetryup not updating 0.x.y
dependencies
#21
Comments
I just saw that I can reproduce the error with $: poetry add --dev pylint@^1
Updating dependencies
Resolving dependencies... (2.8s)
Writing lock file
Package operations: 3 installs, 0 updates, 0 removals
• Installing lazy-object-proxy (1.6.0)
• Installing astroid (1.6.6)
• Installing pylint (1.9.4)
$: poetryup
Updating dependencies
Resolving dependencies... (1.8s)
No dependencies to install or update |
Hi @lyz-code, glad you like it! This is a desired behavior and it's not
So the left-most non-zero digit in the major, minor, patch grouping will never be updated. The reason for this is to avoid introducing breaking changes. |
Ouch, I saw your program in this issue, and I thought that it was able to upgrade the constrains of the package beyond the defined ones. Would it be possible to add a flag like The problem that I want to solve is not to manually change the constrains of a package, but run a command that changes them all for me, then I can test if the package keeps on working. Thanks! |
@lyz-code created a PR that add the possibility to update dependencies to their latest available version. Could you please try it and come back with some feedback? Steps to install from the branch:
|
Hey @MousaZeidBaker, thanks for implementing the solution so fast! Oo I've created an empty virtualenv and run the commands that you told me. pip install poetry
poetry new package
poetry add git+https://github.com/MousaZeidBaker/poetryup.git#poetryup-latest
poetry lock && poetry install
$: poetryup --latest
INFO:root:Updating dependencies to their latest available version
Using version ^0.3.15 for poetryup
Updating dependencies
Resolving dependencies... (0.1s)
Writing lock file
Package operations: 0 installs, 1 update, 2 removals
• Removing click (8.0.3)
• Removing typer (0.4.0)
• Updating poetryup (0.4.0 -> 0.3.15)
Using version ^6.2.5 for pytest
Updating dependencies
Resolving dependencies... (0.0s)
SolverProblemError
Because package depends on both pytest (^6.2.5) and pytest (^5.2), version solving failed.
at /tmp/tmp.vZGdVbq1wp/env/lib/python3.7/site-packages/poetry/puzzle/solver.py:241 in _solve
237│ packages = result.packages
238│ except OverrideNeeded as e:
239│ return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
240│ except SolveFailure as e:
→ 241│ raise SolverProblemError(e)
242│
243│ results = dict(
244│ depth_first_search(
245│ PackageNode(self._package, packages), aggregate_package_nodes
INFO:root:Found 2 dependencies in pyproject.toml
INFO:root:Bumping skipped for dependency named: poetryup I've tried to fool I see however that we can run once $: poetry add --dev dlint@^0.11.0
$: poetryup --latest
INFO:root:Updating dependencies to their latest available version
Using version ^0.12.0 for dlint
Updating dependencies
Resolving dependencies... (3.3s)
SolverProblemError
Because package depends on both dlint (^0.12.0) and dlint (^0.11.0), version solving failed.
at /tmp/tmp.vZGdVbq1wp/env/lib/python3.7/site-packages/poetry/puzzle/solver.py:241 in _solve
237│ packages = result.packages
238│ except OverrideNeeded as e:
239│ return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
240│ except SolveFailure as e:
→ 241│ raise SolverProblemError(e)
242│
243│ results = dict(
244│ depth_first_search(
245│ PackageNode(self._package, packages), aggregate_package_nodes
Using version ^0.3.15 for poetryup
Updating dependencies
Resolving dependencies... (0.1s)
Writing lock file
Package operations: 0 installs, 1 update, 2 removals
• Removing click (8.0.3)
• Removing typer (0.4.0)
• Updating poetryup (0.4.0 -> 0.3.15)
INFO:root:Found 2 dependencies in pyproject.toml
INFO:root:Bumping skipped for dependency named: poetryup The same error happens as with Funnily though, if after the downgrade of poetryup you try to install again the poetry add --dev dlint@^0.11.0
Updating dependencies
Resolving dependencies... (6.5s)
Writing lock file
Package operations: 2 installs, 1 update, 0 removals
• Installing click (8.0.3)
• Installing typer (0.4.0)
• Updating poetryup (0.3.15 -> 0.4.0 74bd22b) If you directly use Using version ^0.12.0 for dlint
Updating dependencies
Resolving dependencies... (3.8s)
Writing lock file
Package operations: 0 installs, 1 update, 0 removals
• Updating dlint (0.11.0 -> 0.12.0) |
Hmm yes I tried it with |
Hi, installing it with $: virtualenv -p `which python3.9` env
created virtual environment CPython3.9.8.final.0-64 in 188ms
creator CPython3Posix(dest=/tmp/tmp.WNwwD7mGGr/env, clear=False, global=False)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle,
wheel=bundle, via=copy, app_data_dir=~/.local/share/virtualenv)
added seed packages: pip==21.3.1, setuptools==58.5.3, wheel==0.37.0
activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivato
r
$: source env/bin/activate
$: python -m pip install git+https://github.com/MousaZeidBaker/poetryup
.git@poetryup-latest
Collecting git+https://github.com/MousaZeidBaker/poetryup.git@poetryup-latest
Cloning https://github.com/MousaZeidBaker/poetryup.git (to revision poetryup-latest) to /tmp/pip-req-bui
ld-k35mbao9
Running command git clone --filter=blob:none -q https://github.com/MousaZeidBaker/poetryup.git /tmp/pip-
req-build-k35mbao9
Running command git checkout -b poetryup-latest --track origin/poetryup-latest
Switched to a new branch 'poetryup-latest'
Branch 'poetryup-latest' set up to track remote branch 'poetryup-latest' from 'origin'.
Resolved https://github.com/MousaZeidBaker/poetryup.git to commit 74bd22bd15b3c3cd2b461f6a2f91d6c5016393
f7
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting tomlkit<0.8.0,>=0.7.2
Using cached tomlkit-0.7.2-py2.py3-none-any.whl (32 kB)
Collecting typer<0.5.0,>=0.4.0
Using cached typer-0.4.0-py3-none-any.whl (27 kB)
Collecting click<9.0.0,>=7.1.1
Using cached click-8.0.3-py3-none-any.whl (97 kB)
Building wheels for collected packages: poetryup
Building wheel for poetryup (pyproject.toml) ... done
Created wheel for poetryup: filename=poetryup-0.4.0-py3-none-any.whl size=5836 sha256=c43cc94613b28e6e9b
5e5c3ee186ac28c8d8a0c34dcb7c43efd0b2acf581cea4
Stored in directory: /tmp/pip-ephem-wheel-cache-no3d4qmk/wheels/19/87/6b/1fc6a1f95bf2f208fffaba4e3c77c05
e255f01f3e20b26993b
Successfully built poetryup
Installing collected packages: click, typer, tomlkit, poetryup
Successfully installed click-8.0.3 poetryup-0.4.0 tomlkit-0.7.2 typer-0.4.0
$: poetry new test-project [env]
Created package test_project in test-project
$: cd test-project [env]
$: poetry add --dev dlint@^0.11.0 [env]
Updating dependencies
Resolving dependencies... (0.2s)
Writing lock file
Package operations: 13 installs, 0 updates, 0 removals
• Installing mccabe (0.6.1)
• Installing pycodestyle (2.7.0)
• Installing pyflakes (2.3.1)
• Installing pyparsing (3.0.6)
• Installing attrs (21.2.0)
• Installing flake8 (3.9.2)
• Installing more-itertools (8.12.0)
• Installing packaging (21.3)
• Installing pluggy (0.13.1)
• Installing py (1.11.0)
• Installing wcwidth (0.2.5)
• Installing dlint (0.11.0)
• Installing pytest (5.4.3)
$: poetryup --latest [env]
INFO:root:Updating dependencies to their latest available version
Using version ^0.12.0 for dlint
Updating dependencies
Resolving dependencies... (0.0s)
SolverProblemError
Because test-project depends on both dlint (^0.12.0) and dlint (^0.11.0), version solving failed.
at ~/.local/lib/python3.7/site-packages/poetry/puzzle/solver.py:241 in _solve
237│ packages = result.packages
238│ except OverrideNeeded as e:
239│ return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
240│ except SolveFailure as e:
→ 241│ raise SolverProblemError(e)
242│
243│ results = dict(
244│ depth_first_search(
245│ PackageNode(self._package, packages), aggregate_package_nodes
Using version ^6.2.5 for pytest
Updating dependencies
Resolving dependencies... (0.0s)
SolverProblemError
Because test-project depends on both pytest (^6.2.5) and pytest (^5.2), version solving failed.
at ~/.local/lib/python3.7/site-packages/poetry/puzzle/solver.py:241 in _solve
237│ packages = result.packages
238│ except OverrideNeeded as e:
239│ return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
240│ except SolveFailure as e:
→ 241│ raise SolverProblemError(e)
242│
243│ results = dict(
244│ depth_first_search(
245│ PackageNode(self._package, packages), aggregate_package_nodes
INFO:root:Found 2 dependencies in pyproject.toml |
I think I realized the problem. The dependency was configured as a development one, instead of a main one, so when we try to add it as a normal one with |
Aha that explains why you were facing errors while I did not. That will be hard to support especially since |
Maybe we can start by providing support to the normal and dev dependencies, and once those groups are introduced and a user needs to upgrade them to the latest we can see how to deal with it? Probably |
Could be a start to begin with the "main" and dev dependencies and then later consider the other groups. I think we need to add this new logic to the lookup operation that |
I completely understand. Sadly after reading Should You Use Upper Bound Version Constraints? by Henry Schreiner I'm moving away from Thank you for all the time invested in this issue. It's been a nice experience :) If you feel like closing the issue, it's fine by me |
@lyz-code FYI: |
I've a similar issue with the recent version: Because app depends on both pytest (^5.4.3) and pytest (^7.1.2), version solving failed.
at /opt/poetry/lib/poetry/puzzle/solver.py:241 in _solve
237│ packages = result.packages
238│ except OverrideNeeded as e:
239│ return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
240│ except SolveFailure as e:
→ 241│ raise SolverProblemError(e)
242│
243│ results = dict(
244│ depth_first_search(
245│ PackageNode(self._package, packages), aggregate_package_nodes
|
pyproject.toml [tool.poetry]
name = "app"
version = "0.1.0"
description = ""
authors = ["Admin <admin@example.com>"]
[tool.poetry.dependencies]
python = "^3.7"
uvicorn = "^0.11.8"
fastapi = "^0.54.2"
python-multipart = "^0.0.5"
email-validator = "^1.2.1"
requests = "^2.28.1"
celery = "^4.4.7"
passlib = {extras = ["bcrypt"], version = "^1.7.4"}
tenacity = "^6.3.1"
pydantic = "^1.9.1"
emails = "^0.5.15"
raven = "^6.10.0"
gunicorn = "^20.1.0"
jinja2 = "^2.11.3"
psycopg2-binary = "^2.9.3"
alembic = "^1.8.1"
sqlalchemy = "^1.4.39"
pytest = "^5.4.3"
python-jose = {extras = ["cryptography"], version = "^3.3.0"}
[tool.poetry.dev-dependencies]
mypy = "^0.770"
black = "^19.10b0"
isort = "^4.3.21"
autoflake = "^1.4"
flake8 = "^3.9.2"
pytest = "^5.4.3"
sqlalchemy-stubs = "^0.3"
pytest-cov = "^2.12.1"
poetryup = "^0.9.0"
[tool.isort]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
line_length = 88
[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api" |
@mbnoimi its because you've declared |
@MousaZeidBaker Thanks. It works fine |
Hi @MousaZeidBaker , first of all, thanks for the awesome package, it's much needed.
I'm encountering some trouble when updating libraries that are on the
0.x.y
version, as they are ignored bypoetryup
.Steps to reproduce:
The latest version of
dlint
is0.12.0
, first we set up the environment to use the0.11.0
Desired behavior
The dependency in
pyproject.toml
should be updated to^0.12.0
Version
poetryup version
0.3.15
The text was updated successfully, but these errors were encountered: