Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Consider setting a lower bound warning from root package #8155

Closed
DanielYang59 opened this issue Oct 13, 2024 · 10 comments · Fixed by #9644
Closed

Get Consider setting a lower bound warning from root package #8155

DanielYang59 opened this issue Oct 13, 2024 · 10 comments · Fixed by #9644
Labels
bug Something isn't working

Comments

@DanielYang59
Copy link

DanielYang59 commented Oct 13, 2024

Presumably a partial duplicate of #5227, getting the following warning for the root package itself both inside the Github workflow environment (could also recreate in my MacOS machine), with all dependencies in ci,optional have a lower bound:

warning: The direct dependency `pymatgen` is unpinned. Consider setting a lower bound when using `--resolution-strategy lowest` to avoid using outdated versions.
warning: The direct dependency `pymatgen[ci]` is unpinned. Consider setting a lower bound when using `--resolution-strategy lowest` to avoid using outdated versions.
warning: The direct dependency `pymatgen[optional]` is unpinned. Consider setting a lower bound when using `--resolution-strategy lowest` to avoid using outdated versions.

With the following command in test.yml (could also recreate in MacOS command line):

uv pip install dist/pymatgen-2024.10.3.tar.gz
uv pip install pymatgen[ci,optional] --resolution=lowest

uv version: uv-0.4.20


Perhaps I was using the command incorrectly (Intend to install from sdist with extras)?

@DanielYang59 DanielYang59 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 13, 2024
@DanielYang59 DanielYang59 reopened this Oct 13, 2024
@konstin konstin added the bug Something isn't working label Oct 13, 2024
konstin added a commit that referenced this issue Nov 28, 2024
Whenever we see an unpinned proxy package, we know that its base package is also unpinned and emitted a warning.

Part 1 of 2 for #8155
@konstin
Copy link
Member

konstin commented Nov 28, 2024

The warnings for the extras were a bug, fixed in #9497. For the resolution lowest test, can you do the following:

uv pip install dist/pymatgen-2024.10.3.tar.gz pymatgen[ci,optional] --resolution=lowest

Separate uv pip install invocations don't know about each other. With a regular (highest) resolution, we try to keep the versions also installed by treating them as preferred in the resolver. But with the lowest resolution, we are simulation the "worst case" of a user with lots of conflicting requirements that force old dependency versions. If you place both the file and the in one command, the resolver pins pymatgen to 2024.10.3 (we need to install the package, we can pick some other version form somewhere else), so we know that everything about pymatgen[ci,optional] is constrained.

konstin added a commit that referenced this issue Nov 28, 2024
Whenever we see an unpinned proxy package, we know that its base package
is also unpinned and emitted a warning.

Part 1 of 2 for #8155
@DanielYang59
Copy link
Author

DanielYang59 commented Nov 30, 2024

Thanks a lot for the timely fix and for providing the additional context, I would update the install command :) I cannot appreciate more!

@DanielYang59
Copy link
Author

DanielYang59 commented Nov 30, 2024

