Skip to content

Commit

Permalink
Upgrade to Python 3.11 in CI
Browse files Browse the repository at this point in the history
Signed-off-by: Sergey Vasilyev <nolar@nolar.info>
  • Loading branch information
nolar committed Nov 1, 2022
1 parent 19bee05 commit 50f1ff5
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
- run: pip install -r requirements.txt
- run: pre-commit run --all-files
- run: mypy kopf --strict
Expand All @@ -38,7 +38,7 @@ jobs:
fail-fast: false
matrix:
install-extras: [ "", "full-auth" ]
python-version: [ "3.7", "3.8", "3.9", "3.10" ]
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]
name: Python ${{ matrix.python-version }} ${{ matrix.install-extras }}
runs-on: ubuntu-22.04
timeout-minutes: 5 # usually 2-3 mins
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
- uses: nolar/setup-k3d-k3s@v1
with:
version: ${{ matrix.k3s }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
- run: pip install --upgrade setuptools wheel twine
- run: python setup.py sdist bdist_wheel
- uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/thorough.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
- run: pip install -r requirements.txt
- run: pre-commit run --all-files
- run: mypy kopf --strict
Expand All @@ -42,7 +42,7 @@ jobs:
fail-fast: false
matrix:
install-extras: [ "", "full-auth" ]
python-version: [ "3.7", "3.8", "3.9", "3.10" ]
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]
name: Python ${{ matrix.python-version }} ${{ matrix.install-extras }}
runs-on: ubuntu-22.04
timeout-minutes: 5 # usually 2-3 mins
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
- uses: nolar/setup-k3d-k3s@v1
with:
version: ${{ matrix.k3s }}
Expand All @@ -134,7 +134,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
- run: tools/install-minikube.sh
- run: pip install -r requirements.txt -r examples/requirements.txt
- run: pytest --color=yes --timeout=30 --only-e2e
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ We assume that when the operator is executed in the cluster, it must be packaged
into a docker image with a CI/CD tool of your preference.

```dockerfile
FROM python:3.7
FROM python:3.11
ADD . /src
RUN pip install kopf
CMD kopf run /src/handlers.py --verbose
Expand Down
4 changes: 2 additions & 2 deletions docs/deployment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ But normally, the operators are usually deployed directly to the clusters.
Docker image
============

First of all, the operator must be packaged as a docker image with Python 3.7:
First of all, the operator must be packaged as a docker image with Python 3.7 or newer:

.. code-block:: dockerfile
:caption: Dockerfile
:name: dockerfile
FROM python:3.7
FROM python:3.11
ADD . /src
RUN pip install kopf
CMD kopf run /src/handlers.py --verbose
Expand Down
4 changes: 4 additions & 0 deletions kopf/_cogs/structs/diffs.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ def __init__(self, __items: Iterable[DiffItem]):
super().__init__()
self._items = tuple(DiffItem(*item) for item in __items)

def __hash__(self) -> int:
# Hashes mark diffs as immutable to be usable as dataclasses' defaults in Python 3.11.
return hash(self._items)

def __repr__(self) -> str:
return repr(self._items)

Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
Expand Down
2 changes: 2 additions & 0 deletions tests/diffs/test_protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ def test_diff_comparison_to_the_same():
DiffItem(DiffOperation.REMOVE, ('key3',), 'old3', None),
])
assert d1 == d2
assert hash(d1) == hash(d2)
assert d1 is not d2

0 comments on commit 50f1ff5

Please sign in to comment.