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

Deprecate [python].lockfile_generator #16418

Merged

Conversation

Eric-Arellano
Copy link
Contributor

Poetry lockfile generation via Pants has several issues, including:

Some of these are fixable, whether by the upcoming Poetry 1.2 or by us investing more time. However—given the project's limited resources—it is not beneficial enough to lean into Poetry lockfile generation. Poetry was always seen as a bridge technology while we developed Pex lockfiles, which now meet all of Pantsbuild's requirements.

Keeps manually generated lockfiles

Users can still manually generate requirements.txt-style lockfiles. This is an important escape hatch if Pex lockfiles don't work for someone, and it eases migration from e.g. Poetry projects still using poetry.lock.

We may want to revisit this decision and require Pex lockfiles in the future, but that is a later decision.

[ci skip-rust]

# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]
# 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]
removal_hint=softwrap(
f"""
Pants will soon only support generating lockfiles via the Pex format, given the several
limitations of Poetry listed in this option.
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

This might be read as insulting to Poetry. Maybe some softer phrasing such as "as Poetry is not a good a fit for Pants's needs."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, good point! PTAL

# 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]
{doc_url("python-third-party-dependencies#manually-generating-lockfiles")} for more
information.

While Pex generates locks in a proprietary JSON format, you can use the
Copy link
Member

@jsirois jsirois Aug 5, 2022

Choose a reason for hiding this comment

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

How is this relevant? The relevant bit is that Pants uses a proprietary header. If it didn't you could use pex ... to interact with the lock file directly. This is the same as if Pants used proprietary Poetry lockfiles, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking about @asherf's experience migrating from Poetry to Pex. His main issue was how to integrate w/ pip-audit, and he had no idea how to approach it. So I want to mention integrations like this.

I could add a sentence mentioning this?

Alternatively, you can temporarily remove Pants's comment header and run pex3 lock export path/to/lock_file.lock.

Copy link
Member

Choose a reason for hiding this comment

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

I have no string opinion on what you write, I just am fairly insistent its true / relevant and the bit you have was not.

@Eric-Arellano Eric-Arellano merged commit c9937bd into pantsbuild:main Aug 5, 2022
@Eric-Arellano Eric-Arellano deleted the deprecate-poetry-lockfile branch August 5, 2022 18:20
cczona pushed a commit to cczona/pants that referenced this pull request Sep 1, 2022
Poetry lockfile generation via Pants has several issues, including:

* transitive deps often have bad environment markers
* `[python-repos]` is not hooked up
* `[GLOBAL].ca_certs_path` is not hooked up
* VCS and local requirements don't work
* Poetry writes to a cache not controlled by Pants, due to their bug
* pantsbuild#15315
* pantsbuild#15171
* pantsbuild#14020

Some of these are fixable, whether by the upcoming Poetry 1.2 or by us investing more time. However—given the project's limited resources—it is not beneficial enough to lean into Poetry lockfile generation. Poetry was always seen as a bridge technology while we developed Pex lockfiles, which now meet all of Pantsbuild's requirements.

## Keeps manually generated lockfiles

Users can still manually generate requirements.txt-style lockfiles. This is an important escape hatch if Pex lockfiles don't work for someone, and it eases migration from e.g. Poetry projects still using poetry.lock.

We may want to revisit this decision and require Pex lockfiles in the future, but that is a later decision.

[ci skip-rust]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants