Skip to content

Commit 5f88b29

Browse files
committed
fix lint errors
1 parent 7b81997 commit 5f88b29

9 files changed

Lines changed: 336 additions & 18 deletions

File tree

.github/workflows/lint.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,25 @@ jobs:
271271
- name: Run tests
272272
run: tox -e lint-opentelemetry-exporter-otlp-combined
273273

274+
lint-opentelemetry-exporter-otlp-json-file:
275+
name: opentelemetry-exporter-otlp-json-file
276+
runs-on: ubuntu-latest
277+
timeout-minutes: 30
278+
steps:
279+
- name: Checkout repo @ SHA - ${{ github.sha }}
280+
uses: actions/checkout@v4
281+
282+
- name: Set up Python 3.14
283+
uses: actions/setup-python@v5
284+
with:
285+
python-version: "3.14"
286+
287+
- name: Install tox
288+
run: pip install tox-uv
289+
290+
- name: Run tests
291+
run: tox -e lint-opentelemetry-exporter-otlp-json-file
292+
274293
lint-opentelemetry-exporter-otlp-proto-grpc-latest:
275294
name: opentelemetry-exporter-otlp-proto-grpc-latest
276295
runs-on: ubuntu-latest

.github/workflows/test.yml

Lines changed: 280 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1870,6 +1870,139 @@ jobs:
18701870
- name: Run tests
18711871
run: tox -e py314-test-opentelemetry-exporter-otlp-combined -- -ra
18721872

