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

Support index declarations in uv publish #8864

Closed
4 tasks done
Tracked by #7839
konstin opened this issue Nov 6, 2024 · 0 comments · Fixed by #9694
Closed
4 tasks done
Tracked by #7839

Support index declarations in uv publish #8864

konstin opened this issue Nov 6, 2024 · 0 comments · Fixed by #9694
Labels
enhancement New feature or improvement to existing functionality

Comments

@konstin
Copy link
Member

konstin commented Nov 6, 2024

We want to support uv publish --index example with:

[[index]]
name = "example"
url = "https://pypi.org/simple"
publish-url = "https://upload.pypi.org/legacy"

This avoids setting the options on the CLI, moving them into configuration stored with the project instead.

It requires changing uv publish so that if --index <name> is given, we discover (and require) pyproject.toml to be present.

See also #8531 (comment)

Todo list:

  • Add publish-url option to [[index]]
  • Add --index option, conflicting with --publish-url and --check-url.
  • When using --index, perform workspace discovery, find a matching index and use that
  • Update the docs
@konstin konstin added the enhancement New feature or improvement to existing functionality label Nov 6, 2024
konstin added a commit that referenced this issue Dec 6, 2024
When publishing, we currently ask the user to set `--publish-url` to the upload URl and `--check-url` to the simple index URL, or the equivalent configuration keys. But that's redundant with the `[[tool.uv.index]]` declaration. Instead, we extend `[[tool.uv.index]]` with a `publish-url` entry and allow passing `uv publish --index <name>`.

`uv publish --index <name>` requires the `pyproject.toml` to be present when publishing, unlike using `--publish-url ... --check-url ...` which can be used e.g. in CI without a checkout step. `--index` also always uses the check URL feature to aid upload consistency.

The documentation tries to explain both approaches together, which overlap for the check URL feature.

Fixes #8864
konstin added a commit that referenced this issue Dec 6, 2024
When publishing, we currently ask the user to set `--publish-url` to the upload URl and `--check-url` to the simple index URL, or the equivalent configuration keys. But that's redundant with the `[[tool.uv.index]]` declaration. Instead, we extend `[[tool.uv.index]]` with a `publish-url` entry and allow passing `uv publish --index <name>`.

`uv publish --index <name>` requires the `pyproject.toml` to be present when publishing, unlike using `--publish-url ... --check-url ...` which can be used e.g. in CI without a checkout step. `--index` also always uses the check URL feature to aid upload consistency.

The documentation tries to explain both approaches together, which overlap for the check URL feature.

Fixes #8864
konstin added a commit that referenced this issue Dec 10, 2024
When publishing, we currently ask the user to set `--publish-url` to the
upload URL and `--check-url` to the simple index URL, or the equivalent
configuration keys. But that's redundant with the `[[tool.uv.index]]`
declaration. Instead, we extend `[[tool.uv.index]]` with a `publish-url`
entry and allow passing `uv publish --index <name>`.

`uv publish --index <name>` requires the `pyproject.toml` to be present
when publishing, unlike using `--publish-url ... --check-url ...` which
can be used e.g. in CI without a checkout step. `--index` also always
uses the check URL feature to aid upload consistency.

The documentation tries to explain both approaches together, which
overlap for the check URL feature.

Fixes #8864

---------

Co-authored-by: Zanie Blue <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement to existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant