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

Replace jvm-generate-lockfiles goal with generate-lockfiles #14176

Merged

Conversation

Eric-Arellano
Copy link
Contributor

We now have a consistent mechanism for tool lockfiles.

This means that Python and JVM lockfiles now share the same namespace:

❯ ./pants generate-lockfiles --resolve=fake
15:13:44.71 [ERROR] 1 Exception encountered:

UnrecognizedResolveNamesError: Unrecognized resolve name from the option `--generate-lockfiles-resolve`: fake

All valid resolve names: ['autoflake', 'avro-java', 'black', 'coverage-py', 'docformatter', 'dockerfile-parser', 'flake8', 'google-java-format', 'ipython', 'isort', 'junit', 'mypy', 'pytest', 'python-default', 'scalac-plugins', 'scalafmt', 'scalapb', 'scalatest', 'scrooge', 'setuptools', 'twine']

# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
Copy link
Contributor Author

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two commits are distinct.

artifact_inputs: FrozenOrderedSet[str]

@classmethod
def from_tool(cls, tool: JvmToolBase) -> JvmLockfileRequest:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that before we were erroring when using this method and the DEFAULT_LOCKFILE was used. That is now instead handled by generate_lockfiles.py.

Comment on lines +27 to +28
class JvmLockfileRequest(LockfileRequest):
artifact_inputs: FrozenOrderedSet[str]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LockfileRequest already has resolve_name and lockfile_dest. So this just augments it with additional info.

Note that this generic type will be used for user lockfiles, too. I haven't yet started merging those.

Comment on lines +44 to +47
@rule(desc="Generate JVM lockfile", level=LogLevel.DEBUG)
async def generate_jvm_lockfile(
request: JvmLockfileRequest,
) -> Lockfile:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as before, minus the types changing.

Comment on lines +59 to +62
@rule
async def load_jvm_lockfile(
request: JvmLockfileRequest,
) -> CoursierResolvedLockfile:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as before, only the types changed.

Copy link
Sponsor Member

@stuhood stuhood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a ton for doing this!

@Eric-Arellano Eric-Arellano merged commit 2e126e7 into pantsbuild:main Jan 15, 2022
@Eric-Arellano Eric-Arellano deleted the generate-lockfiles-jvm-tools branch January 15, 2022 00:05
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.

None yet

2 participants