1873+
py310-test-opentelemetry-exporter-otlp-json-file_ubuntu-latest:
1874+
name: opentelemetry-exporter-otlp-json-file 3.10 Ubuntu
1875+
runs-on: ubuntu-latest
1876+
timeout-minutes: 30
1877+
steps:
1878+
- name: Checkout repo @ SHA - ${{ github.sha }}
1879+
uses: actions/checkout@v4
1880+
1881+
- name: Set up Python 3.10
1882+
uses: actions/setup-python@v5
1883+
with:
1884+
python-version: "3.10"
1885+
1886+
- name: Install tox
1887+
run: pip install tox-uv
1888+
1889+
- name: Run tests
1890+
run: tox -e py310-test-opentelemetry-exporter-otlp-json-file -- -ra
1891+
1892+
py311-test-opentelemetry-exporter-otlp-json-file_ubuntu-latest:
1893+
name: opentelemetry-exporter-otlp-json-file 3.11 Ubuntu
1894+
runs-on: ubuntu-latest
1895+
timeout-minutes: 30
1896+
steps:
1897+
- name: Checkout repo @ SHA - ${{ github.sha }}
1898+
uses: actions/checkout@v4
1899+
1900+
- name: Set up Python 3.11
1901+
uses: actions/setup-python@v5
1902+
with:
1903+
python-version: "3.11"
1904+
1905+
- name: Install tox
1906+
run: pip install tox-uv
1907+
1908+
- name: Run tests
1909+
run: tox -e py311-test-opentelemetry-exporter-otlp-json-file -- -ra
1910+
1911+
py312-test-opentelemetry-exporter-otlp-json-file_ubuntu-latest:
1912+
name: opentelemetry-exporter-otlp-json-file 3.12 Ubuntu
1913+
runs-on: ubuntu-latest
1914+
timeout-minutes: 30
1915+
steps:
1916+
- name: Checkout repo @ SHA - ${{ github.sha }}
1917+
uses: actions/checkout@v4
1918+
1919+
- name: Set up Python 3.12
1920+
uses: actions/setup-python@v5
1921+
with:
1922+
python-version: "3.12"
1923+
1924+
- name: Install tox
1925+
run: pip install tox-uv
1926+
1927+
- name: Run tests
1928+
run: tox -e py312-test-opentelemetry-exporter-otlp-json-file -- -ra
1929+
1930+
py313-test-opentelemetry-exporter-otlp-json-file_ubuntu-latest:
1931+
name: opentelemetry-exporter-otlp-json-file 3.13 Ubuntu
1932+
runs-on: ubuntu-latest
1933+
timeout-minutes: 30
1934+
steps:
1935+
- name: Checkout repo @ SHA - ${{ github.sha }}
1936+
uses: actions/checkout@v4
1937+
1938+
- name: Set up Python 3.13
1939+
uses: actions/setup-python@v5
1940+
with:
1941+
python-version: "3.13"
1942+
1943+
- name: Install tox
1944+
run: pip install tox-uv
1945+
1946+
- name: Run tests
1947+
run: tox -e py313-test-opentelemetry-exporter-otlp-json-file -- -ra
1948+
1949+
py314-test-opentelemetry-exporter-otlp-json-file_ubuntu-latest:
1950+
name: opentelemetry-exporter-otlp-json-file 3.14 Ubuntu
1951+
runs-on: ubuntu-latest
1952+
timeout-minutes: 30
1953+
steps:
1954+
- name: Checkout repo @ SHA - ${{ github.sha }}
1955+
uses: actions/checkout@v4
1956+
1957+
- name: Set up Python 3.14
1958+
uses: actions/setup-python@v5
1959+
with:
1960+
python-version: "3.14"
1961+
1962+
- name: Install tox
1963+
run: pip install tox-uv
1964+
1965+
- name: Run tests
1966+
run: tox -e py314-test-opentelemetry-exporter-otlp-json-file -- -ra
1967+
1968+
py314t-test-opentelemetry-exporter-otlp-json-file_ubuntu-latest:
1969+
name: opentelemetry-exporter-otlp-json-file 3.14t Ubuntu
1970+
runs-on: ubuntu-latest
1971+
timeout-minutes: 30
1972+
steps:
1973+
- name: Checkout repo @ SHA - ${{ github.sha }}
1974+
uses: actions/checkout@v4
1975+
1976+
- name: Set up Python 3.14t
1977+
uses: actions/setup-python@v5
1978+
with:
1979+
python-version: "3.14t"
1980+
1981+
- name: Install tox
1982+
run: pip install tox-uv
1983+
1984+
- name: Run tests
1985+
run: tox -e py314t-test-opentelemetry-exporter-otlp-json-file -- -ra
1986+
1987+
pypy3-test-opentelemetry-exporter-otlp-json-file_ubuntu-latest:
1988+
name: opentelemetry-exporter-otlp-json-file pypy-3.10 Ubuntu
1989+
runs-on: ubuntu-latest
1990+
timeout-minutes: 30
1991+
steps:
1992+
- name: Checkout repo @ SHA - ${{ github.sha }}
1993+
uses: actions/checkout@v4
1994+
1995+
- name: Set up Python pypy-3.10
1996+
uses: actions/setup-python@v5
1997+
with:
1998+
python-version: "pypy-3.10"
1999+
2000+
- name: Install tox
2001+
run: pip install tox-uv
2002+
2003+
- name: Run tests
2004+
run: tox -e pypy3-test-opentelemetry-exporter-otlp-json-file -- -ra
2005+
18732006
py310-test-opentelemetry-exporter-otlp-proto-grpc-oldest_ubuntu-latest:
18742007
name: opentelemetry-exporter-otlp-proto-grpc-oldest 3.10 Ubuntu
18752008
runs-on: ubuntu-latest
@@ -5171,6 +5304,153 @@ jobs:
51715304
- name: Run tests
51725305
run: tox -e py314-test-opentelemetry-exporter-otlp-combined -- -ra
51735306

