Closed abazabaaa closed 3 months ago
Yeah this looks wrong. We should be respecting the configuration there.
Just clarifying, it does not work even with UV_CONFIG_FILE=...
?
Correct, is does not seem to make a difference.
export UV_CONFIG_FILE=/xxxxxx/uv.toml
uv run openeyetest.py
Reading inline script metadata from: openeyetest.py
× No solution found when resolving script dependencies:
╰─▶ Because there are no versions of openeye-toolkits and you require openeye-toolkits, we can conclude that your requirements are unsatisfiable.
I can see it correctly set in the help.
uv --help
...
Global options:
-q, --quiet Do not print any output
-v, --verbose... Use verbose output
--color uv.toml
file to use for configuration [env: UV_CONFIG_FILE=/xxxxxv/uv.toml]
--no-config Avoid discovering configuration files (pyproject.toml
, uv.toml
) [env: UV_NO_CONFIG=]
-h, --help Display the concise help for this command
-V, --version Display the uv version
Use uv help
for more details.
Ok thanks.
Just to further confirm this with an internal pypi server which I have in my uv.toml as my index-url: [pip] index-url = "xxxx.com/simple/" extra-index-url = ["https://token:[xxxxxxxx@magpie.eyesopen.com](mailto:xxxxxxxx@magpie.eyesopen.com)/simple", "https://download.pytorch.org/whl/cu121"]
I was unable to run pydingertest.py after adding "pydinger" with uv add --script pydingertest.py "pydinger"
uv run pydingertest.py
Reading inline script metadata from: pydingertest.py
× No solution found when resolving script dependencies:
╰─▶ Because pydinger was not found in the package registry and you require pydinger, we can conclude that your requirements are unsatisfiable.
It was successful in the micromamba env with the same version of uv (0.3).
micromamba activate test2
uv pip install pydinger
Resolved 23 packages in 14.19s
Built pydinger==1.0.3
Built ldclient==2023.2.2
Prepared 8 packages in 6.45s
░░░░░░░░░░░░░░░░░░░░ [0/22] Installing wheels... warning: Failed to hardlink files; falling back to full copy. This may lead to degraded performance.
If the cache and target directories are on different filesystems, hardlinking may not be supported.
If this is intentional, set UV_LINK_MODE=copy
or use --link-mode=copy
to suppress this warning.
Installed 22 packages in 31.93s
So it seems that our internal pypi server is not getting searched on the cargo version.
Oh sorry -- can you change:
[pip]
index-url = "xxxx.com/simple/"
extra-index-url = ["https://token:[xxxxxxxx@magpie.eyesopen.com](mailto:xxxxxxxx@magpie.eyesopen.com)/simple", "https://download.pytorch.org/whl/cu121"]
To:
index-url = "xxxx.com/simple/"
extra-index-url = ["https://token:[xxxxxxxx@magpie.eyesopen.com](mailto:xxxxxxxx@magpie.eyesopen.com)/simple", "https://download.pytorch.org/whl/cu121"]
Settings under [pip]
only apply to uv pip
, but settings at the top-level apply everywhere.
Fixed!!
So just to be clear, I can also have a [pip] so that my uv pip works the same?
If you write it without [pip]
, it will also affect uv pip
. It's just that if you write it with [pip]
, it doesn't affect uv run
and other APIs. Does that make sense?
In other words, you only need the version without [pip]
.
(We kept the [pip]
table for backwards compatibility.)
Yes, it makes sense.
Hi,
I believe this to be a bug.
When creating a micromamba env (micromamba -n test2 python=3.11) and then installing uv with pip I am able to run the following and get a successful installation:
uv pip install openeye-toolkits
uv pip install openeye-toolkits Resolved 1 package in 1.04s ░░░░░░░░░░░░░░░░░░░░ [0/1] Installing wheels... warning: Failed to hardlink files; falling back to full copy. This may lead to degraded performance. If the cache and target directories are on different filesystems, hardlinking may not be supported. If this is intentional, setUV_LINK_MODE=copy
or use--link-mode=copy
to suppress this warning. Installed 1 package in 20.55sopeneye-toolkits==2024.1.1
When I create the python script (this time using the cargo install of uv, ~/.cargo/bin/uv) below:
uv add --script openeyetest.py "openeye-toolkits" "numpy"
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "openeye-toolkits",
# "numpy",
# ]
# ///
from openeye import oechem, oegraphsim
import numpy as np
# Create an OEBitVector object from a molecule fingerprint
mol = oechem.OEGraphMol()
oechem.OEParseSmiles(mol,'c1ccccc1')
fp = oegraphsim.OEFingerPrint()
oegraphsim.OEMakeMACCS166FP(fp, mol)
bitv = [0]*fp.GetSize()
# bitv = np.array([0]*fp.GetSize())
bit = fp.FirstBit()
while bit != -1:
bitv[bit]=1
bit=fp.NextBit(bit)
packed = np.packbits(bitv)
unpacked = np.unpackbits(packed)
print(packed)
print(unpacked)
I then do:
uv run openeyetest.py
Reading inline script metadata from: openeyetest.py × No solution found when resolving script dependencies: ╰─▶ Because there are no versions of openeye-toolkits and you require openeye-toolkits, we can conclude that your requirements are unsatisfiable.My ~/.uv/uv.toml is as follows (truncated paths and removed token): [pip] index-url = "xxxx.com/simple/" extra-index-url = ["https://token:xxxxxxxx@magpie.eyesopen.com/simple", "https://download.pytorch.org/whl/cu121"]
I have additionally tried various versions of python in the header of openeyetest.py (python==3.11.9 ; which works with the openeye-toolkits). I have exported the path to uv.toml so that it was set (export UV_CONFIG_FILE=/xxx/uv.toml)
uv --version uv 0.3.0
Other than this, things seem to be working ok.