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

feat(twine): support 'bzlmod' users out of the box #1572

Merged
merged 13 commits into from
Mar 27, 2024

Conversation

aignas
Copy link
Collaborator

@aignas aignas commented Nov 20, 2023

Implements a test that starts a [pypiserver] and checks
that the publishing with the new machinery still works.

Fixes #1369

@aignas
Copy link
Collaborator Author

aignas commented Nov 20, 2023

If this is something we may want to do, I could add a test checking that we can:

  1. Start a simple PyPI-like registry.
  2. Publish our runfiles package there.
  3. (optional) Download it from there.

@rickeylev
Copy link
Contributor

If this is something we may want to do

Yes, +1 on making it work out of the box. As a user, I don't really want to care about twine. I just want it to be easy to publish to pypi.

, I could add a test checking that we can:

  1. Start a simple PyPI-like registry.
  2. Publish our runfiles package there.
  3. (optional) Download it from there.

Is this something we could generalize? We have quite a few tests that rely on external packages having particular structures (e.g. circular deps, native deps, extra, etc). If we had a "local" pypi registry, we'd be able to more easily define and test the relevant scenarios.

tools/publish/BUILD.bazel Outdated Show resolved Hide resolved
python/packaging.bzl Outdated Show resolved Hide resolved
tools/publish/BUILD.bazel Show resolved Hide resolved
python/packaging.bzl Outdated Show resolved Hide resolved
@aignas aignas changed the title chore(twine): support 'bzlmod' users out of the box feat(twine): support 'bzlmod' users out of the box Mar 25, 2024
@aignas
Copy link
Collaborator Author

aignas commented Mar 25, 2024

Is this something we could generalize? We have quite a few tests that rely on external packages having particular structures (e.g. circular deps, native deps, extra, etc). If we had a "local" pypi registry, we'd be able to more easily define and test the relevant scenarios.

It depends on how we want the testing to be done. If we want manual tests, then starting a script to launch a server and then running a test script manually would be doable.

If we want to integrate with the rest of the tooling so that it is automatic, it may be harder, but these are some ideas:

  1. We could have an integration test with a custom runner for bazel-in-bazel tests where the runner is written in python and starts a pypiserver just before running the bazel commands.
  2. Local iterations could be facilitated with running the server manually.
  3. We could potentially create a build action that creates the correct layout with the correct wheels made with py_wheel rule.

I am not sure I am going to pursue this academic exercise, so if anyone finds this message and is interested, feel free :)

@aignas aignas marked this pull request as ready for review March 25, 2024 09:04
@aignas
Copy link
Collaborator Author

aignas commented Mar 25, 2024

Not sure what to do with the failing Windows tests. Any ideas?

@aignas aignas requested a review from rickeylev March 25, 2024 12:17
@rickeylev rickeylev added this pull request to the merge queue Mar 27, 2024
Merged via the queue into bazelbuild:main with commit e8039db Mar 27, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

py_wheel support in bzlmod
3 participants