5307+
py310-test-opentelemetry-exporter-otlp-json-file_windows-latest:
5308+
name: opentelemetry-exporter-otlp-json-file 3.10 Windows
5309+
runs-on: windows-latest
5310+
timeout-minutes: 30
5311+
steps:
5312+
- name: Configure git to support long filenames
5313+
run: git config --system core.longpaths true
5314+
- name: Checkout repo @ SHA - ${{ github.sha }}
5315+
uses: actions/checkout@v4
5316+
5317+
- name: Set up Python 3.10
5318+
uses: actions/setup-python@v5
5319+
with:
5320+
python-version: "3.10"
5321+
5322+
- name: Install tox
5323+
run: pip install tox-uv
5324+
5325+
- name: Run tests
5326+
run: tox -e py310-test-opentelemetry-exporter-otlp-json-file -- -ra
5327+
5328+
py311-test-opentelemetry-exporter-otlp-json-file_windows-latest:
5329+
name: opentelemetry-exporter-otlp-json-file 3.11 Windows
5330+
runs-on: windows-latest
5331+
timeout-minutes: 30
5332+
steps:
5333+
- name: Configure git to support long filenames
5334+
run: git config --system core.longpaths true
5335+
- name: Checkout repo @ SHA - ${{ github.sha }}
5336+
uses: actions/checkout@v4
5337+
5338+
- name: Set up Python 3.11
5339+
uses: actions/setup-python@v5
5340+
with:
5341+
python-version: "3.11"
5342+
5343+
- name: Install tox
5344+
run: pip install tox-uv
5345+
5346+
- name: Run tests
5347+
run: tox -e py311-test-opentelemetry-exporter-otlp-json-file -- -ra
5348+
5349+
py312-test-opentelemetry-exporter-otlp-json-file_windows-latest:
5350+
name: opentelemetry-exporter-otlp-json-file 3.12 Windows
5351+
runs-on: windows-latest
5352+
timeout-minutes: 30
5353+
steps:
5354+
- name: Configure git to support long filenames
5355+
run: git config --system core.longpaths true
5356+
- name: Checkout repo @ SHA - ${{ github.sha }}
5357+
uses: actions/checkout@v4
5358+
5359+
- name: Set up Python 3.12
5360+
uses: actions/setup-python@v5
5361+
with:
5362+
python-version: "3.12"
5363+
5364+
- name: Install tox
5365+
run: pip install tox-uv
5366+
5367+
- name: Run tests
5368+
run: tox -e py312-test-opentelemetry-exporter-otlp-json-file -- -ra
5369+
5370+
py313-test-opentelemetry-exporter-otlp-json-file_windows-latest:
5371+
name: opentelemetry-exporter-otlp-json-file 3.13 Windows
5372+
runs-on: windows-latest
5373+
timeout-minutes: 30
5374+
steps:
5375+
- name: Configure git to support long filenames
5376+
run: git config --system core.longpaths true
5377+
- name: Checkout repo @ SHA - ${{ github.sha }}
5378+
uses: actions/checkout@v4
5379+
5380+
- name: Set up Python 3.13
5381+
uses: actions/setup-python@v5
5382+
with:
5383+
python-version: "3.13"
5384+
5385+
- name: Install tox
5386+
run: pip install tox-uv
5387+
5388+
- name: Run tests
5389+
run: tox -e py313-test-opentelemetry-exporter-otlp-json-file -- -ra
5390+
5391+
py314-test-opentelemetry-exporter-otlp-json-file_windows-latest:
5392+
name: opentelemetry-exporter-otlp-json-file 3.14 Windows
5393+
runs-on: windows-latest
5394+
timeout-minutes: 30
5395+
steps:
5396+
- name: Configure git to support long filenames
5397+
run: git config --system core.longpaths true
5398+
- name: Checkout repo @ SHA - ${{ github.sha }}
5399+
uses: actions/checkout@v4
5400+
5401+
- name: Set up Python 3.14
5402+
uses: actions/setup-python@v5
5403+
with:
5404+
python-version: "3.14"
5405+
5406+
- name: Install tox
5407+
run: pip install tox-uv
5408+
5409+
- name: Run tests
5410+
run: tox -e py314-test-opentelemetry-exporter-otlp-json-file -- -ra
5411+
5412+
py314t-test-opentelemetry-exporter-otlp-json-file_windows-latest:
5413+
name: opentelemetry-exporter-otlp-json-file 3.14t Windows
5414+
runs-on: windows-latest
5415+
timeout-minutes: 30
5416+
steps:
5417+
- name: Configure git to support long filenames
5418+
run: git config --system core.longpaths true
5419+
- name: Checkout repo @ SHA - ${{ github.sha }}
5420+
uses: actions/checkout@v4
5421+
5422+
- name: Set up Python 3.14t
5423+
uses: actions/setup-python@v5
5424+
with:
5425+
python-version: "3.14t"
5426+
5427+
- name: Install tox
5428+
run: pip install tox-uv
5429+
5430+
- name: Run tests
5431+
run: tox -e py314t-test-opentelemetry-exporter-otlp-json-file -- -ra
5432+
5433+
pypy3-test-opentelemetry-exporter-otlp-json-file_windows-latest:
5434+
name: opentelemetry-exporter-otlp-json-file pypy-3.10 Windows
5435+
runs-on: windows-latest
5436+
timeout-minutes: 30
5437+
steps:
5438+
- name: Configure git to support long filenames
5439+
run: git config --system core.longpaths true
5440+
- name: Checkout repo @ SHA - ${{ github.sha }}
5441+
uses: actions/checkout@v4
5442+
5443+
- name: Set up Python pypy-3.10
5444+
uses: actions/setup-python@v5
5445+
with:
5446+
python-version: "pypy-3.10"
5447+
5448+
- name: Install tox
5449+
run: pip install tox-uv
5450+
5451+
- name: Run tests
5452+
run: tox -e pypy3-test-opentelemetry-exporter-otlp-json-file -- -ra
5453+
51745454
py310-test-opentelemetry-exporter-otlp-proto-grpc-oldest_windows-latest:
51755455
name: opentelemetry-exporter-otlp-proto-grpc-oldest 3.10 Windows
51765456
runs-on: windows-latest

