You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apologies if this is a duplicate but I can't find any other issues mentioning this.
#6481 added support for passing scripts into uv using stdin which is great addition, but it seems to be inconsistent for me when it comes to inline dependencies. The example script on this doc page usually works:
> cat example.py
# /// script# dependencies = [# "requests<3",# "rich",# ]# ///
import requests
from rich.pretty import pprint
resp = requests.get("https://peps.python.org/api/peps.json")
data = resp.json()
pprint([(k, v["title"]) fork, vindata.items()][:10])
> cat example.py | uv run -
[
│ ('1', 'PEP Purpose and Guidelines'),
│ ('2', 'Procedure for Adding New Modules'),
│ ('3', 'Guidelines for Handling Bug Reports'),
│ ('4', 'Deprecation of Standard Modules'),
│ ('5', 'Guidelines for Language Evolution'),
│ ('6', 'Bug Fix Releases'),
│ ('7', 'Style Guide for C Code'),
│ ('8', 'Style Guide for Python Code'),
│ ('9', 'Sample Plaintext PEP Template'),
│ ('10', 'Voting Guidelines')
]
But will occasionally stop working for no apparent reason (this time with debug messages):
> cat example.py | uv run -v -
DEBUG uv 0.4.20 (Homebrew 2024-10-08)
DEBUG No project found; searching for Python interpreter
DEBUG Searching fordefault Python interpreterin managed installations or system path
DEBUG Found `cpython-3.11.10-macos-aarch64-none` at `/Users/matthewcane/Documents/tmp/uv-inline/.venv/bin/python3` (virtual environment)
DEBUG Using Python 3.11.10 interpreter at: /Users/matthewcane/Documents/tmp/uv-inline/.venv/bin/python3
DEBUG Running `python -c`
Traceback (most recent call last):
File "<string>", line 8, in<module>
ModuleNotFoundError: No module named 'requests'
DEBUG Command exited with code: 1
A script using Polars (or Pandas) which works when called normally has never worked for me when passed in through stdin:
For all of these tests I have ensured I am not in a VENV or anything like that. Please let me know if there are any tests I can run to get to the bottom of this issue.
And as always, thank you for all your hard work!!!
The text was updated successfully, but these errors were encountered:
platform: MacOS Sequoia 15.0.1
uv version:: 0.4.20 (Homebrew 2024-10-08)
shell: zsh 5.9 (arm64-apple-darwin24.0)
Apologies if this is a duplicate but I can't find any other issues mentioning this.
#6481 added support for passing scripts into
uv
using stdin which is great addition, but it seems to be inconsistent for me when it comes to inline dependencies. The example script on this doc page usually works:But will occasionally stop working for no apparent reason (this time with debug messages):
A script using Polars (or Pandas) which works when called normally has never worked for me when passed in through stdin:
For all of these tests I have ensured I am not in a VENV or anything like that. Please let me know if there are any tests I can run to get to the bottom of this issue.
And as always, thank you for all your hard work!!!
The text was updated successfully, but these errors were encountered: