Skip to content

Commit

Permalink
Merge branch 'main' into fix-issue-2485-instrumentation-scope-name-2
Browse files Browse the repository at this point in the history
  • Loading branch information
emdneto authored Oct 2, 2024
2 parents 386835f + 6c4aed8 commit 0ba8cb4
Show file tree
Hide file tree
Showing 35 changed files with 62 additions and 2 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/misc_0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,24 @@ jobs:
- name: Run tests
run: tox -e mypyinstalled

pyright:
name: pyright
runs-on: ubuntu-latest
steps:
- name: Checkout repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v4

- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install tox
run: pip install tox

- name: Run tests
run: tox -e pyright

docs:
name: docs
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

- Removed superfluous py.typed markers and added them where they were missing
([#4172](https://github.com/open-telemetry/opentelemetry-python/pull/4172))
- Include metric info in encoding exceptions
([#4154](https://github.com/open-telemetry/opentelemetry-python/pull/4154))
- sdk: Add support for log formatting
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file removed opentelemetry-api/py.typed
Empty file.
14 changes: 14 additions & 0 deletions opentelemetry-api/src/opentelemetry/util/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@

from typing import Mapping, Optional, Sequence, Tuple, Union

# This is the implementation of the "Any" type as specified by the specifications of OpenTelemetry data model for logs.
# For more details, refer to the OTel specification:
# https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#type-any
AnyValue = Union[
str,
bool,
int,
float,
bytes,
Sequence["AnyValue"],
Mapping[str, "AnyValue"],
None,
]

AttributeValue = Union[
str,
bool,
Expand Down
Empty file removed opentelemetry-proto/py.typed
Empty file.
Empty file removed opentelemetry-sdk/py.typed
Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
get_current_span,
)
from opentelemetry.trace.span import TraceFlags
from opentelemetry.util.types import Attributes
from opentelemetry.util.types import AnyValue, Attributes

_logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -180,7 +180,7 @@ def __init__(
trace_flags: Optional[TraceFlags] = None,
severity_text: Optional[str] = None,
severity_number: Optional[SeverityNumber] = None,
body: Optional[Any] = None,
body: Optional[AnyValue] = None,
resource: Optional[Resource] = None,
attributes: Optional[Attributes] = None,
limits: Optional[LogLimits] = _UnsetLogLimits,
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,12 @@ exclude = '''
[tool.pytest.ini_options]
addopts = "-rs -v"
log_cli = true

[tool.pyright]
typeCheckingMode = "off"
reportMissingTypeStubs = "error"
include = [
"opentelemetry-api/src",
"opentelemetry-sdk/src",
"opentelemetry-semantic-conventions/src",
]
1 change: 1 addition & 0 deletions pyright-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pyright==1.1.381
16 changes: 16 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ envlist =
spellcheck
tracecontext
mypy,mypyinstalled
pyright
docs
docker-tests-proto{3,4}
public-symbols-check
Expand Down Expand Up @@ -445,3 +446,18 @@ commands_pre =

commands =
sh -c "find {toxinidir} -name \*.sh | xargs shellcheck --severity=warning"

[testenv:pyright]
basepython: python3

allowlist_externals = pyright

commands_pre =
pip install -r {toxinidir}/pyright-requirements.txt \
-e {toxinidir}/opentelemetry-api \
-e {toxinidir}/opentelemetry-semantic-conventions \
-e {toxinidir}/opentelemetry-sdk

commands =
pyright --version
pyright

0 comments on commit 0ba8cb4

Please sign in to comment.