eachdist.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ packages=
3535
opentelemetry-exporter-opencensus
3636
opentelemetry-exporter-prometheus
3737
opentelemetry-exporter-otlp-json-common
38+
opentelemetry-exporter-otlp-json-file
3839
opentelemetry-distro
3940
opentelemetry-proto-json
4041
opentelemetry-semantic-conventions

exporter/opentelemetry-exporter-otlp-json-file/src/opentelemetry/exporter/otlp/json/file/_log_exporter.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ def __init__(
5757
if path is not None and stream is not None:
5858
raise ValueError("Cannot specify both 'path' and 'stream'")
5959
if path is not None:
60-
self._stream: IO[str] = open(path, "a")
60+
self._stream: IO[str] = open( # pylint: disable=consider-using-with
61+
path, "a", encoding="utf-8"
62+
)
6163
self._owns_stream = True
6264
elif stream is not None:
6365
self._stream = stream

exporter/opentelemetry-exporter-otlp-json-file/src/opentelemetry/exporter/otlp/json/file/metric_exporter.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ def __init__(
7777
preferred_aggregation=_get_aggregation(preferred_aggregation),
7878
)
7979
if path is not None:
80-
self._stream: IO[str] = open(path, "a")
80+
self._stream: IO[str] = open( # pylint: disable=consider-using-with
81+
path, "a", encoding="utf-8"
82+
)
8183
self._owns_stream = True
8284
elif stream is not None:
8385
self._stream = stream

exporter/opentelemetry-exporter-otlp-json-file/src/opentelemetry/exporter/otlp/json/file/trace_exporter.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ def __init__(
5151
if path is not None and stream is not None:
5252
raise ValueError("Cannot specify both 'path' and 'stream'")
5353
if path is not None:
54-
self._stream: IO[str] = open(path, "a")
54+
self._stream: IO[str] = open( # pylint: disable=consider-using-with
55+
path, "a", encoding="utf-8"
56+
)
5557
self._owns_stream = True
5658
elif stream is not None:
5759
self._stream = stream

0 commit comments

Comments
 (0)