Skip to content

Commit

Permalink
fix: remove uv version from uv pip compile header (#1716)
Browse files Browse the repository at this point in the history
## Summary

This fixes #1704 by removing the
version from the produced header.

## Test Plan

Checked with clippy, and tests are updated too.
  • Loading branch information
henryiii authored Feb 19, 2024
1 parent 9efbc1f commit c6fd3d9
Show file tree
Hide file tree
Showing 15 changed files with 80 additions and 86 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ flask>=2.0.0
Running `uv pip compile requirements.in` would produce the following `requirements.txt` file:

```text
# This file was autogenerated by uv v0.0.1 via the following command:
# This file was autogenerated by uv via the following command:
# uv pip compile requirements.in
blinker==1.7.0
# via flask
Expand All @@ -234,7 +234,7 @@ werkzeug==3.0.1
However, `uv pip compile --resolution=lowest requirements.in` would instead produce:

```text
# This file was autogenerated by uv v0.0.1 via the following command:
# This file was autogenerated by uv via the following command:
# uv pip compile requirements.in --resolution=lowest
click==7.1.2
# via flask
Expand Down
5 changes: 1 addition & 4 deletions crates/uv/src/commands/pip_compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ use crate::commands::{elapsed, ExitStatus};
use crate::printer::Printer;
use crate::requirements::{ExtrasSpecification, RequirementsSource, RequirementsSpecification};

const VERSION: &str = env!("CARGO_PKG_VERSION");

/// Resolve a set of requirements into a set of pinned versions.
#[allow(clippy::too_many_arguments, clippy::fn_params_excessive_bools)]
pub(crate) async fn pip_compile(
Expand Down Expand Up @@ -346,8 +344,7 @@ pub(crate) async fn pip_compile(
writeln!(
writer,
"{}",
format!("# This file was autogenerated by uv v{VERSION} via the following command:")
.green()
"# This file was autogenerated by uv via the following command:".green()
)?;
writeln!(
writer,
Expand Down
3 changes: 0 additions & 3 deletions crates/uv/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ pub const INSTA_FILTERS: &[(&str, &str)] = &[
(r"--cache-dir [^\s]+", "--cache-dir [CACHE_DIR]"),
// Operation times
(r"(\d+m )?(\d+\.)?\d+(ms|s)", "[TIME]"),
// uv versions
(r"v\d+\.\d+\.\d+-prerelease\.\d+", "v[VERSION]"),
(r"v\d+\.\d+\.\d+", "v[VERSION]"),
// File sizes
(r"(\d+\.)?\d+([KM]i)?B", "[SIZE]"),
// Rewrite Windows output to Unix output
Expand Down
128 changes: 64 additions & 64 deletions crates/uv/tests/pip_compile.rs

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions crates/uv/tests/pip_compile_scenarios.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ fn requires_incompatible_python_version_compatible_override() -> Result<()> {
success: true
exit_code: 0
----- stdout -----
# This file was autogenerated by uv v[VERSION] via the following command:
# This file was autogenerated by uv via the following command:
# uv pip compile requirements.in --extra-index-url https://test.pypi.org/simple --cache-dir [CACHE_DIR] --python-version=3.11
albatross==1.0.0
Expand Down Expand Up @@ -234,7 +234,7 @@ fn requires_incompatible_python_version_compatible_override_no_wheels_available_
success: true
exit_code: 0
----- stdout -----
# This file was autogenerated by uv v[VERSION] via the following command:
# This file was autogenerated by uv via the following command:
# uv pip compile requirements.in --extra-index-url https://test.pypi.org/simple --cache-dir [CACHE_DIR] --python-version=3.11
albatross==1.0.0
Expand Down Expand Up @@ -454,7 +454,7 @@ fn requires_python_patch_version_override_patch_compatible() -> Result<()> {
success: true
exit_code: 0
----- stdout -----
# This file was autogenerated by uv v[VERSION] via the following command:
# This file was autogenerated by uv via the following command:
# uv pip compile requirements.in --extra-index-url https://test.pypi.org/simple --cache-dir [CACHE_DIR] --python-version=3.8.0
albatross==1.0.0
Expand Down
2 changes: 1 addition & 1 deletion scripts/bench/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was autogenerated by uv v0.0.3 via the following command:
# This file was autogenerated by uv via the following command:
# uv pip compile scripts/bench/requirements.in -o scripts/bench/requirements.txt
blinker==1.7.0
# via pdm
Expand Down
2 changes: 1 addition & 1 deletion scripts/requirements/compiled/all-kinds.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was autogenerated by uv v0.0.1 via the following command:
# This file was autogenerated by uv via the following command:
# uv pip compile scripts/requirements/all-kinds.in
annotated-types==0.6.0
# via pydantic
Expand Down
2 changes: 1 addition & 1 deletion scripts/requirements/compiled/black.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was autogenerated by uv v0.0.1 via the following command:
# This file was autogenerated by uv via the following command:
# uv pip compile scripts/requirements/black.in
black==23.12.1
click==8.1.7
Expand Down
2 changes: 1 addition & 1 deletion scripts/requirements/compiled/boto3.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was autogenerated by uv v0.0.1 via the following command:
# This file was autogenerated by uv via the following command:
# uv pip compile scripts/requirements/boto3.in
boto3==1.7.84
botocore==1.10.84
Expand Down
2 changes: 1 addition & 1 deletion scripts/requirements/compiled/dtlssocket.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was autogenerated by uv v0.0.1 via the following command:
# This file was autogenerated by uv via the following command:
# uv pip compile scripts/requirements/dtlssocket.in
cython==0.29.37
# via dtlssocket
Expand Down
2 changes: 1 addition & 1 deletion scripts/requirements/compiled/flyte.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was autogenerated by uv v0.0.1 via the following command:
# This file was autogenerated by uv via the following command:
# uv pip compile scripts/requirements/flyte.in
absl-py==2.0.0
# via
Expand Down
2 changes: 1 addition & 1 deletion scripts/requirements/compiled/jupyter.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was autogenerated by uv v0.0.3 via the following command:
# This file was autogenerated by uv via the following command:
# uv pip compile scripts/requirements/jupyter.in
anyio==4.2.0
# via jupyter-server
Expand Down
2 changes: 1 addition & 1 deletion scripts/requirements/compiled/pdm_2193.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was autogenerated by uv v0.0.1 via the following command:
# This file was autogenerated by uv via the following command:
# uv pip compile scripts/requirements/pdm_2193.in
certifi==2023.11.17
# via requests
Expand Down
2 changes: 1 addition & 1 deletion scripts/requirements/compiled/scispacy.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was autogenerated by uv v0.0.1 via the following command:
# This file was autogenerated by uv via the following command:
# uv pip compile scripts/requirements/scispacy.in
annotated-types==0.6.0
# via pydantic
Expand Down
2 changes: 1 addition & 1 deletion scripts/requirements/compiled/trio.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was autogenerated by uv v0.0.1 via the following command:
# This file was autogenerated by uv via the following command:
# uv pip compile scripts/requirements/trio.in
alabaster==0.7.15
# via sphinx
Expand Down

0 comments on commit c6fd3d9

Please sign in to comment.