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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ jobs:
run: |
pants package src/python/shoalsoft/pants_opentelemetry_plugin::
if [ ! -r dist/shoalsoft_pants_opentelemetry_plugin-*-py3-none-any.whl ]; then
echo "ERROR: No wheel found in dist." 1>&2
echo "ERROR: No wheel found in `dist`." 1>&2
exit 1
fi
for pants_version in 2.30 2.29 2.28 ; do
for pants_version in 2.30 2.29 2.28 2.27 ; do
if [ ! -r dist/shoalsoft-pants-opentelemetry-plugin-pants${pants_version}-*.pex ]; then
echo "ERROR: No PEX file found for Pants version ${pants_version}.x." 1>&2
echo "ERROR: No PEX file found for Pants version ${pants_version}.x found in `dist`." 1>&2
exit 1
fi
done
Expand Down
28 changes: 28 additions & 0 deletions 3rdparty/python/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
python_requirements(
name="pants-2.31",
source="pants-2.31.txt",
resolve="pants-2.31",
module_mapping={
"opentelemetry-proto": ["opentelemetry.proto"],
"pantsbuild.pants": ["pants"],
"pantsbuild.pants.testutil": ["pants.testutil"],
},
type_stubs_module_mapping={
"types-grpcio": ["grpc"],
},
)

python_requirements(
name="pants-2.30",
source="pants-2.30.txt",
Expand Down Expand Up @@ -40,6 +54,20 @@ python_requirements(
},
)

python_requirements(
name="pants-2.27",
source="pants-2.27.txt",
resolve="pants-2.27",
module_mapping={
"opentelemetry-proto": ["opentelemetry.proto"],
"pantsbuild.pants": ["pants"],
"pantsbuild.pants.testutil": ["pants.testutil"],
},
type_stubs_module_mapping={
"types-grpcio": ["grpc"],
},
)

python_requirements(
name="pytest",
source="pytest-requirements.txt",
Expand Down
1,656 changes: 1,656 additions & 0 deletions 3rdparty/python/pants-2.27.lock

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions 3rdparty/python/pants-2.27.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Pants dependencies
pantsbuild.pants==2.28.1
pantsbuild.pants.testutil==2.28.1

# OpenTelemetry dependencies
opentelemetry-api==1.34.1
opentelemetry-sdk==1.34.1
opentelemetry-exporter-otlp==1.34.1

# Test dependencies
pytest
toml==0.10.2
httpx==0.28.1
opentelemetry-proto==1.34.1
grpcio==1.73.1
types-grpcio==1.0.0.20250703
packaging # match version in Pants repository
1,533 changes: 1,533 additions & 0 deletions 3rdparty/python/pants-2.31.lock

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions 3rdparty/python/pants-2.31.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Pants dependencies
pantsbuild.pants==2.31.0.dev1
pantsbuild.pants.testutil==2.31.0.dev1

# OpenTelemetry dependencies
opentelemetry-api==1.34.1
opentelemetry-sdk==1.34.1
opentelemetry-exporter-otlp==1.34.1

# Test dependencies
pytest
toml==0.10.2
httpx==0.28.1
opentelemetry-proto==1.34.1
grpcio==1.73.1
types-grpcio==1.0.0.20250703
packaging # match version in Pants repository
6 changes: 4 additions & 2 deletions pants.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[GLOBAL]
pants_version = "2.30.0rc0"
pants_version = "2.31.0.dev1"
backend_packages.add = [
"pants.backend.build_files.fmt.black",
"pants.backend.plugin_development",
Expand All @@ -15,12 +15,14 @@ backend_packages.add = [
interpreter_constraints = ["==3.11.*"]
enable_resolves = true
pip_version = "latest"
default_resolve = "pants-2.30"
default_resolve = "pants-2.31"

[python.resolves]
"pants-2.31" = "3rdparty/python/pants-2.31.lock"
"pants-2.30" = "3rdparty/python/pants-2.30.lock"
"pants-2.29" = "3rdparty/python/pants-2.29.lock"
"pants-2.28" = "3rdparty/python/pants-2.28.lock"
"pants-2.27" = "3rdparty/python/pants-2.27.lock"
pytest = "3rdparty/python/pytest.lock"
mypy = "3rdparty/python/mypy.lock"

Expand Down
34 changes: 31 additions & 3 deletions src/python/shoalsoft/pants_opentelemetry_plugin/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@

PLUGIN_VERSION = "0.5.0"

PANTS_MAJOR_MINOR_VERSIONS = ["2.30", "2.29", "2.28"]
PANTS_MAJOR_MINOR_VERSIONS = ["2.31", "2.30", "2.29", "2.28", "2.27"]

python_sources(
sources=["*.py", "!*_test.py", "!*_integration_test.py"],
**parametrize(
"pants-2.31",
resolve="pants-2.31",
),
**parametrize(
"pants-2.30",
resolve="pants-2.30",
Expand All @@ -30,11 +34,19 @@ python_sources(
"pants-2.28",
resolve="pants-2.28",
),
**parametrize(
"pants-2.27",
resolve="pants-2.27",
),
)

python_tests(
name="tests",
sources=["*_test.py", "!*_integration_test.py"],
**parametrize(
"pants-2.31",
resolve="pants-2.31",
),
**parametrize(
"pants-2.30",
resolve="pants-2.30",
Expand All @@ -47,6 +59,10 @@ python_tests(
"pants-2.28",
resolve="pants-2.28",
),
**parametrize(
"pants-2.27",
resolve="pants-2.27",
),
)

python_tests(
Expand All @@ -68,6 +84,12 @@ pex_binary(
entry_point="pants",
execution_mode="venv",
layout="zipapp",
**parametrize(
"pants-2.31",
resolve="pants-2.31",
dependencies=["3rdparty/python:pants-2.31#pantsbuild.pants"],
output_path="pants-2.31.pex",
),
**parametrize(
"pants-2.30",
resolve="pants-2.30",
Expand All @@ -86,6 +108,12 @@ pex_binary(
dependencies=["3rdparty/python:pants-2.28#pantsbuild.pants"],
output_path="pants-2.28.pex",
),
**parametrize(
"pants-2.27",
resolve="pants-2.27",
dependencies=["3rdparty/python:pants-2.27#pantsbuild.pants"],
output_path="pants-2.27.pex",
),
)


Expand Down Expand Up @@ -147,10 +175,10 @@ python_distribution(
url="https://github.com/shoalsoft/shoalsoft-pants-opentelemetry-plugin",
),
dependencies=[
f"./register.py@parametrize=pants-2.29",
f"./register.py@parametrize=pants-2.30",
# Exclude Pants and its transitive dependencies since the Pants will supply those
# dependencies itself from its own venv. This should also allow the plugin to be used
# with any Pants version from Pants v2.25 and later.
f"!!3rdparty/python:pants-2.29#pantsbuild.pants",
f"!!3rdparty/python:pants-2.30#pantsbuild.pants",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def do_test_of_json_file_exporter(
)


@pytest.mark.parametrize("pants_major_minor", ["2.30", "2.29", "2.28"])
@pytest.mark.parametrize("pants_major_minor", ["2.31", "2.30", "2.29", "2.28", "2.27"])
def test_opentelemetry_integration(subtests, pants_major_minor: str) -> None:
# Find the Python interpreter compatible with this version of Pants.
py_version_for_pants_major_minor = (
Expand Down