clear-skies-cortex 2.0.2__tar.gz → 2.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/.copier-answers.yml +1 -1
  2. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/.github/workflows/create-version.yaml +1 -1
  3. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/.github/workflows/run-tests.yml +2 -1
  4. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/.github/workflows/tests-matrix.yaml +6 -19
  5. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/.pre-commit-config.yaml +1 -7
  6. clear_skies_cortex-2.0.3/.vscode/settings.json +21 -0
  7. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/CHANGELOG.md +8 -0
  8. clear_skies_cortex-2.0.3/LATEST_CHANGELOG.md +6 -0
  9. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/PKG-INFO +2 -2
  10. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/pyproject.toml +2 -16
  11. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/src/clearskies_cortex/backends/cortex_backend.py +4 -3
  12. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/src/clearskies_cortex/backends/cortex_team_relationship_backend.py +20 -13
  13. clear_skies_cortex-2.0.3/uv.lock +983 -0
  14. clear_skies_cortex-2.0.2/LATEST_CHANGELOG.md +0 -11
  15. clear_skies_cortex-2.0.2/uv.lock +0 -1024
  16. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/.editorconfig +0 -0
  17. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/.github/workflows/docs.yaml +0 -0
  18. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/.github/workflows/tests.yaml +0 -0
  19. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/.gitignore +0 -0
  20. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/.python-version +0 -0
  21. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/LICENSE +0 -0
  22. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/README.md +0 -0
  23. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/cliff.toml +0 -0
  24. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/ruff.toml +0 -0
  25. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/src/clearskies_cortex/__init__.py +0 -0
  26. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/src/clearskies_cortex/backends/__init__.py +0 -0
  27. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/src/clearskies_cortex/columns/__init__.py +0 -0
  28. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/src/clearskies_cortex/columns/string_list.py +0 -0
  29. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/src/clearskies_cortex/dataclasses.py +0 -0
  30. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/src/clearskies_cortex/defaults/__init__.py +0 -0
  31. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/src/clearskies_cortex/defaults/default_cortex_auth.py +0 -0
  32. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/src/clearskies_cortex/defaults/default_cortex_url.py +0 -0
  33. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/src/clearskies_cortex/models/__init__.py +0 -0
  34. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/src/clearskies_cortex/models/cortex_catalog_entity.py +0 -0
  35. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/src/clearskies_cortex/models/cortex_catalog_entity_domain.py +0 -0
  36. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/src/clearskies_cortex/models/cortex_catalog_entity_group.py +0 -0
  37. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/src/clearskies_cortex/models/cortex_catalog_entity_scorecard.py +0 -0
  38. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/src/clearskies_cortex/models/cortex_catalog_entity_service.py +0 -0
  39. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/src/clearskies_cortex/models/cortex_catalog_entity_team.py +0 -0
  40. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/src/clearskies_cortex/models/cortex_catalog_entity_types.py +0 -0
  41. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/src/clearskies_cortex/models/cortex_entity_relationships.py +0 -0
  42. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/src/clearskies_cortex/models/cortex_model.py +0 -0
  43. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/src/clearskies_cortex/models/cortex_scorecard.py +0 -0
  44. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/src/clearskies_cortex/models/cortex_team.py +0 -0
  45. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/src/clearskies_cortex/models/cortex_team_category_tree.py +0 -0
  46. {clear_skies_cortex-2.0.2 → clear_skies_cortex-2.0.3}/src/clearskies_cortex/models/cortex_team_department.py +0 -0
@@ -1,5 +1,5 @@
1
1
  # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2
- _commit: v0.0.35
2
+ _commit: v0.0.45
3
3
  _src_path: gh:clearskies-py/clearskies-module-template
4
4
  author_email: tom.nijboer@cimpress.com
5
5
  author_name: Tom Nijboer
@@ -79,7 +79,7 @@ jobs:
79
79
  # STEP 2: Commit all file changes together
80
80
  - name: Commit All Changes
81
81
  run: |
82
- git add pyproject.toml CHANGELOG.md
82
+ git add pyproject.toml CHANGELOG.md uv.lock
83
83
  git commit -m "chore(release): bump version to ${{ steps.bump.outputs.tag }}"
84
84
 
85
85
  # STEP 3: Create the tag for the final commit
@@ -67,7 +67,7 @@ jobs:
67
67
  python-version: ${{ matrix.python-version }}
68
68
  run-mypy: ${{ needs.changes.outputs.tests == 'true' }}
69
69
  run-pytest: ${{ needs.changes.outputs.tests == 'true' }}
70
- run-black: ${{ needs.changes.outputs.tests == 'true' }}
70
+ run-ruff-format: ${{ needs.changes.outputs.tests == 'true' }}
71
71
  run-ruff-check: ${{ needs.changes.outputs.tests == 'true' }}
72
72
  secrets: inherit
73
73
  strategy:
@@ -76,6 +76,7 @@ jobs:
76
76
  - '3.11'
77
77
  - '3.12'
78
78
  - '3.13'
79
+ - '3.14'
79
80
  fail-fast: false
80
81
 
81
82
  status:
@@ -14,7 +14,7 @@ on:
14
14
  run-pytest:
15
15
  required: true
16
16
  type: boolean
17
- run-black:
17
+ run-ruff-format:
18
18
  required: true
19
19
  type: boolean
20
20
  run-ruff-check:
@@ -66,27 +66,14 @@ jobs:
66
66
  - run: uv run pytest -v
67
67
  - run: git diff --exit-code --stat HEAD
68
68
 
69
- black:
70
- name: black
69
+ ruff-format:
70
+ name: ruff-format
71
71
  runs-on: ${{ inputs.runner }}
72
- if: inputs.run-black
72
+ if: inputs.run-ruff-format
73
73
  steps:
74
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
75
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
76
- with:
77
- persist-credentials: false
78
-
79
- - name: Install uv and set the python version
80
- uses: astral-sh/setup-uv@v6
81
- with:
82
- python-version: ${{ inputs.python-version }}
83
- enable-cache: true
84
- - name: Install dependencies
85
- run: uv sync --locked --all-extras --dev
86
- - uses: psf/black@stable
74
+ - uses: astral-sh/ruff-action@v3
87
75
  with:
88
- options: "--check --verbose"
89
- src: "./src"
76
+ args: "format --diff"
90
77
 
91
78
  ruff-check:
92
79
  name: ruff-check
@@ -38,12 +38,6 @@ repos:
38
38
  hooks:
39
39
  - id: uv-lock
40
40
 
41
- - repo: https://github.com/psf/black
42
- rev: 25.1.0
43
- hooks:
44
- - id: black
45
- files: \.py$
46
-
47
41
  - repo: https://github.com/astral-sh/ruff-pre-commit
48
42
  rev: v0.12.1
49
43
  hooks:
@@ -55,7 +49,7 @@ repos:
55
49
  rev: v1.16.1
56
50
  hooks:
57
51
  - id: mypy
58
- additional_dependencies: [types-requests, clear-skies]
52
+ additional_dependencies: [types-requests]
59
53
  files: \.py$
60
54
 
61
55
  - repo: https://github.com/adrienverge/yamllint
@@ -0,0 +1,21 @@
1
+ {
2
+ "python.testing.pytestArgs": ["tests"],
3
+ "python.testing.unittestEnabled": false,
4
+ "python.testing.pytestEnabled": true,
5
+ "python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
6
+ "ruff.interpreter": ["${workspaceFolder}/.venv/bin/python"],
7
+ "ruff.path": ["${workspaceFolder}/.venv/bin/ruff"],
8
+ "ruff.configuration": "${workspaceFolder}/ruff.toml",
9
+ "ruff.nativeServer": "on",
10
+ "[python]": {
11
+ "editor.formatOnSave": true,
12
+ "editor.codeActionsOnSave": {
13
+ "source.fixAll": "explicit",
14
+ "source.organizeImports": "explicit"
15
+ },
16
+ "editor.defaultFormatter": "charliermarsh.ruff"
17
+ },
18
+ "mypy-type-checker.args": [
19
+ "--config-file=${workspaceFolder}/pyproject.toml"
20
+ ]
21
+ }
@@ -5,12 +5,19 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.0.3] - 2026-01-27
9
+
10
+ ### Changed
11
+ - Udpate to QueryResult
12
+ - Update to latest copier version
13
+
8
14
  ## [2.0.2] - 2026-01-06