Update: I just build the uv from source to test the patch (with cargo install --git https://github.com/astral-sh/uv uv), looks like the warnings for extras are indeed gone, but I'm still getting the warning for the root package for some reason? Can you help me double check if I was using the wrong command?

uv pip install dist/pymatgen-2024.11.13-cp312-cp312-macosx_15_0_arm64.whl 'pymatgen[ci,optional]' --resolution=lowest

# Got the same warning installing from sdist
uv pip install dist/pymatgen-2024.11.13.tar.gz 'pymatgen[ci,optional]' --resolution=lowest

Gives:

Using Python 3.12.7 environment at: venv312
⠙ Resolving dependencies...                                                                                                                         
warning: The direct dependency `pymatgen` is unpinned. Consider setting a lower bound when using `--resolution lowest` to avoid using outdated versions.
Resolved 171 packages in 2.55s
Installed 1 package in 15ms
 + pymatgen==2024.11.13 (from file:///Users/yang/developer/pymatgen/dist/pymatgen-2024.11.13-cp312-cp312-macosx_15_0_arm64.whl)

warning: The transitive dependency `isoduration` is unpinned. Consider setting a lower bound with a constraint when using `--resolution lowest` to avoid using outdated versions.
warning: The transitive dependency `pure-eval` is unpinned. Consider setting a lower bound with a constraint when using `--resolution lowest` to avoid using outdated versions.
warning: The transitive dependency `scikit-learn` is unpinned. Consider setting a lower bound with a constraint when using `--resolution lowest` to avoid using outdated versions.
warning: The transitive dependency `pytorch-lightning` is unpinned. Consider setting a lower bound with a constraint when using `--resolution lowest` to avoid using outdated versions.
warning: The transitive dependency `vapory` is unpinned. Consider setting a lower bound with a constraint when using `--resolution lowest` to avoid using outdated versions.
warning: The transitive dependency `filelock` is unpinned. Consider setting a lower bound with a constraint when using `--resolution lowest` to avoid using outdated versions.
warning: The transitive dependency `symfc` is unpinned. Consider setting a lower bound with a constraint when using `--resolution lowest` to avoid using outdated versions.
warning: The transitive dependency `tinycss2` is unpinned. Consider setting a lower bound with a constraint when using `--resolution lowest` to avoid using outdated versions.
warning: The transitive dependency `aiohttp` is unpinned. Consider setting a lower bound with a constraint when using `--resolution lowest` to avoid using outdated versions.
warning: The transitive dependency `nest-asyncio` is unpinned. Consider setting a lower bound with a constraint when using `--resolution lowest` to avoid using outdated versions.
warning: The transitive dependency `notebook` is unpinned. Consider setting a lower bound with a constraint when using `--resolution lowest` to avoid using outdated versions.
warning: The transitive dependency `stack-data` is unpinned. Consider setting a lower bound with a constraint when using `--resolution lowest` to avoid using outdated versions.
warning: The transitive dependency `decorator` is unpinned. Consider setting a lower bound with a constraint when using `--resolution lowest` to avoid using outdated versions.
warning: The transitive dependency `beautifulsoup4` is unpinned. Consider setting a lower bound with a constraint when using `--resolution lowest` to avoid using outdated versions.
warning: The transitive dependency `uri-template` is unpinned. Consider setting a lower bound with a constraint when using `--resolution lowest` to avoid using outdated versions.
warning: The transitive dependency `jupyterlab-pygments` is unpinned. Consider setting a lower bound with a constraint when using `--resolution lowest` to avoid using outdated versions.
warning: The transitive dependency `rfc3339-validator` is unpinned. Consider setting a lower bound with a constraint when using `--resolution lowest` to avoid using outdated versions.
warning: The transitive dependency `pydantic` is unpinned. Consider setting a lower bound with a constraint when using `--resolution lowest` to avoid using outdated versions.
warning: The transitive dependency `wcwidth` is unpinned. Consider setting a lower bound with a constraint when using `--resolution lowest` to avoid using outdated versions.
warning: The transitive dependency `cftime` is unpinned. Consider setting a lower bound with a constraint when using `--resolution lowest` to avoid using outdated versions.
warning: The transitive dependency `iniconfig` is unpinned. Consider setting a lower bound with a constraint when using `--resolution lowest` to avoid using outdated versions.
warning: The transitive dependency `pycparser` is unpinned. Consider setting a lower bound with a constraint when using `--resolution lowest` to avoid using outdated versions.
warning: The transitive dependency `argon2-cffi-bindings` is unpinned. Consider setting a lower bound with a constraint when using `--resolution lowest` to avoid using outdated versions.
warning: The transitive dependency `fqdn` is unpinned. Consider setting a lower bound with a constraint when using `--resolution lowest` to avoid using outdated versions.
warning: The transitive dependency `defusedxml` is unpinned. Consider setting a lower bound with a constraint when using `--resolution lowest` to avoid using outdated versions.
warning: The transitive dependency `bleach` is unpinned. Consider setting a lower bound with a constraint when using `--resolution lowest` to avoid using outdated versions.
warning: The transitive dependency `lightning` is unpinned. Consider setting a lower bound with a constraint when using `--resolution lowest` to avoid using outdated versions.
warning: The transitive dependency `appnope` is unpinned. Consider setting a lower bound with a constraint when using `--resolution lowest` to avoid using outdated versions.

@DanielYang59 DanielYang59 reopened this Nov 30, 2024
@charliermarsh
Copy link
Member

I think that should arguably not error but what you want is:

uv pip install "dist/pymatgen-2024.11.13-cp311-cp311-macosx_11_0_arm64.whl[ci,optional]" --resolution=lowest

Right now, it's as if you provided two dependencies: the URL, alongside an unpinned pymatgen.

@charliermarsh
Copy link
Member

It would also be solved by #9540.

@DanielYang59
Copy link
Author

DanielYang59 commented Dec 1, 2024

Thanks for the input and for the fix :) I would correct my uv pip install usage.

Also cheers for the wonderful tool

I could confirm I'm not getting that unpinned warning (though another failed to uninstall package warning popped up as I'm not installing in a "clean env" but reinstall in a previous env, but I guess it's not related to current issue):

>>> uv pip install dist/pymatgen-2024.11.13.tar.gz[ci,optional] --resolution=lowest

Using Python 3.12.7 environment at: venv312
Resolved 181 packages in 2.57s
   Built pymatgen @ file:///home/yang/developer/pymatgen/dist/pymatgen-2024.11.13.tar.gz
Prepared 3 packages in 21.92s
warning: Failed to uninstall package at venv312/lib/python3.12/site-packages/uncertainties.egg-info due to missing `top-level.txt` file. Installation may result in an incomplete environment.
Uninstalled 3 packages in 3ms
Installed 3 packages in 8ms
 - netcdf4==1.7.2
 + netcdf4==1.6.5
 + pymatgen==2024.11.13 (from file:///home/yang/developer/pymatgen/dist/pymatgen-2024.11.13.tar.gz)
 - uncertainties==2.4.4
 ~ uncertainties==3.1.4

And finally some off-topic comment in case it might be helpful, but I found the --quiet option for uv build too strong, i.e. it suppressed all output (which agrees with the documentation), perhaps at least show warnings and the final built finished like Successfully built pymatgen-2024.11.13.tar.gz)?

--quiet, -q
Do not print any output

@zanieb
Copy link
Member

zanieb commented Dec 3, 2024

@DanielYang59 there's a secret --no-build-logs flag, does that get you what you want output-wise?

@DanielYang59
Copy link
Author

Hi @zanieb thanks for letting me know, this looks much rational, just wondering is it stable enough to be used in production (i.e. would it be renamed/removed at some point)?

>>> uv build --sdist --no-build-logs

Building source distribution...
Successfully built dist/pymatgen-2024.11.13.tar.gz

@zanieb
Copy link
Member

zanieb commented Dec 4, 2024

It's stable, we're using it in our tests. I can unhide it.

konstin added a commit that referenced this issue Dec 4, 2024
In #8155 (comment), resolution lowest was complaining about missing lower bounds for a pacakge, even though the package had a URL, too:

```
uv pip install dist/pymatgen-2024.10.3.tar.gz pymatgen[ci,optional] --resolution=lowest
```

The error was raised from `pymatgen[ci,optional]`, because we were looking at it before looking at the "URL" `dist/pymatgen-2024.10.3.tar.gz`.

I've also added constraints and overrides to the bounds lookup, since they are missing from the dependency graph.
@DanielYang59
Copy link
Author

Thanks a lot for the input and for the additional work :) Really appreciate that!

konstin added a commit that referenced this issue Dec 5, 2024
In #8155 (comment),
resolution lowest was complaining about missing lower bounds for a
pacakge, even though the package had a URL, too:

```
uv pip install dist/pymatgen-2024.10.3.tar.gz pymatgen[ci,optional] --resolution=lowest
```

The error was raised from `pymatgen[ci,optional]`, because we were
looking at it before looking at the "URL"
`dist/pymatgen-2024.10.3.tar.gz`.

I've also added constraints and overrides to the bounds lookup, since
they are missing from the dependency graph.

Fixes #8155 (again)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants