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

Upgrade pantsbuild from 2.18 to 2.23.0.dev2 #6200

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from
Draft

Conversation

cognifloyd
Copy link
Member

@cognifloyd cognifloyd commented May 18, 2024

The commits step through updating from 2.18 to 2.19 to 2.20.

Interesting new features in 2.19

Pants can auto retry tests to deal with flaky tests in CI. I enabled that in pants.ci.toml so it retries a test up to 3x.

Interesting new features in 2.20

Pants can now experimentally use GHA as a remote cache.

Pants has a pex_binary target for generating targets that run a particular entry point or script. Pants 2.20 gained a pex_binary(executable=...) field which would allow us to wrap our st2-* python scripts in a pex at some point. This feature means that pex will embed the script contents instead of attempting to import from a file that is not a valid package name (The "-" character is not valid). For now, I just left a comment in a BUILD file about this.
Note: I asked for this feature some time ago. It was first added to pex 2.1.93, and then to pants. Now its available.

Interesting new features in 2.21

A new [export].py_hermetic_scripts feature allows us to use nosetest in the exported venv. This was added in:

This release also allows us to simplify our __defaults__ BUILD file config. Instead of specifying (python_test, python_tests), we can just use python_test because now applies to generated targets (python_tests generates python_test targets), not just the targets in BUILD files.

Interesting new features in 2.22

A new [export].py_generated_sources option. I don't think we really need this now, but it makes sense to make any generated sources available in the venv (for use by an IDE like VSCode).

The options system is moving to the rust-based pants engine instead of in python to speed up cli args parsing.

Interesting new features in 2.23

I want to update to 2.23 ASAP, even if that means using a dev prerelease, to take advantage of the python_test(entry_point_dependencies={...}) field, added to resolve issues enabling our runner tests in #6202:

pants-plugins lockfile diffs

From 2.18 to 2.19

Lockfile diff: lockfiles/pants-plugins.lock [pants-plugins]

==                    Upgraded dependencies                     ==

  pantsbuild-pants               2.18.3       -->   2.19.3rc1
  pantsbuild-pants-testutil      2.18.3       -->   2.19.3rc1
  pex                            2.1.137      -->   2.2.1
  pluggy                         1.4.0        -->   1.5.0
  psutil                         5.9.0        -->   5.9.8
  ujson                          5.9.0        -->   5.10.0

From 2.19 to 2.20

Lockfile diff: lockfiles/pants-plugins.lock [pants-plugins]

==                    Upgraded dependencies                     ==

  pantsbuild-pants               2.19.3rc1    -->   2.20.1
  pantsbuild-pants-testutil      2.19.3rc1    -->   2.20.1

From 2.20 to 2.21

Lockfile diff: lockfiles/pants-plugins.lock [pants-plugins]

==                    Upgraded dependencies                     ==

  ijson                          3.1.4        -->   3.2.3
  pantsbuild-pants               2.20.1       -->   2.21.0
  pantsbuild-pants-testutil      2.20.1       -->   2.21.0
  pex                            2.2.1        -->   2.3.1

From 2.21 to 2.22

Lockfile diff: lockfiles/pants-plugins.lock [pants-plugins]
                                                                  
==                    Upgraded dependencies                     ==

  pantsbuild-pants               2.21.0       -->   2.22.0rc0
  pantsbuild-pants-testutil      2.21.0       -->   2.22.0rc0

From 2.22 to 2.23

                                                                  
Lockfile diff: lockfiles/pants-plugins.lock [pants-plugins]
                                                                  
==                    Upgraded dependencies                     ==

  pantsbuild-pants               2.22.0rc0    -->   2.23.0.dev2
  pantsbuild-pants-testutil      2.22.0rc0    -->   2.23.0.dev2
  pex                            2.3.1        -->   2.3.3
  typing-extensions              4.3.0        -->   4.12.2

@cognifloyd cognifloyd added this to the pants milestone May 18, 2024
@cognifloyd cognifloyd requested a review from a team May 18, 2024 00:45
@cognifloyd cognifloyd self-assigned this May 18, 2024
@pull-request-size pull-request-size bot added the size/XL PR that changes 500-999 lines. Consider splitting work into several ones that easier to review. label May 18, 2024
Lockfile diff: lockfiles/pants-plugins.lock [pants-plugins]

==                    Upgraded dependencies                     ==

  pantsbuild-pants               2.18.3       -->   2.19.3rc1
  pantsbuild-pants-testutil      2.18.3       -->   2.19.3rc1
  pex                            2.1.137      -->   2.2.1
  pluggy                         1.4.0        -->   1.5.0
  psutil                         5.9.0        -->   5.9.8
  ujson                          5.9.0        -->   5.10.0
This is a new feature in pants 2.19
Lockfile diff: lockfiles/pants-plugins.lock [pants-plugins]

==                    Upgraded dependencies                     ==

  pantsbuild-pants               2.19.3rc1    -->   2.20.1
  pantsbuild-pants-testutil      2.19.3rc1    -->   2.20.1
This is a new feature in pants 2.20
@pull-request-size pull-request-size bot added size/L PR that changes 100-499 lines. Requires some effort to review. and removed size/XL PR that changes 500-999 lines. Consider splitting work into several ones that easier to review. labels May 22, 2024
Lockfile diff: lockfiles/pants-plugins.lock [pants-plugins]

==                    Upgraded dependencies                     ==

  ijson                          3.1.4        -->   3.2.3
  pantsbuild-pants               2.20.1       -->   2.21.0
  pantsbuild-pants-testutil      2.20.1       -->   2.21.0
  pex                            2.2.1        -->   2.3.1
With this change, nosetest will be usable in the exported venv
until we finish migrating from nosetest to pytest.

By default, pex modifies script shebangs to add '-sE'.
This breaks nosetest and anything that needs PYTHONPATH.
pants 2.21 makes it possible to set __defaults__ more simply because the
defaults now apply to generated targets (eg a python_test target
generated by a python_tests target), instead of just the targets
explicitly defined in BUILD files.
@cognifloyd cognifloyd changed the title Upgrade pantsbuild from 2.18 to 2.20 Upgrade pantsbuild from 2.18 to 2.21 Jun 25, 2024
Lockfile diff: lockfiles/pants-plugins.lock [pants-plugins]

==                    Upgraded dependencies                     ==

  pantsbuild-pants               2.21.0       -->   2.22.0rc0
  pantsbuild-pants-testutil      2.21.0       -->   2.22.0rc0
@cognifloyd cognifloyd changed the title Upgrade pantsbuild from 2.18 to 2.21 Upgrade pantsbuild from 2.18 to 2.22 Jun 25, 2024
@cognifloyd cognifloyd changed the title Upgrade pantsbuild from 2.18 to 2.22 Upgrade pantsbuild from 2.18 to 2.23.0.dev2\ Jun 25, 2024
@cognifloyd cognifloyd changed the title Upgrade pantsbuild from 2.18 to 2.23.0.dev2\ Upgrade pantsbuild from 2.18 to 2.23.0.dev2 Jun 25, 2024
Lockfile diff: lockfiles/pants-plugins.lock [pants-plugins]

==                    Upgraded dependencies                     ==

  pantsbuild-pants               2.22.0rc0    -->   2.23.0.dev2
  pantsbuild-pants-testutil      2.22.0rc0    -->   2.23.0.dev2
  pex                            2.3.1        -->   2.3.3
  typing-extensions              4.3.0        -->   4.12.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure: ci/cd pantsbuild size/L PR that changes 100-499 lines. Requires some effort to review. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant