Skip to content

Commit 6ecb1cc

Browse files
authored
Merge branch 'main' into codeboten/fix-close-response
2 parents 9cfaf8c + 02598db commit 6ecb1cc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+745
-137
lines changed

Diff for: .github/workflows/lint_0.yml

+38-38
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ jobs:
2323
- name: Checkout repo @ SHA - ${{ github.sha }}
2424
uses: actions/checkout@v4
2525

26-
- name: Set up Python 3.12
26+
- name: Set up Python 3.13
2727
uses: actions/setup-python@v5
2828
with:
29-
python-version: "3.12"
29+
python-version: "3.13"
3030

3131
- name: Install tox
3232
run: pip install tox
@@ -41,10 +41,10 @@ jobs:
4141
- name: Checkout repo @ SHA - ${{ github.sha }}
4242
uses: actions/checkout@v4
4343

44-
- name: Set up Python 3.12
44+
- name: Set up Python 3.13
4545
uses: actions/setup-python@v5
4646
with:
47-
python-version: "3.12"
47+
python-version: "3.13"
4848

4949
- name: Install tox
5050
run: pip install tox
@@ -59,10 +59,10 @@ jobs:
5959
- name: Checkout repo @ SHA - ${{ github.sha }}
6060
uses: actions/checkout@v4
6161

62-
- name: Set up Python 3.12
62+
- name: Set up Python 3.13
6363
uses: actions/setup-python@v5
6464
with:
65-
python-version: "3.12"
65+
python-version: "3.13"
6666

6767
- name: Install tox
6868
run: pip install tox
@@ -77,10 +77,10 @@ jobs:
7777
- name: Checkout repo @ SHA - ${{ github.sha }}
7878
uses: actions/checkout@v4
7979

80-
- name: Set up Python 3.12
80+
- name: Set up Python 3.13
8181
uses: actions/setup-python@v5
8282
with:
83-
python-version: "3.12"
83+
python-version: "3.13"
8484

8585
- name: Install tox
8686
run: pip install tox
@@ -95,10 +95,10 @@ jobs:
9595
- name: Checkout repo @ SHA - ${{ github.sha }}
9696
uses: actions/checkout@v4
9797

98-
- name: Set up Python 3.12
98+
- name: Set up Python 3.13
9999
uses: actions/setup-python@v5
100100
with:
101-
python-version: "3.12"
101+
python-version: "3.13"
102102

103103
- name: Install tox
104104
run: pip install tox
@@ -113,10 +113,10 @@ jobs:
113113
- name: Checkout repo @ SHA - ${{ github.sha }}
114114
uses: actions/checkout@v4
115115

116-
- name: Set up Python 3.12
116+
- name: Set up Python 3.13
117117
uses: actions/setup-python@v5
118118
with:
119-
python-version: "3.12"
119+
python-version: "3.13"
120120

121121
- name: Install tox
122122
run: pip install tox
@@ -131,10 +131,10 @@ jobs:
131131
- name: Checkout repo @ SHA - ${{ github.sha }}
132132
uses: actions/checkout@v4
133133

134-
- name: Set up Python 3.12
134+
- name: Set up Python 3.13
135135
uses: actions/setup-python@v5
136136
with:
137-
python-version: "3.12"
137+
python-version: "3.13"
138138

139139
- name: Install tox
140140
run: pip install tox
@@ -149,10 +149,10 @@ jobs:
149149
- name: Checkout repo @ SHA - ${{ github.sha }}
150150
uses: actions/checkout@v4
151151

152-
- name: Set up Python 3.12
152+
- name: Set up Python 3.13
153153
uses: actions/setup-python@v5
154154
with:
155-
python-version: "3.12"
155+
python-version: "3.13"
156156

157157
- name: Install tox
158158
run: pip install tox
@@ -167,10 +167,10 @@ jobs:
167167
- name: Checkout repo @ SHA - ${{ github.sha }}
168168
uses: actions/checkout@v4
169169

