Skip to content
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

Ability to set --check-url option in pyproject.toml or uv.toml #9027

Open
bruckner opened this issue Nov 11, 2024 · 4 comments · May be fixed by #9032
Open

Ability to set --check-url option in pyproject.toml or uv.toml #9027

bruckner opened this issue Nov 11, 2024 · 4 comments · May be fixed by #9032
Assignees
Labels
configuration Settings and such needs-decision Undecided if this should be done

Comments

@bruckner
Copy link

I'm using the new --check-url feature introduced in #8531 to support to ability to uv publish skip uploads when an artifact already exists. It's great!

This is a request for a minor enhancement: to be able to set check-url in a configuration file instead of only on the command line.

Running with the parameter set on the command line I get the expected behavior:

$ uv publish --check-url https://<my-pypi-url> --verbose
...snip...
File <my-package>+gf9b8e7c45.d20241111.tar.gz already exists, skipping

But when I tried moving it to my pyproject.toml:

[tool.uv]
publish-url = "<my-pypi-url>"
check-url = "https://<my-pypi-url>"

And got the warning message:

$ uv publish --verbose
...snip...
warning: Failed to parse `pyproject.toml` during settings discovery:
  TOML parse error at line 22, column 1
     |
  22 | check-url = "https://<my-pypi-url>"
     | ^^^^^^^^^
  unknown field `check-url`, expected one of `native-tls`, `offline`, `no-cache`, `cache-dir`, `preview`, `python-preference`, `python-downloads`, `concurrent-downloads`, `concurrent-builds`, `concurrent-installs`, `index`, `index-url`, `extra-index-url`, `no-index`, `find-links`, `index-strategy`, `keyring-provider`, `allow-insecure-host`, `resolution`, `prerelease`, `dependency-metadata`, `config-settings`, `no-build-isolation`, `no-build-isolation-package`, `exclude-newer`, `link-mode`, `compile-bytecode`, `no-sources`, `upgrade`, `upgrade-package`, `reinstall`, `reinstall-package`, `no-build`, `no-build-package`, `no-binary`, `no-binary-package`, `publish-url`, `trusted-publishing`, `pip`, `cache-keys`, `override-dependencies`, `constraint-dependencies`, `environments`, `workspace`, `sources`, `managed`, `package`, `default-groups`, `dev-dependencies`

The expected behavior for this enhancement would be that setting check-url in a configuration file has the same effect as if it were set on the command line.

For reference, I've seen the behavior described above with uv 0.5.0 and 0.5.1 on macos and ubuntu.

Thank you!

@zanieb
Copy link
Member

zanieb commented Nov 11, 2024

I believe this would be solved by my suggestion at #8531 (comment)

@charliermarsh
Copy link
Member

Oh that's a nice solution.

@bruckner
Copy link
Author

@zanieb thanks for the super quick uptake. I like the suggestion to consolidate under the Index config, partly for reasons tangential to this issue. I use Google Artifact Registry and have to configure auth two distinct ways for read and write (username in the URL for reads, username via --username for writes). This was confusing to get working initially—would be really nice to consolidate all URLs and auth config under one localized umbrella for the Index.

That said, a quick fix for this issue would be valuable pending any discussion planning required for something like the above.

bruckner added a commit to bruckner/uv that referenced this issue Nov 11, 2024
Fixes astral-sh#9027

Minor enhancement on top of astral-sh#8531 that allows CLI parameter
`--check-url` also available as the setting `check-url` in configuration
files.
bruckner added a commit to bruckner/uv that referenced this issue Nov 11, 2024
Fixes astral-sh#9027

Minor enhancement on top of astral-sh#8531 that allows CLI parameter
`--check-url` also available as the setting `check-url` in configuration
files.
bruckner added a commit to bruckner/uv that referenced this issue Nov 11, 2024
Fixes astral-sh#9027

Minor enhancement on top of astral-sh#8531 that makes the CLI parameter
`--check-url` also available as the setting `check-url` in configuration
files.
@bruckner bruckner linked a pull request Nov 11, 2024 that will close this issue
bruckner added a commit to bruckner/uv that referenced this issue Nov 11, 2024
Fixes astral-sh#9027

Minor enhancement on top of astral-sh#8531 that makes the CLI parameter
`--check-url` also available as the setting `check-url` in configuration
files.
@bruckner
Copy link
Author

bruckner commented Nov 11, 2024

@konstin - when I looked at your code I saw this appears to be a trivial extension so I put up a PR ^

@charliermarsh charliermarsh added configuration Settings and such needs-decision Undecided if this should be done labels Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
configuration Settings and such needs-decision Undecided if this should be done
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants