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

Set a default for [jvm].resolves and [jvm].default_resolve (cherrypick of #13925) #13930

Merged
merged 1 commit into from
Dec 20, 2021

Conversation

stuhood
Copy link
Member

@stuhood stuhood commented Dec 20, 2021

Part of #12742.

We set a default because it's important to the Pants project that onboarding is as effortless as possible, e.g. via sensible defaults.

An additional benefit is that we can now be confident a resolve is set up, as it is impossible to override an option to be None (#11719). We decided that we want to require lockfiles when using Pants, so this is seen as a benefit.

--

This uses the resolve name jvm-default because the namespace will be shared with Python, e.g. py-default.

It uses the lockfile path 3rdparty/jvm/default.lock. We use the file extension .lock instead of .json to better express the semantics, including that you should not hand-edit the file. Using the 3rdparty/jvm folder is a sensible default for monorepos, and people can override it to where they want.

[ci skip-rust]
[ci skip-build-wheels]

…build#13925)

Part of pantsbuild#12742.

We set a default because it's important to the Pants project that onboarding is as effortless as possible, e.g. via sensible defaults.

An additional benefit is that we can now be confident a resolve is set up, as it is impossible to override an option to be `None` (pantsbuild#11719). We decided that we want to require lockfiles when using Pants, so this is seen as a benefit.

--

This uses the resolve name `jvm-default` because the namespace will be shared with Python, e.g. `py-default`. 

It uses the lockfile path `3rdparty/jvm/default.lock`. We use the file extension `.lock` instead of `.json` to better express the semantics, including that you should not hand-edit the file. Using the `3rdparty/jvm` folder is a sensible default for monorepos, and people can override it to where they want.

[ci skip-rust]
[ci skip-build-wheels]
Copy link
Contributor

@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.

Thanks

@stuhood stuhood merged commit 467fd00 into pantsbuild:2.9.x Dec 20, 2021
@stuhood stuhood deleted the stuhood/pick-13925-for-2.9.x branch December 20, 2021 22:27
Eric-Arellano added a commit that referenced this pull request Mar 16, 2022
…file.txt` to `3rdparty/python/default.lock` (#14815)

## Problem

In Pants 2.11, we add support for Pex lockfiles. While it is not illegal to call a Pex lockfile `default_lockfile.txt`, using `.txt` is a misnomer: it's actually a JSONC file. But we also decided in #13930 that we want to call lockfiles `.lock` to emphasize you should not hand-edit them.

## Solution

Use the same naming scheme from #13930 that JVM uses: `3rdparty/python/default.lock`.

When changing from Poetry to Pex lockfiles, no need to rename the file.

### Alternative name

I personally like `3rdparty/python/user_requirements.lock` more than the `default.lock`. But we already have a convention from JVM and we should not break those users. So the consistency seemed valuable here.

There's probably wisdom in using `default.lock`: it works better if you add a second lockfile but keep the normal `python-default`.

[ci skip-rust]
[ci skip-build-wheels]
Eric-Arellano added a commit to Eric-Arellano/pants that referenced this pull request Mar 16, 2022
…file.txt` to `3rdparty/python/default.lock` (Cherry-pick of pantsbuild#14815)

## Problem

In Pants 2.11, we add support for Pex lockfiles. While it is not illegal to call a Pex lockfile `default_lockfile.txt`, using `.txt` is a misnomer: it's actually a JSONC file. But we also decided in pantsbuild#13930 that we want to call lockfiles `.lock` to emphasize you should not hand-edit them.

## Solution

Use the same naming scheme from pantsbuild#13930 that JVM uses: `3rdparty/python/default.lock`.

When changing from Poetry to Pex lockfiles, no need to rename the file.

### Alternative name

I personally like `3rdparty/python/user_requirements.lock` more than the `default.lock`. But we already have a convention from JVM and we should not break those users. So the consistency seemed valuable here.

There's probably wisdom in using `default.lock`: it works better if you add a second lockfile but keep the normal `python-default`.

[ci skip-rust]
[ci skip-build-wheels]
Eric-Arellano added a commit that referenced this pull request Mar 17, 2022
…file.txt` to `3rdparty/python/default.lock` (Cherry-pick of #14815) (#14818)

## Problem

In Pants 2.11, we add support for Pex lockfiles. While it is not illegal to call a Pex lockfile `default_lockfile.txt`, using `.txt` is a misnomer: it's actually a JSONC file. But we also decided in #13930 that we want to call lockfiles `.lock` to emphasize you should not hand-edit them.

## Solution

Use the same naming scheme from #13930 that JVM uses: `3rdparty/python/default.lock`.

When changing from Poetry to Pex lockfiles, no need to rename the file.

### Alternative name

I personally like `3rdparty/python/user_requirements.lock` more than the `default.lock`. But we already have a convention from JVM and we should not break those users. So the consistency seemed valuable here.

There's probably wisdom in using `default.lock`: it works better if you add a second lockfile but keep the normal `python-default`.

[ci skip-rust]
[ci skip-build-wheels]
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.

2 participants