Skip to content

Commit 00c57aa

Browse files
committed
fix: resolve lint/typing issues and add Windows CI coverage
Signed-off-by: MelvinjoseC <165891174+MelvinjoseC@users.noreply.github.com>
1 parent 35924a6 commit 00c57aa

3 files changed

Lines changed: 18 additions & 7 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,17 @@ jobs:
108108
run: tox
109109
env:
110110
TOXENV: pypy${{ env.PYTHON_VERSION }}
111+
112+
test_windows:
113+
runs-on: windows-latest
114+
steps:
115+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
116+
- name: Set up Python
117+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
118+
with:
119+
python-version: '3.12'
120+
- name: Install dependencies
121+
run: pip install tox "virtualenv<20.22.0"
122+
- name: Run tests
123+
run: python -m tox -e py3.12
124+

prometheus_client/values.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import os
22
from threading import Lock
3+
from typing import Callable, List
34
import warnings
45

56
from .mmap_dict import mmap_key, MmapedDict
67

7-
8-
_multi_process_cleanups = []
8+
_multi_process_cleanups: List[Callable[[], None]] = []
99

1010

1111
def close_all_multiprocess_files():

tests/test_parser.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import importlib.util
12
import math
23
import unittest
34

@@ -375,11 +376,7 @@ def collect(self):
375376
self.assertEqual(text.encode('utf-8'), generate_latest(registry, ALLOWUTF8))
376377

377378

378-
try:
379-
import pytest_benchmark
380-
HAS_BENCHMARK = True
381-
except ImportError:
382-
HAS_BENCHMARK = False
379+
HAS_BENCHMARK = importlib.util.find_spec("pytest_benchmark") is not None
383380

384381
if HAS_BENCHMARK:
385382
def test_benchmark_text_string_to_metric_families(benchmark):

0 commit comments

Comments
 (0)