9
15
 
10
16
  ### Added
11
17
  - Add teams
12
18
 
13
19
  ### Changed
20
+ - Bump version to v2.0.2 by @github-actions[bot]
14
21
  - Make it all work with the api
15
22
 
16
23
  ### Fixed
@@ -34,6 +41,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
34
41
  * @tnijboer made their first contribution in [#1](https://github.com/clearskies-py/cortex/pull/1)
35
42
  * @cmancone made their first contribution
36
43
  * @ made their first contribution
44
+ [2.0.3]: https://github.com/clearskies-py/cortex/compare/v2.0.2..v2.0.3
37
45
  [2.0.2]: https://github.com/clearskies-py/cortex/compare/v2.0.1..v2.0.2
38
46
 
39
47
  <!-- generated by git-cliff -->
@@ -0,0 +1,6 @@
1
+ ## [2.0.3] - 2026-01-27
2
+
3
+ ### Changed
4
+ - Udpate to QueryResult
5
+ - Update to latest copier version
6
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: clear-skies-cortex
3
- Version: 2.0.2
3
+ Version: 2.0.3
4
4
  Summary: Cortex module for Clearskies
5
5
  Project-URL: Docs, https://https://clearskies.info/modules/clear-skies-cortex
6
6
  Project-URL: Repository, https://github.com/clearskies-py/cortex
@@ -14,7 +14,7 @@ Classifier: Intended Audience :: Developers
14
14
  Classifier: License :: OSI Approved :: MIT License
15
15
  Classifier: Programming Language :: Python :: 3
16
16
  Requires-Python: <4.0,>=3.11
17
- Requires-Dist: clear-skies<3.0.0,>=2.0.0
17
+ Requires-Dist: clear-skies<3.0.0,>=2.0.37
18
18
  Requires-Dist: dacite>=1.9.2
19
19
  Provides-Extra: dev
20
20
  Requires-Dist: types-requests>=2.32.4; extra == 'dev'
@@ -1,13 +1,13 @@
1
1
  [project]
2
2
  name = "clear-skies-cortex"
3
3
  description = "Cortex module for Clearskies"
4
- version = "2.0.2"
4
+ version = "2.0.3"
5
5
  license = "MIT"
6
6
  readme = "./README.md"
7
7
  authors = [{name = "Tom Nijboer", email = "tom.nijboer@cimpress.com"}]
8
8
  requires-python = ">=3.11,<4.0"
9
9
  dependencies = [
10
- "clear-skies>=2.0.0,<3.0.0",
10
+ "clear-skies>=2.0.37,<3.0.0",
11
11
  "dacite>=1.9.2",
12
12
  ]
13
13
  classifiers = [
@@ -44,19 +44,6 @@ exclude = [
44
44
  "tests/**"
45
45
  ]
46
46
 
47
- [tool.black]
48
- line-length = 120
49
- skip-magic-trailing-comma = false
50
- preview = false
51
-
52
- [tool.mypy]
53
- python_version = "3.11"
54
-
55
- exclude = [
56
- ".*_test\\.py$",
57
- "docs/.*"
58
- ]
59
-
60
47
  [tool.pytest.ini_options]
61
48
  minversion = "6.0"
62
49
  addopts = "-ra -q"
@@ -72,7 +59,6 @@ pythonpath = [
72
59
  [dependency-groups]
73
60
  dev = [
74
61
  "akeyless>=5.0.8",
75
- "black>=25.1.0",
76
62
  "mypy>=1.18.2",
77
63
  "pre-commit>=4.3.0",
78
64
  "pytest>=8.4.1",
@@ -7,6 +7,7 @@ from clearskies.authentication import Authentication
7
7
  from clearskies.decorators import parameters_to_properties
8
8
  from clearskies.di import inject
9
9
  from clearskies.query import Query
10
+ from clearskies.query.result import CountQueryResult
10
11
 
11
12
 
12
13
  class CortexBackend(clearskies.backends.ApiBackend):
@@ -39,7 +40,7 @@ class CortexBackend(clearskies.backends.ApiBackend):
39
40
  ):
40
41
  self.finalize_and_validate_configuration()
41
42
 
42
- def count(self, query: Query) -> int:
43
+ def count(self, query: Query) -> CountQueryResult:
43
44
  """Return count of records matching query."""
44
45
  self.check_query(query)
45
46
  (url, method, body, headers) = self.build_records_request(query)
@@ -47,9 +48,9 @@ class CortexBackend(clearskies.backends.ApiBackend):
47
48
  response.raise_for_status()
48
49
  data = response.json()
49
50
  if "total" in data:
50
- return data["total"]
51
+ return CountQueryResult(count=data["total"])
51
52
  data = self.map_records_response(data, query)
52
- return len(data)
53
+ return CountQueryResult(count=len(data))
53
54
 
54
55
  def map_records_response(
55
56
  self, response_data: Any, query: Query, query_data: dict[str, Any] | None = None
@@ -9,6 +9,7 @@ from clearskies.backends.memory_backend import MemoryBackend, MemoryTable
9
9
  from clearskies.columns import String, Uuid
10
10
  from clearskies.di import inject
11
11
  from clearskies.query import Condition, Query
12
+ from clearskies.query.result import RecordsQueryResult
12
13
 
13
14
  from clearskies_cortex.backends import cortex_backend as rest_backend
14
15
 
@@ -34,7 +35,7 @@ class CortexTeamRelationshipBackend(MemoryBackend, Configurable):
34
35
  # or we need to let the di system build the CortexBackend. This change does both:
35
36
  self.cortex_backend = cortex_backend
36
37
 
37
- def records(self, query: Query, next_page_data: dict[str, str | int] | None = None) -> list[dict[str, Any]]:
38
+ def records(self, query: Query) -> RecordsQueryResult:
38
39
  """Accept either a model or a model class and creates a "table" for it."""
39
40
  table_name = query.model_class.destination_name()
40
41
  if table_name not in self._tables:
@@ -45,7 +46,7 @@ class CortexTeamRelationshipBackend(MemoryBackend, Configurable):
45
46
  # we don't need since we built the data ourselves. In short, it will be a lot slower, so I cheat.
46
47
  self._tables[table_name]._rows = records # type: ignore[assignment]
47
48
  self._tables[table_name]._id_index = id_index # type: ignore[assignment]
48
- return super().records(query, next_page_data)
49
+ return super().records(query)
49
50
 
50
51
  def _fetch_and_map_relationship_data(self, table_name: str) -> tuple[list[dict[str, str | int]], dict[str, int]]:
51
52
  class RelationshipModel(Model):
@@ -75,11 +76,14 @@ class CortexTeamRelationshipBackend(MemoryBackend, Configurable):
75
76
  root_categories: dict[str, str] = {}
76
77
  known_children: dict[str, str] = {}
77
78
  relationships: dict[str, set[str]] = {}
78
- for relationship in self._get_cortex_backend().records(
79
- Query(
80
- model_class=RelationshipModel,
81
- ),
82
- {},
79
+ for relationship in (
80
+ self._get_cortex_backend()
81
+ .records(
82
+ Query(
83
+ model_class=RelationshipModel,
84
+ ),
85
+ )
86
+ .records
83
87
  ):
84
88
  child_category = relationship["child_team_tag"]
85
89
  parent_category = relationship["parent_team_tag"]
@@ -153,12 +157,15 @@ class CortexTeamRelationshipBackend(MemoryBackend, Configurable):
153
157
  from clearskies_cortex.models.cortex_team import CortexTeam
154
158
 
155
159
  teams: dict[str, dict[str, Any]] = {}
156
- for team in self._get_cortex_backend().records(
157
- Query(
158
- model_class=CortexTeam,
159
- conditions=[Condition("include_teams_without_members=true")],
160
- ),
161
- {},
160
+ for team in (
161
+ self._get_cortex_backend()
162
+ .records(
163
+ Query(
164
+ model_class=CortexTeam,
165
+ conditions=[Condition("include_teams_without_members=true")],
166
+ ),
167
+ )
168
+ .records
162
169
  ):
163
170
  teams[team["team_tag"]] = team
164
171
  self._cached_teams = teams