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

[Bug]: no such attribute 'stamp' in 'py_test' rule #161

Open
jl-applied opened this issue May 25, 2023 · 3 comments
Open

[Bug]: no such attribute 'stamp' in 'py_test' rule #161

jl-applied opened this issue May 25, 2023 · 3 comments
Assignees
Labels
bug Something isn't working discussion needed Discussion required to progress further

Comments

@jl-applied
Copy link

jl-applied commented May 25, 2023

What happened?

Support for py_test.stamp, https://bazel.build/reference/be/python#py_test.stamp

$ bazel test //examples/py:py_test 
ERROR: /home/jamison/code/rules_py/examples/py/BUILD.bazel:3:8: //examples/py:py_test: no such attribute 'stamp' in 'py_test' rule
ERROR: error loading package 'examples/py': Package 'examples/py' contains errors
INFO: Elapsed time: 0.095s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
FAILED: Build did NOT complete successfully (0 packages loaded)

Version

Development (host) and target OS/architectures:

Output of bazel --version:

bazel 5.4.0

Version of the Aspect rules, or other relevant rules from your
WORKSPACE or MODULE.bazel file:

local rules_py workspace, HEAD

How to reproduce

https://github.com/jl-applied/rules_py/tree/jamison/161,

bazel test //examples/py:py_test

Any other information?

No response

@jl-applied jl-applied added the bug Something isn't working label May 25, 2023
@github-actions github-actions bot added the untriaged Requires traige label May 25, 2023
@alexeagle
Copy link
Member

alexeagle commented Aug 29, 2023

Interesting, @jl-applied is there a use case for setting a stamp attribute on a test target? I think in theory we want to support the full py_* native rule API to make migrations easy, but this one feels more like a bug than a feature to me.

@alexeagle alexeagle added discussion needed Discussion required to progress further and removed untriaged Requires traige labels Aug 29, 2023
@jl-applied
Copy link
Author

We explicitly default to stamp = false in a macro for our py_* rules. I suspect with a small refactor + slight code duplication at worse, we could workaround this without needing this attribute on any of our py_tests.

This was the first snag I hit when trying to migrate and was enough to get the migration shelved, so figured I'd open a ticket. Disallowing stamp seems reasonable to me, though an explicit comment stating this is intentional would be nice.

@alexeagle
Copy link
Member

Our macro can have a stamp attribute, but we just error when you pass it so you get the documentation in the right spot.

@alexeagle alexeagle self-assigned this Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working discussion needed Discussion required to progress further
Projects
Status: No status
Development

No branches or pull requests

2 participants