-
Notifications
You must be signed in to change notification settings - Fork 100
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
Inline project meta #776
Comments
On the first look, I like this approach over script metadata.
WDYT? |
We should prioritize a unified approach that works in both - UI as well as CLI. User should be able to copy-past from CLI to SaaS or opposite without even thinking about this 🙂 So, it's ok to have a customization in UI (as we have it now) but I'd try to deprioritize it and potentially get rid ot it completely. |
uv run myscript.py natively supports the comment way - PEP 723. It looks really good! |
that looks cool! :) |
I've tested this - works like a charm. More details:
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "pandas < 2.1.0"
# ]
# ///
import sys
import pandas as pd
print(f"Python version: {sys.version_info}")
print(f"Pandas version: {pd.__version__}") First run: $ time uv run test_inline.py
Reading inline script metadata from `test_inline.py`
Installed 6 packages in 114ms
Python version: sys.version_info(major=3, minor=13, micro=1, releaselevel='final', serial=0)
Pandas version: 2.2.3
real 0m17.804s
user 0m2.084s
sys 0m1.277s Next run: $ time uv run test_inline.py
Reading inline script metadata from `test_inline.py`
Python version: sys.version_info(major=3, minor=13, micro=1, releaselevel='final', serial=0)
Pandas version: 2.2.3
real 0m0.443s
user 0m0.344s
sys 0m0.087s |
Description
To increase scripts reusability, it would be great to have all project meta in one place.
An alternative approach - using https://peps.python.org/pep-0723/
The text was updated successfully, but these errors were encountered: