-
Notifications
You must be signed in to change notification settings - Fork 998
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
uv export
should allow --universal
#8718
Comments
|
Notice that the operation here doesn't take platform markers into account at all. You don't even need to have Python installed if you run with let export = RequirementsTxtExport::from_lock(
&lock,
project.project_name(),
&extras,
&dev.with_defaults(defaults),
editable,
hashes,
&install_options,
)?; |
I have different outputs from MacOS vs Github actions Ubuntu-latest: # .pre-commit-config.yaml
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.4.28
hooks:
- id: uv-lock
args: [ "--frozen" ]
- id: uv-export # export core dependencies to requirements.txt
args: [ "--frozen", "--output-file=requirements/requirements.txt", "--quiet", "--no-dev"]
- id: uv-export # export core and dev dependencies to requirements-dev.txt
args: [ "--frozen", "--output-file=requirements/requirements-dev.txt", "--quiet", "--dev"] # .github/workflows/ci.yaml
...
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "0.4.18"
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: '.python-version'
- name: Lint
run: uv run pre-commit run -a --show-diff-on-failure # .pyproject.toml
[project]
...
dependencies = [
"apache-airflow-providers-snowflake>=5.8.0",
]
[dependency-groups]
dev = [
"apache-airflow>=2.10.2",
"pre-commit>=4.0.1",
"pytest>=8.3.3",
] There are more diffs (more than hash, transient dependency differences) if i include dev dependencies |
Looks like you didn't share the diff? |
This is the CI result in Github actions, I can confirm
|
It's really hard to say what's happening here without being able to reproduce it myself. I will note though that you seem to be using uv 0.4.18 in the setup action, but then 0.4.28 in the pre-commit action? My guess is you're seeing something weird from the disparate, nested uv versions. 0.4.18 also doesn't support |
Version |
I can see that when run (since this is company work, i cannot share the repo with you). |
@TiansuYu As of now, the most recent version is 0.4.29. |
You have 0.4.18 here: - name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "0.4.18"
enable-cache: true
cache-dependency-glob: "uv.lock" |
Yeah I'm guessing the different uv versions means the |
Thanks, that was a good catch. I made a mistake here, thought I set everything to be |
I read it somewhere, saying soon, there will be param that tells uv versions directly in the pyproject.toml? |
You're talking about #8605, right? It seems to be under evaluation for necessity. |
Currently,
uv export
compiles dependencies with different list of hashes on different OS. This causes consistency issues during CI remotely vs locally. Ideally, this should allow--universal
option to compile all list of hashes available on all platforms.FYI, my setup is to automate this exporting process via pre-commit hooks, so I am expecting it should perform consistently, regardless of what kind of machines run it.
The text was updated successfully, but these errors were encountered: