Skip to content

Commit

Permalink
[fix][chore] Move to Python 3.12 (#2219)
Browse files Browse the repository at this point in the history
  • Loading branch information
aquamatthias authored Oct 2, 2024
1 parent 76f1e08 commit 207397f
Show file tree
Hide file tree
Showing 71 changed files with 92 additions and 89 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/basecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
architecture: 'x64'

- name: Install Dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_pr_fixlib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
architecture: 'x64'

- name: Restore dependency cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_pr_fixmetrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
architecture: 'x64'

- name: Restore dependency cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_pr_fixshell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
architecture: 'x64'

- name: Restore dependency cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_pr_fixworker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
architecture: 'x64'

- name: Restore dependency cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_pr_plugin_aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
architecture: 'x64'

- name: Restore dependency cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_pr_plugin_azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
architecture: 'x64'

- name: Restore dependency cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_pr_plugin_digitalocean.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
architecture: 'x64'

- name: Restore dependency cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_pr_plugin_dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
architecture: 'x64'

- name: Restore dependency cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_pr_plugin_example_collector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
architecture: 'x64'

- name: Restore dependency cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_pr_plugin_gcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
architecture: 'x64'

- name: Restore dependency cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_pr_plugin_github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
architecture: 'x64'

- name: Restore dependency cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_pr_plugin_hetzner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
architecture: 'x64'

- name: Restore dependency cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_pr_plugin_k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
architecture: 'x64'

- name: Restore dependency cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_pr_plugin_onelogin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
architecture: 'x64'

- name: Restore dependency cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_pr_plugin_onprem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
architecture: 'x64'

- name: Restore dependency cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_pr_plugin_posthog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
architecture: 'x64'

- name: Restore dependency cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_pr_plugin_random.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
architecture: 'x64'

- name: Restore dependency cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_pr_plugin_scarf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
architecture: 'x64'

- name: Restore dependency cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_pr_plugin_slack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
architecture: 'x64'

- name: Restore dependency cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_pr_plugin_vsphere.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
architecture: 'x64'

- name: Restore dependency cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create_plugin_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
architecture: 'x64'
- name: Restore dependency cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fixcore_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
architecture: 'x64'
- name: Restore dependency cache
uses: actions/cache@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fixcore_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
architecture: 'x64'
- name: Restore dependency cache
uses: actions/cache@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fixcore_test_and_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
architecture: 'x64'
- name: Setup Rust
uses: actions-rs/toolchain@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/model_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
architecture: 'x64'

- name: Restore dependency cache
Expand Down
2 changes: 1 addition & 1 deletion fixcore/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ lint: ## static code analysis
black --line-length 120 --check fixcore tests
flake8 fixcore
pylint fixcore
mypy --python-version 3.11 --strict fixcore tests
mypy --python-version 3.12 --strict fixcore tests

test: ## run tests quickly with the default Python
pytest
Expand Down
2 changes: 1 addition & 1 deletion fixcore/fixcore/cli/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# noinspection PyProtectedMember
from asyncio.subprocess import Process
from collections import defaultdict
from collections.abc import Hashable
from contextlib import suppress
from datetime import timedelta, datetime
from functools import partial, lru_cache, cached_property
Expand All @@ -28,7 +29,6 @@
Optional,
Any,
AsyncIterator,
Hashable,
Iterable,
Callable,
Awaitable,
Expand Down
2 changes: 1 addition & 1 deletion fixcore/fixcore/db/graphdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,7 @@ def parent_edges(edge_type: EdgeType) -> Tuple[str, Json]:
root_kind = GraphResolver.resolved_kind(graph_to_merge.nodes[root])
if root_kind:
# noinspection PyTypeChecker
log.info(f"Update subgraph: root={root} ({root_kind}, {num+1} of {len(roots)})")
log.info(f"Update subgraph: root={root} ({root_kind}, {num + 1} of {len(roots)})")
node_query = self.query_update_nodes(root_kind), {"update_id": root}
edge_query = partial(merge_edges, root, root_kind)
change += await prepare_graph(graph, node_query, edge_query)
Expand Down
2 changes: 1 addition & 1 deletion fixcore/fixcore/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class NotEnoughPermissions(web.HTTPForbidden):
def __init__(self, user_permissions: Set[Any], required_permissions: Set[Any]) -> None:
super().__init__(
text=f"Not allowed to perform this operation. "
f"Missing permission: {', '.join(a.name for a in (required_permissions-user_permissions))}"
f"Missing permission: {', '.join(a.name for a in (required_permissions - user_permissions))}"
)
self.user_permissions = user_permissions
self.required_permissions = required_permissions
4 changes: 2 additions & 2 deletions fixcore/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = [{name="Some Engineering Inc."}]
description = "Keeps all the things."
license = { text="AGPLv3" }
urls = {"Homepage" = "https://inventory.fix.security"}
requires-python = ">=3.11"
requires-python = ">=3.12"
classifiers = [
# Current project status
"Development Status :: 5 - Production/Stable",
Expand All @@ -15,7 +15,7 @@ classifiers = [
# License information
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
# Supported python versions
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
# Supported OS's
"Operating System :: POSIX :: Linux",
"Operating System :: Unix",
Expand Down
1 change: 1 addition & 0 deletions fixcore/tests/fixcore/worker_task_queue_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ async def test_handle_outdated(
# every message is retried 3 times ==> 4 times to get rid of all messages
assert count_outstanding == 4

await asyncio.sleep(0)
results = await asyncio.gather(*[a.callback for a in all_tasks], return_exceptions=True)
# make sure all results are failures
for r in results:
Expand Down
2 changes: 1 addition & 1 deletion fixcore/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ commands = flake8 fixcore
commands = pylint fixcore

[testenv:mypy]
commands= python -m mypy --install-types --non-interactive --python-version 3.11 --strict fixcore tests
commands= python -m mypy --install-types --non-interactive --python-version 3.12 --strict fixcore tests

[testenv:tests]
commands = pytest
2 changes: 1 addition & 1 deletion fixlib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ lint: ## static code analysis
black --line-length 120 --check fixlib test
flake8 fixlib
#pylint fixlib
mypy --python-version 3.11 --strict --install-types --non-interactive fixlib
mypy --python-version 3.12 --strict --install-types --non-interactive fixlib

test: ## run tests quickly with the default Python
pytest
Expand Down
4 changes: 2 additions & 2 deletions fixlib/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "4.1.0"
authors = [{ name = "Some Engineering Inc." }]
description = "Fix Inventory common library."
license = { text = "AGPLv3" }
requires-python = ">=3.11"
requires-python = ">=3.12"
classifiers = [
# Current project status
"Development Status :: 5 - Production/Stable",
Expand All @@ -14,7 +14,7 @@ classifiers = [
# License information
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
# Supported python versions
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
# Supported OS's
"Operating System :: POSIX :: Linux",
"Operating System :: Unix",
Expand Down
4 changes: 2 additions & 2 deletions fixmetrics/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "4.1.0"
authors = [{name="Some Engineering Inc."}]
description = "Exports Fix Inventory metrics in Prometheus format."
license = { text="AGPLv3" }
requires-python = ">=3.11"
requires-python = ">=3.12"
classifiers = [
# Current project status
"Development Status :: 5 - Production/Stable",
Expand All @@ -14,7 +14,7 @@ classifiers = [
# License information
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
# Supported python versions
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
# Supported OS's
"Operating System :: POSIX :: Linux",
"Operating System :: Unix",
Expand Down
2 changes: 1 addition & 1 deletion fixshell/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ lint: ## static code analysis
black --line-length 120 --check fixshell test
flake8 fixshell
pylint fixshell
mypy --python-version 3.11 --strict --install-types --non-interactive fixshell test
mypy --python-version 3.12 --strict --install-types --non-interactive fixshell test

test: ## run tests quickly with the default Python
pytest
Expand Down
4 changes: 2 additions & 2 deletions fixshell/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "4.1.0"
authors = [{name="Some Engineering Inc."}]
description = "Commandline interpreter to interact with Fix Inventory."
license = { text="AGPLv3" }
requires-python = ">=3.11"
requires-python = ">=3.12"
classifiers = [
# Current project status
"Development Status :: 5 - Production/Stable",
Expand All @@ -14,7 +14,7 @@ classifiers = [
# License information
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
# Supported python versions
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
# Supported OS's
"Operating System :: POSIX :: Linux",
"Operating System :: Unix",
Expand Down
2 changes: 1 addition & 1 deletion fixshell/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ commands= pytest
commands = black --line-length 120 --check --diff --target-version py39 .

[testenv:mypy]
commands= python -m mypy --install-types --non-interactive --python-version 3.11 --strict fixshell test
commands= python -m mypy --install-types --non-interactive --python-version 3.12 --strict fixshell test
2 changes: 1 addition & 1 deletion fixworker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ lint: ## static code analysis
black --line-length 120 --check fixworker test
flake8 fixworker
#pylint fixworker
mypy --python-version 3.11 --strict --install-types --non-interactive fixworker
mypy --python-version 3.12 --strict --install-types --non-interactive fixworker

test: ## run tests quickly with the default Python
pytest
Expand Down
Loading

0 comments on commit 207397f

Please sign in to comment.