Skip to content

Commit 1cd3bcd

Browse files
authored
ci: resolve intermittent setup failure caused by venv downgrade race (#2620)
1 parent 4b38aa0 commit 1cd3bcd

10 files changed

Lines changed: 523 additions & 547 deletions

File tree

.github/actions/setup/action.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ runs:
2222
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
2323
with:
2424
path: |
25-
~/.cache/pypoetry
26-
~/.poetry
27-
!~/.cache/pypoetry/artifacts
28-
!~/.cache/pypoetry/repositories
25+
~/.cache/pypoetry/cache
2926
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}-${{ inputs.python_version }}-${{ inputs.extras }}
3027

3128
- name: Install dependencies

.github/workflows/conventional-pr-title.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,3 @@ jobs:
1212
- uses: amannn/action-semantic-pull-request@e32d7e603df1aa1ba07e981f2a23455dee596825 # v5
1313
env:
1414
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15-
with:
16-
types: |
17-
feat
18-
fix
19-
chore
20-
docs
21-
style
22-
refactor
23-
perf
24-
test

cognite/client/_api/datapoint_tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def _parse(
170170
# We merge 'defaults' and the given user query; the query takes precedence:
171171
if isinstance(query, exp_type):
172172
id_dct = {arg_name: query}
173-
query = DatapointsQuery(**self.top_level_defaults, **id_dct) # type: ignore [misc, arg-type]
173+
query = DatapointsQuery(**self.top_level_defaults, **id_dct) # type: ignore [arg-type]
174174

175175
elif isinstance(query, DatapointsQuery):
176176
if query.identifier.name() != arg_name:

cognite/client/config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import pprint
55
import re
66
import warnings
7-
from typing import Any, NoReturn, overload
7+
from typing import Any, ClassVar, NoReturn, overload
88

99
from cognite.client._version import __api_subversion__
1010
from cognite.client.credentials import CredentialProvider
@@ -48,6 +48,8 @@ class GlobalConfig:
4848
features. Defaults to False.
4949
"""
5050

51+
_instance: ClassVar[GlobalConfig]
52+
5153
def __new__(cls) -> GlobalConfig:
5254
if hasattr(cls, "_instance"):
5355
raise TypeError(

cognite/client/data_classes/capabilities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def from_tuple(cls, tpl: CapabilityTuple) -> Self:
170170
elif tpl.scope_extra is None:
171171
scope = scope_cls([tpl.scope_id]) # type: ignore [call-arg]
172172
elif scope_cls is TableScope:
173-
scope = scope_cls({tpl.database: [tpl.table] if tpl.table else []}) # type: ignore [call-arg]
173+
scope = scope_cls({tpl.database: [tpl.table] if tpl.table else []})
174174
else:
175175
raise ValueError(f"CapabilityTuple not understood: {tpl}")
176176

cognite/client/data_classes/data_modeling/data_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def load(cls, data: dict[str, str] | tuple[str, str] | DirectRelationReference |
3535
return cls(space, xid)
3636
case (space, xid):
3737
return cls(space, xid)
38-
case cls() | NodeId(): # type: ignore [misc]
38+
case cls() | NodeId():
3939
return cls(data.space, data.external_id)
4040
case _:
4141
raise ValueError("Invalid data provided to load method. Must be dict or tuple with two elements.")

cognite/client/utils/_json_extended.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def dumps(
6262

6363
def convert_to_float(value: float | str | None) -> float | None:
6464
if value.__class__ is str: # like this abomination; faster than float(value)
65-
return _FLOAT_API_MAPPING[value] # type: ignore [index]
65+
return _FLOAT_API_MAPPING[value]
6666
return value # type: ignore [return-value]
6767

6868

poetry.lock

Lines changed: 506 additions & 519 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ ipykernel = "^7.2.0"
9999
[tool.poetry.group.docs.dependencies]
100100
sphinx = ">=8.1"
101101
sphinx-rtd-theme = ">=1"
102-
sphinx-copybutton = "^0.5.2"
102+
sphinx-copybutton = "^0.5.2"
103103
sphinx-autosummary-accessors = "^2025.3.1"
104104

105105
[build-system]

tests/tests_integration/test_api/test_datapoints.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2377,9 +2377,9 @@ def test_multiple_settings_for_ignore_unknown_ids(
23772377
assert len(res_lst) == 3
23782378
assert res_lst.get(external_id=random_xids[0]) is None
23792379
dps_xid = res_lst.get(external_id=ts_str.external_id)
2380-
assert isinstance(dps_xid, exp_res_lst_type._RESOURCE) # type: ignore[attr-defined]
2380+
assert isinstance(dps_xid, exp_res_lst_type._RESOURCE)
23812381
dps_id = res_lst.get(id=ts_num.id)
2382-
assert isinstance(dps_id, exp_res_lst_type._RESOURCE) # type: ignore[attr-defined]
2382+
assert isinstance(dps_id, exp_res_lst_type._RESOURCE)
23832383

23842384
def test_query_with_duplicates(
23852385
self,
@@ -2404,17 +2404,17 @@ def test_query_with_duplicates(
24042404
)
24052405
assert isinstance(res_lst, exp_res_lst_type)
24062406
# Check non-duplicated in result:
2407-
assert isinstance(res_lst.get(id=ms_bursty_ts.id), exp_res_lst_type._RESOURCE) # type: ignore[attr-defined]
2408-
assert isinstance(res_lst.get(external_id=ms_bursty_ts.external_id), exp_res_lst_type._RESOURCE) # type: ignore[attr-defined]
2407+
assert isinstance(res_lst.get(id=ms_bursty_ts.id), exp_res_lst_type._RESOURCE)
2408+
assert isinstance(res_lst.get(external_id=ms_bursty_ts.external_id), exp_res_lst_type._RESOURCE)
24092409
# Check duplicated in result:
24102410
assert isinstance(res_lst.get(id=ts_numeric.id), list)
24112411
assert isinstance(res_lst.get(id=ts_string.id), list)
24122412
assert isinstance(res_lst.get(external_id=ts_numeric.external_id), list)
24132413
assert isinstance(res_lst.get(external_id=ts_string.external_id), list)
2414-
assert len(res_lst.get(id=ts_numeric.id)) == 3 # type: ignore[arg-type]
2415-
assert len(res_lst.get(id=ts_string.id)) == 2 # type: ignore[arg-type]
2416-
assert len(res_lst.get(external_id=ts_numeric.external_id)) == 3 # type: ignore[arg-type]
2417-
assert len(res_lst.get(external_id=ts_string.external_id)) == 2 # type: ignore[arg-type]
2414+
assert len(res_lst.get(id=ts_numeric.id)) == 3
2415+
assert len(res_lst.get(id=ts_string.id)) == 2
2416+
assert len(res_lst.get(external_id=ts_numeric.external_id)) == 3
2417+
assert len(res_lst.get(external_id=ts_string.external_id)) == 2
24182418

24192419

24202420
class TestRetrieveDataFrameAPI:

0 commit comments

Comments
 (0)