Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pants.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7]
python-version: [3.8]
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
Expand Down
3 changes: 0 additions & 3 deletions 3rdparty/python/constraints.txt

This file was deleted.

49 changes: 49 additions & 0 deletions 3rdparty/python/default_lock.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This lockfile was autogenerated by Pants. To regenerate, run:
#
# ./pants generate-lockfiles --resolve=python-default
#
# --- BEGIN PANTS LOCKFILE METADATA: DO NOT EDIT OR REMOVE ---
# {
# "version": 2,
# "valid_for_interpreter_constraints": [
# "CPython<3.11,>=3.8"
# ],
# "generated_with_requirements": [
# "protobuf>=3.19.0",
# "thrift==0.15.0"
# ]
# }
# --- END PANTS LOCKFILE METADATA ---

protobuf==3.19.4; python_version >= "3.5" \
--hash=sha256:f51d5a9f137f7a2cec2d326a74b6e3fc79d635d69ffe1b036d39fc7d75430d37 \
--hash=sha256:09297b7972da685ce269ec52af761743714996b4381c085205914c41fcab59fb \
--hash=sha256:072fbc78d705d3edc7ccac58a62c4c8e0cec856987da7df8aca86e647be4e35c \
--hash=sha256:7bb03bc2873a2842e5ebb4801f5c7ff1bfbdf426f85d0172f7644fcda0671ae0 \
--hash=sha256:f358aa33e03b7a84e0d91270a4d4d8f5df6921abe99a377828839e8ed0c04e07 \
--hash=sha256:1c91ef4110fdd2c590effb5dca8fdbdcb3bf563eece99287019c4204f53d81a4 \
--hash=sha256:c438268eebb8cf039552897d78f402d734a404f1360592fef55297285f7f953f \
--hash=sha256:835a9c949dc193953c319603b2961c5c8f4327957fe23d914ca80d982665e8ee \
--hash=sha256:4276cdec4447bd5015453e41bdc0c0c1234eda08420b7c9a18b8d647add51e4b \
--hash=sha256:6cbc312be5e71869d9d5ea25147cdf652a6781cf4d906497ca7690b7b9b5df13 \
--hash=sha256:54a1473077f3b616779ce31f477351a45b4fef8c9fd7892d6d87e287a38df368 \
--hash=sha256:435bb78b37fc386f9275a7035fe4fb1364484e38980d0dd91bc834a02c5ec909 \
--hash=sha256:16f519de1313f1b7139ad70772e7db515b1420d208cb16c6d7858ea989fc64a9 \
--hash=sha256:cdc076c03381f5c1d9bb1abdcc5503d9ca8b53cf0a9d31a9f6754ec9e6c8af0f \
--hash=sha256:69da7d39e39942bd52848438462674c463e23963a1fdaa84d88df7fbd7e749b2 \
--hash=sha256:48ed3877fa43e22bcacc852ca76d4775741f9709dd9575881a373bd3e85e54b2 \
--hash=sha256:bd95d1dfb9c4f4563e6093a9aa19d9c186bf98fa54da5252531cc0d3a07977e7 \
--hash=sha256:b38057450a0c566cbd04890a40edf916db890f2818e8682221611d78dc32ae26 \
--hash=sha256:7ca7da9c339ca8890d66958f5462beabd611eca6c958691a8fe6eccbd1eb0c6e \
--hash=sha256:36cecbabbda242915529b8ff364f2263cd4de7c46bbe361418b5ed859677ba58 \
--hash=sha256:c1068287025f8ea025103e37d62ffd63fec8e9e636246b89c341aeda8a67c934 \
--hash=sha256:96bd766831596d6014ca88d86dc8fe0fb2e428c0b02432fd9db3943202bf8c5e \
--hash=sha256:84123274d982b9e248a143dadd1b9815049f4477dc783bf84efe6250eb4b836a \
--hash=sha256:3112b58aac3bac9c8be2b60a9daf6b558ca3f7681c130dcdd788ade7c9ffbdca \
--hash=sha256:8961c3a78ebfcd000920c9060a262f082f29838682b1f7201889300c1fbe0616 \
--hash=sha256:9df0c10adf3e83015ced42a9a7bd64e13d06c4cf45c340d2c63020ea04499d0a
six==1.16.0; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.3.0" \
--hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254 \
--hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926
thrift==0.15.0 \
--hash=sha256:87c8205a71cf8bbb111cb99b1f7495070fbc9cabb671669568854210da5b3e29
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
# example-codegen

An example repository to demonstrate codegen support in Pants.

Refer to these docs for more information:

* [Python Protobuf](https://www.pantsbuild.org/docs/protobuf-python
* [Python Thrift](https://www.pantsbuild.org/docs/protobuf-python

Run `./pants export-codegen ::` to see the generated files. This isn't necessary for Pants to
use the generated files, but can be useful when debugging or to generate files for IDEs.
14 changes: 5 additions & 9 deletions pants.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[GLOBAL]
pants_version = "2.10.0.dev2"
pants_version = "2.10.0.dev3"
backend_packages = [
"pants.backend.codegen.protobuf.python",
"pants.backend.experimental.codegen.thrift.apache.python",
Expand All @@ -16,15 +16,11 @@ enabled = true
repo_id = "205E301D-44A4-42FF-8495-C9D41871A431"

[python]
interpreter_constraints = ["CPython>=3.8,<3.10"]
interpreter_constraints = ["CPython>=3.8,<3.11"]
enable_resolves = true

[python-protobuf]
runtime_dependencies = [
"3rdparty/python#protobuf",
]
runtime_dependencies = ["3rdparty/python#protobuf"]

[python-thrift]
runtime_dependencies = [
"3rdparty/python#thrift",
]

runtime_dependencies = ["3rdparty/python#thrift"]
22 changes: 0 additions & 22 deletions pants_from_sources
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,7 @@ PANTS_SOURCE="${PANTS_SOURCE:-../pants}"
# you won't want pantsd running. You can override this by setting ENABLE_PANTSD=true.
ENABLE_PANTSD="${ENABLE_PANTSD:-false}"

backend_packages=(
)

pythonpath=(
)

plugins=(
)

function string_list() {
eval local -r list_variable="\${$1[@]}"

echo -n "["
for item in ${list_variable}; do
echo -n "\"${item}\","
done
echo -n "]"
}

export PANTS_VERSION="$(cat "${PANTS_SOURCE}/src/python/pants/VERSION")"
export PANTS_PLUGINS="$(string_list plugins)"
export PANTS_PYTHONPATH="+$(string_list pythonpath)"
export PANTS_BACKEND_PACKAGES="+$(string_list backend_packages)"
export PANTS_PANTSD="${ENABLE_PANTSD}"
export no_proxy="*"

Expand Down
2 changes: 1 addition & 1 deletion src/python/protobuf_examples/BUILD
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python_tests(dependencies=["src/protobuf/simple_example"])
python_tests()
2 changes: 1 addition & 1 deletion src/python/thrift_examples/BUILD
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python_tests(dependencies=["//src/thrift:thrift"])
python_tests(dependencies=["src/thrift:thrift"])