Skip to content

Commit d69d8e5

Browse files
nesitorAndres D. Molins
authored andcommitted
Problem: Node operators with Python 3.12 version cannot install the package. (#575)
Solution: Upgrade dependencies to be able to use Python 3.12. Co-authored-by: Andres D. Molins <[email protected]>
1 parent 4986d88 commit d69d8e5

File tree

6 files changed

+24
-23
lines changed

6 files changed

+24
-23
lines changed

.github/workflows/pytest.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ jobs:
3333
# Fetch the whole history for all tags and branches (required for aleph.__version__)
3434
fetch-depth: 0
3535

36-
- name: Set up Python 3.11
36+
- name: Set up Python 3.12
3737
id: setup-python
3838
uses: actions/setup-python@v2
3939
with:
40-
python-version: 3.11
40+
python-version: 3.12
4141

4242
- name: Install latest Rust nightly toolchain
4343
uses: actions-rs/toolchain@v1

deployment/docker-build/pyaleph.dockerfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ RUN apt-get update && apt-get -y upgrade && apt-get install -y \
1010
git \
1111
libgmp-dev \
1212
libsecp256k1-dev \
13-
python3.11
13+
python3.12
1414

1515
FROM base as builder
1616

@@ -23,8 +23,9 @@ RUN apt-get update && apt-get install -y \
2323
build-essential \
2424
curl \
2525
pkg-config \
26-
python3.11-dev \
27-
python3.11-venv \
26+
python3.12-dev \
27+
python3.12-venv \
28+
libpq-dev \
2829
software-properties-common
2930

3031
# Install Rust to build Python packages
@@ -37,11 +38,11 @@ ENV PATH="/root/.cargo/bin:${PATH}"
3738
RUN rustup default nightly
3839

3940
# Create virtualenv
40-
RUN python3.11 -m venv /opt/venv
41+
RUN python3.12 -m venv /opt/venv
4142

4243
# Install pip
4344
ENV PIP_NO_CACHE_DIR yes
44-
RUN /opt/venv/bin/python3.11 -m pip install --upgrade pip wheel
45+
RUN /opt/venv/bin/python3.12 -m pip install --upgrade pip wheel
4546
ENV PATH="/opt/venv/bin:${PATH}"
4647

4748
WORKDIR /opt/pyaleph
@@ -53,7 +54,7 @@ COPY .git ./.git
5354
COPY src ./src
5455
RUN pip install -e .
5556
COPY deployment/docker-build/aiohttp.diff /tmp/aiohttp.diff
56-
RUN patch /opt/venv/lib/python3.11/site-packages/aiohttp/web_protocol.py /tmp/aiohttp.diff
57+
RUN patch /opt/venv/lib/python3.12/site-packages/aiohttp/web_protocol.py /tmp/aiohttp.diff
5758

5859

5960
FROM base

pyproject.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
66
name = "pyaleph"
77
dynamic = ["version"]
88
description = "Reference implementation of Aleph.im next generation network of decentralized big data applications."
9-
requires-python = ">=3.11,<3.12"
9+
requires-python = ">=3.12,<3.13"
1010
readme = "README.md"
1111
license = { file = "LICENSE.txt" }
1212
authors = [
@@ -21,15 +21,15 @@ dependencies = [
2121
"aiocache==0.12.2",
2222
"aiohttp-cors==0.7.0",
2323
"aiohttp-jinja2==1.5",
24-
"aiohttp==3.8.4",
24+
"aiohttp==3.9.5",
2525
"aioipfs@git+https://github.com/aleph-im/aioipfs.git@d671c79b2871bb4d6c8877ba1e7f3ffbe7d20b71",
2626
"alembic==1.12.1",
2727
"aleph-message==0.4.2",
2828
"aleph-p2p-client@git+https://github.com/aleph-im/p2p-service-client-python@2c04af39c566217f629fd89505ffc3270fba8676",
2929
"aleph-pytezos@git+https://github.com/aleph-im/aleph-pytezos.git@32dd1749a4773da494275709060632cbeba9a51b",
3030
"asyncpg==0.28.0",
3131
"base58>=1.0.3",
32-
"coincurve==18.0.0",
32+
"coincurve==19.0.1",
3333
"configmanager==1.35.1",
3434
"configparser==6.0.0",
3535
"cosmospy==6.0.0",
@@ -48,13 +48,13 @@ dependencies = [
4848
"pynacl==1.5.0",
4949
"python-dateutil==2.8.2",
5050
"pytz==2023.3",
51-
"pyyaml==6.0",
51+
"pyyaml==6.0.1",
5252
"redis[hiredis]==5.0.1",
5353
"requests==2.31.0",
5454
"secp256k1==0.14.0",
5555
"sentry-sdk==1.34.0",
5656
"setproctitle==1.3.3",
57-
"sqlalchemy[mypy]==1.4.41",
57+
"sqlalchemy[mypy]==1.4.52",
5858
"sqlalchemy-utils==0.38.3",
5959
"substrate-interface==1.7.4",
6060
"ujson==5.1.0", # required by aiocache
@@ -188,7 +188,7 @@ all = [
188188
]
189189

190190
[tool.mypy]
191-
python_version = 3.11
191+
python_version = 3.12
192192
mypy_path = "src"
193193
plugins = [
194194
"sqlalchemy.ext.mypy.plugin",

shell.nix

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ pkgs.mkShell {
1111
pkgs.hatch
1212
pkgs.rustup
1313

14-
pkgs.python311
15-
pkgs.python311Packages.virtualenv
16-
pkgs.python311Packages.pip
17-
pkgs.python311Packages.setuptools
14+
pkgs.python312
15+
pkgs.python312Packages.virtualenv
16+
pkgs.python312Packages.pip
17+
pkgs.python312Packages.setuptools
1818

19-
pkgs.python311Packages.secp256k1
20-
pkgs.python311Packages.fastecdsa
21-
pkgs.python311Packages.greenlet
19+
pkgs.python312Packages.secp256k1
20+
pkgs.python312Packages.fastecdsa
21+
pkgs.python312Packages.greenlet
2222
];
2323

2424
shellHook = ''

tests/api/test_p2p.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,4 @@ async def test_post_message_sync(ccn_api_client, mocker):
9797
assert pub_status["failed"] == []
9898

9999
# Check that we cleaned up the queue
100-
assert mocked_queue.delete.called_once
100+
mocked_queue.assert_called_once()

tests/storage/test_store_message.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ async def test_handle_new_storage_file(
104104
assert stored_file.type == FileType.FILE
105105
assert stored_file.size == len(raw_content)
106106

107-
assert get_hash_content_mock.called_once
107+
get_hash_content_mock.assert_called_once()
108108

109109

110110
@pytest.mark.asyncio

0 commit comments

Comments
 (0)