170-
- name: Set up Python 3.12
170+
- name: Set up Python 3.13
171171
uses: actions/setup-python@v5
172172
with:
173-
python-version: "3.12"
173+
python-version: "3.13"
174174

175175
- name: Install tox
176176
run: pip install tox
@@ -185,10 +185,10 @@ jobs:
185185
- name: Checkout repo @ SHA - ${{ github.sha }}
186186
uses: actions/checkout@v4
187187

188-
- name: Set up Python 3.12
188+
- name: Set up Python 3.13
189189
uses: actions/setup-python@v5
190190
with:
191-
python-version: "3.12"
191+
python-version: "3.13"
192192

193193
- name: Install tox
194194
run: pip install tox
@@ -203,10 +203,10 @@ jobs:
203203
- name: Checkout repo @ SHA - ${{ github.sha }}
204204
uses: actions/checkout@v4
205205

206-
- name: Set up Python 3.12
206+
- name: Set up Python 3.13
207207
uses: actions/setup-python@v5
208208
with:
209-
python-version: "3.12"
209+
python-version: "3.13"
210210

211211
- name: Install tox
212212
run: pip install tox
@@ -221,10 +221,10 @@ jobs:
221221
- name: Checkout repo @ SHA - ${{ github.sha }}
222222
uses: actions/checkout@v4
223223

224-
- name: Set up Python 3.12
224+
- name: Set up Python 3.13
225225
uses: actions/setup-python@v5
226226
with:
227-
python-version: "3.12"
227+
python-version: "3.13"
228228

229229
- name: Install tox
230230
run: pip install tox
@@ -239,10 +239,10 @@ jobs:
239239
- name: Checkout repo @ SHA - ${{ github.sha }}
240240
uses: actions/checkout@v4
241241

242-
- name: Set up Python 3.12
242+
- name: Set up Python 3.13
243243
uses: actions/setup-python@v5
244244
with:
245-
python-version: "3.12"
245+
python-version: "3.13"
246246

247247
- name: Install tox
248248
run: pip install tox
@@ -257,10 +257,10 @@ jobs:
257257
- name: Checkout repo @ SHA - ${{ github.sha }}
258258
uses: actions/checkout@v4
259259

260-
- name: Set up Python 3.12
260+
- name: Set up Python 3.13
261261
uses: actions/setup-python@v5
262262
with:
263-
python-version: "3.12"
263+
python-version: "3.13"
264264

265265
- name: Install tox
266266
run: pip install tox
@@ -275,10 +275,10 @@ jobs:
275275
- name: Checkout repo @ SHA - ${{ github.sha }}
276276
uses: actions/checkout@v4
277277

278-
- name: Set up Python 3.12
278+
- name: Set up Python 3.13
279279
uses: actions/setup-python@v5
280280
with:
281-
python-version: "3.12"
281+
python-version: "3.13"
282282

283283
- name: Install tox
284284
run: pip install tox
@@ -293,10 +293,10 @@ jobs:
293293
- name: Checkout repo @ SHA - ${{ github.sha }}
294294
uses: actions/checkout@v4
295295

296-
- name: Set up Python 3.12
296+
- name: Set up Python 3.13
297297
uses: actions/setup-python@v5
298298
with:
299-
python-version: "3.12"
299+
python-version: "3.13"
300300

301301
- name: Install tox
302302
run: pip install tox
@@ -311,10 +311,10 @@ jobs:
311311
- name: Checkout repo @ SHA - ${{ github.sha }}
312312
uses: actions/checkout@v4
313313

314-
- name: Set up Python 3.12
314+
- name: Set up Python 3.13
315315
uses: actions/setup-python@v5
316316
with:
317-
python-version: "3.12"
317+
python-version: "3.13"
318318

319319
- name: Install tox
320320
run: pip install tox
@@ -329,10 +329,10 @@ jobs:
329329
- name: Checkout repo @ SHA - ${{ github.sha }}
330330
uses: actions/checkout@v4
331331

332-
- name: Set up Python 3.12
332+
- name: Set up Python 3.13
333333
uses: actions/setup-python@v5
334334
with:
335-
python-version: "3.12"
335+
python-version: "3.13"
336336

337337
- name: Install tox
338338
run: pip install tox
@@ -347,10 +347,10 @@ jobs:
347347
- name: Checkout repo @ SHA - ${{ github.sha }}
348348
uses: actions/checkout@v4
349349

350-
- name: Set up Python 3.12
350+
- name: Set up Python 3.13
351351
uses: actions/setup-python@v5
352352
with:
353-
python-version: "3.12"
353+
python-version: "3.13"
354354

355355
- name: Install tox
356356
run: pip install tox

Diff for: .github/workflows/misc_0.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ jobs:
8888
- name: Run tests
8989
run: tox -e mypyinstalled
9090

91-
pyright:
92-
name: pyright
91+
typecheck:
92+
name: typecheck
9393
runs-on: ubuntu-latest
9494
steps:
9595
- name: Checkout repo @ SHA - ${{ github.sha }}
@@ -104,7 +104,7 @@ jobs:
104104
run: pip install tox
105105

106106
- name: Run tests
107-
run: tox -e pyright
107+
run: tox -e typecheck
108108

109109
docs:
110110
name: docs

Diff for: .github/workflows/templates/lint.yml.j2

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ jobs:
2424
- name: Checkout repo @ SHA - ${% raw %}{{ github.sha }}{% endraw %}
2525
uses: actions/checkout@v4
2626

27-
- name: Set up Python 3.12
27+
- name: Set up Python 3.13
2828
uses: actions/setup-python@v5
2929
with:
30-
python-version: "3.12"
30+
python-version: "3.13"
3131

3232
- name: Install tox
3333
run: pip install tox

Diff for: .pylintrc

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ disable=missing-docstring,
6868
too-few-public-methods, # Might be good to re-enable this later.
6969
too-many-instance-attributes,
7070
too-many-arguments,
71+
too-many-positional-arguments,
7172
duplicate-code,
7273
ungrouped-imports, # Leave this up to isort
7374
wrong-import-order, # Leave this up to isort

Diff for: CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
- semantic-conventions: Bump to 1.31.0
11+
([#4471](https://github.com/open-telemetry/opentelemetry-python/pull/4471))
1012
- Add type annotations to context's attach & detach
1113
([#4346](https://github.com/open-telemetry/opentelemetry-python/pull/4346))
1214
- Fix OTLP encoders missing instrumentation scope schema url and attributes
@@ -32,6 +34,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3234
([#4406](https://github.com/open-telemetry/opentelemetry-python/pull/4406))
3335
- Fix env var error message for TraceLimits/SpanLimits
3436
([#4458](https://github.com/open-telemetry/opentelemetry-python/pull/4458))
37+
- pylint-ci updated python version to 3.13
38+
([#4450](https://github.com/open-telemetry/opentelemetry-python/pull/4450))
3539
- Fix intermittent `Connection aborted` error when using otlp/http exporters
3640
([#4477](https://github.com/open-telemetry/opentelemetry-python/pull/4477))
3741

Diff for: CONTRIBUTING.md

+4
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ You can run `tox` with the following arguments:
6060
- `tox -e lint-some-package` to run lint checks on `some-package`
6161
- `tox -e generate-workflows` to run creation of new CI workflows if tox environments have been updated
6262
- `tox -e ruff` to run ruff linter and formatter checks against the entire codebase
63+
- `tox -e typecheck` to run pyright against entire code base.
64+
- `tox -e public-symbols-check` to run public_symbols_checker.py.
65+
- `tox -e docker-tests-{otlpexporter,opencensus}` to run tests in both or either one location.
66+
- `tox -e tracecontext` to run integration tests for tracecontext.
6367
- `tox -e precommit` to run all `pre-commit` actions
6468

6569
`ruff check` and `ruff format` are executed when `tox -e ruff` is run. We strongly recommend you to configure [pre-commit](https://pre-commit.com/) locally to run `ruff` automatically before each commit by installing it as git hooks. You just need to [install pre-commit](https://pre-commit.com/#install) in your environment:

Diff for: dev-requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
pylint==3.2.1
1+
pylint==3.3.4
22
httpretty==1.1.4
3+
pyright==1.1.396
34
mypy==1.9.0
45
sphinx==7.1.2
56
sphinx-rtd-theme==2.0.0rc4

Diff for: mypy-requirements.txt

-1
This file was deleted.

Diff for: opentelemetry-api/src/opentelemetry/metrics/_internal/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ def create_gauge( # type: ignore # pylint: disable=no-self-use
447447
name: str,
448448
unit: str = "",
449449
description: str = "",
450-
) -> Gauge:
450+
) -> Gauge: # pyright: ignore[reportReturnType]
451451
"""Creates a ``Gauge`` instrument
452452
453453
Args:

Diff for: opentelemetry-api/src/opentelemetry/trace/__init__.py

-2
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,6 @@ def start_span(
469469
record_exception: bool = True,
470470
set_status_on_exception: bool = True,
471471
) -> "Span":
472-
# pylint: disable=unused-argument,no-self-use
473472
return INVALID_SPAN
474473

475474
@_agnosticcontextmanager
@@ -485,7 +484,6 @@ def start_as_current_span(
485484
set_status_on_exception: bool = True,
486485
end_on_exit: bool = True,
487486
) -> Iterator["Span"]:
488-
# pylint: disable=unused-argument,no-self-use
489487
yield INVALID_SPAN
490488

491489

Diff for: opentelemetry-api/src/opentelemetry/util/_decorator.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ def __enter__(self) -> R:
6262
except StopIteration:
6363
raise RuntimeError("generator didn't yield") from None
6464

65-
def __call__(self, func: V) -> V:
65+
def __call__(self, func: V) -> V: # pyright: ignore [reportIncompatibleMethodOverride]
6666
if asyncio.iscoroutinefunction(func):
6767

6868
@functools.wraps(func) # type: ignore
69-
async def async_wrapper(*args: Pargs, **kwargs: Pkwargs) -> R:
69+
async def async_wrapper(*args: Pargs, **kwargs: Pkwargs) -> R: # pyright: ignore [reportInvalidTypeVarUse]
7070
with self._recreate_cm(): # type: ignore
7171
return await func(*args, **kwargs) # type: ignore
7272

@@ -78,8 +78,8 @@ def _agnosticcontextmanager(
7878
func: "Callable[P, Iterator[R]]",
7979
) -> "Callable[P, _AgnosticContextManager[R]]":
8080
@functools.wraps(func)
81-
def helper(*args: Pargs, **kwargs: Pkwargs) -> _AgnosticContextManager[R]:
82-
return _AgnosticContextManager(func, args, kwargs)
81+
def helper(*args: Pargs, **kwargs: Pkwargs) -> _AgnosticContextManager[R]: # pyright: ignore [reportInvalidTypeVarUse]
82+
return _AgnosticContextManager(func, args, kwargs) # pyright: ignore [reportArgumentType]
8383

8484
# Ignoring the type to keep the original signature of the function
8585
return helper # type: ignore[return-value]

Diff for: opentelemetry-api/tests/trace/test_globals.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,10 @@ class TestUseSpanException(Exception):
155155
raise TestUseSpanException("test error")
156156

157157
self.assertEqual(
158-
test_span.recorded_status.status_code, StatusCode.ERROR
158+
test_span.recorded_status.status_code, # type: ignore[reportAttributeAccessIssue]
159+
StatusCode.ERROR,
159160
)
160161
self.assertEqual(
161-
test_span.recorded_status.description,
162+
test_span.recorded_status.description, # type: ignore[reportAttributeAccessIssue]
162163
"TestUseSpanException: test error",
163164
)

0 commit comments

Comments
 (0)