From b5b164c6c9cac1b1d6461ea40448ace037950e9f Mon Sep 17 00:00:00 2001 From: Tom Dyas Date: Wed, 30 Oct 2024 18:56:20 +0900 Subject: [PATCH 1/3] upgrade to Pants v2.23.0rc1 --- pants.toml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pants.toml b/pants.toml index 2c95ae7..6e821a5 100644 --- a/pants.toml +++ b/pants.toml @@ -2,7 +2,7 @@ # Licensed under the Apache License, Version 2.0 (see LICENSE). [GLOBAL] -pants_version = "2.21.0" +pants_version = "2.23.0rc1" backend_packages.add = [ "pants.backend.build_files.fmt.black", "pants.backend.python", @@ -25,7 +25,7 @@ root_patterns = ["/"] # The default interpreter constraints for code in this repo. Individual targets can override # this with the `interpreter_constraints` field. See # https://www.pantsbuild.org/docs/python-interpreter-compatibility. - +# # Modify this if you don't have Python 3.9 on your machine. # This can be a range, such as [">=3.8,<3.11"], but it's usually recommended to restrict # to a single minor version. @@ -44,7 +44,3 @@ resolves = { python-default = "python-default.lock"} # problematic system Pythons. See # https://www.pantsbuild.org/docs/python-interpreter-compatibility#changing-the-interpreter-search-path. search_path = ["", ""] - -[python-infer] -# 2.17 is transitioning to a new, faster parser for dependency inference: -use_rust_parser = true From cbd9daa48fec39ba280f405102499751d9042bdc Mon Sep 17 00:00:00 2001 From: Tom Dyas Date: Wed, 30 Oct 2024 18:58:46 +0900 Subject: [PATCH 2/3] update get-pants.sh binary --- get-pants.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/get-pants.sh b/get-pants.sh index 56ee4f2..cae178e 100755 --- a/get-pants.sh +++ b/get-pants.sh @@ -163,7 +163,7 @@ Once installed, if you want to update your "pants" launcher binary, use -h | --help: Print this help message. -d | --bin-dir: - The directory to install the scie-pants binary in, "~/bin" by default. + The directory to install the scie-pants binary in, "~/.local/bin" by default. -b | --base-name: The name to use for the scie-pants binary, "pants" by default. @@ -176,7 +176,7 @@ Once installed, if you want to update your "pants" launcher binary, use EOF } -bin_dir="${HOME}/bin" +bin_dir="${HOME}/.local/bin" base_name="pants" version="latest/download" while (($# > 0)); do From e45de10ecd66b9e18cba8f93ddaff00937fc61ad Mon Sep 17 00:00:00 2001 From: Tom Dyas Date: Wed, 30 Oct 2024 20:03:49 +0900 Subject: [PATCH 3/3] update commands in README.md to those that work --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 65507d7..d991362 100644 --- a/README.md +++ b/README.md @@ -139,10 +139,14 @@ pants test helloworld/translator/translator_test.py -- -k test_unknown_phrase # ## Create a PEX binary +The `package` goal requires specifying a target which can be packaged. In this case, the there is a `pex_binary` target with the name `pex_binary` in the `helloworld/BUILD` file. + ``` -pants package helloworld/main.py +pants package helloworld:pex_binary ``` +The pex file is output to `dist/helloworld/pex_binary.pex` and can be executed directly. + ## Run a binary directly ```