Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.11 support #362

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'
cache: 'poetry'

- name: Set up mdbook
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'

- name: macOS runner workaround
run: pip install --upgrade pip pipx
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'
cache: 'poetry'

- name: Install project
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1.3-labs
FROM python:3.10-slim-buster AS compile-image
FROM python:3.11-slim-buster AS compile-image
ARG DIPDUP_DOCKER_IMAGE=default
ENV DIPDUP_DOCKER=1
ENV DIPDUP_DOCKER_IMAGE=${DIPDUP_DOCKER_IMAGE}
Expand All @@ -18,7 +18,7 @@ COPY pyproject.toml requirements.txt requirements.pytezos.txt README.md /opt/dip

RUN /usr/local/bin/pip install --prefix /opt/dipdup --no-cache-dir --disable-pip-version-check --no-deps -r /opt/dipdup/requirements.`if [[ $DIPDUP_DOCKER_IMAGE = "pytezos" ]]; then echo "pytezos."; fi`txt -e .

FROM python:3.10-slim-buster AS build-image
FROM python:3.11-slim-buster AS build-image

ARG DIPDUP_DOCKER_IMAGE=default
ENV DIPDUP_DOCKER=1
Expand All @@ -33,7 +33,7 @@ RUN useradd -ms /bin/bash dipdup && \

USER dipdup
ENV PATH="/opt/dipdup/bin:$PATH"
ENV PYTHONPATH="/home/dipdup:/home/dipdup/src:/opt/dipdup/src:/opt/dipdup/lib/python3.10/site-packages:$PYTHONPATH"
ENV PYTHONPATH="/home/dipdup:/home/dipdup/src:/opt/dipdup/src:/opt/dipdup/lib/python3.11/site-packages:$PYTHONPATH"
WORKDIR /home/dipdup/
ENTRYPOINT ["dipdup"]
CMD ["run"]
Expand Down
14 changes: 10 additions & 4 deletions Dockerfile.slim
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
FROM python:3.10-alpine3.16 AS compile-image
RUN apk add --update --no-cache build-base gcc musl-dev python3-dev libffi-dev openssl-dev cargo && \
FROM python:3.11-alpine3.16 AS compile-image
# FIXME: https://github.com/ijl/orjson/issues/155
RUN apk add --update --no-cache build-base gcc musl-dev python3-dev libffi-dev openssl-dev rustup && \
rustup-init -y --default-toolchain nightly
ENV PATH="/root/.cargo/bin:${PATH}"
RUN rustup update && \
python -m venv --without-pip --system-site-packages /opt/dipdup && \
mkdir -p /opt/dipdup/src/dipdup/ && \
touch /opt/dipdup/src/dipdup/__init__.py
Expand All @@ -10,18 +14,20 @@ COPY pyproject.toml requirements.slim.txt README.md /opt/dipdup/

RUN /usr/local/bin/pip install --prefix /opt/dipdup --no-cache-dir --disable-pip-version-check --no-deps -r /opt/dipdup/requirements.slim.txt -e .

FROM python:3.10-alpine3.16 AS build-image
FROM python:3.11-alpine3.16 AS build-image
RUN adduser -D dipdup
USER dipdup
ENV DIPDUP_DOCKER=1
ENV DIPDUP_DOCKER_IMAGE=slim
ENV PATH="/opt/dipdup/bin:$PATH"
ENV PYTHONPATH="/home/dipdup:/home/dipdup/src:/opt/dipdup/src:/opt/dipdup/lib/python3.10/site-packages:$PYTHONPATH"
ENV PYTHONPATH="/home/dipdup:/home/dipdup/src:/opt/dipdup/src:/opt/dipdup/lib/python3.11/site-packages:$PYTHONPATH"
WORKDIR /home/dipdup/
ENTRYPOINT ["dipdup"]
CMD ["run"]

COPY --chown=dipdup --chmod=0755 scripts/install_dependencies.sh /opt/dipdup/bin/install_dependencies
COPY --chown=dipdup --chmod=0755 scripts/install_dependencies.sh /opt/dipdup/bin/inject_pyproject

COPY --chown=dipdup --from=compile-image /usr/lib/libgcc_s.so.1 /usr/lib/libgcc_s.so.1
COPY --chown=dipdup --from=compile-image /opt/dipdup /opt/dipdup
COPY --chown=dipdup . /opt/dipdup
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ clean: ## Remove all files from .gitignore except for `.venv`
git clean -xdf --exclude=".venv"

update: ## Update dependencies, export requirements.txt
git checkout HEAD requirements.* poetry.lock
# git checkout HEAD requirements.* poetry.lock

make install
poetry update
Expand Down
2 changes: 1 addition & 1 deletion demos/demo-auction/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ packages = [
]

[tool.poetry.dependencies]
python = ">=3.10,<3.11"
python = ">=3.10,<3.12"
dipdup = "^6"

[tool.poetry.group.dev.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion demos/demo-big-maps/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ packages = [
]

[tool.poetry.dependencies]
python = ">=3.10,<3.11"
python = ">=3.10,<3.12"
dipdup = "^6"

[tool.poetry.group.dev.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion demos/demo-dao/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ packages = [
]

[tool.poetry.dependencies]
python = ">=3.10,<3.11"
python = ">=3.10,<3.12"
dipdup = "^6"

[tool.poetry.group.dev.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion demos/demo-dex/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ packages = [
]

[tool.poetry.dependencies]
python = ">=3.10,<3.11"
python = ">=3.10,<3.12"
dipdup = "^6"

[tool.poetry.group.dev.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion demos/demo-domains/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ packages = [
]

[tool.poetry.dependencies]
python = ">=3.10,<3.11"
python = ">=3.10,<3.12"
dipdup = "^6"

[tool.poetry.group.dev.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion demos/demo-events/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ packages = [
]

[tool.poetry.dependencies]
python = ">=3.10,<3.11"
python = ">=3.10,<3.12"
dipdup = "^6"

[tool.poetry.group.dev.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion demos/demo-factories/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ packages = [
]

[tool.poetry.dependencies]
python = ">=3.10,<3.11"
python = ">=3.10,<3.12"
dipdup = "^6"

[tool.poetry.group.dev.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion demos/demo-head/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ packages = [
]

[tool.poetry.dependencies]
python = ">=3.10,<3.11"
python = ">=3.10,<3.12"
dipdup = "^6"

[tool.poetry.group.dev.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion demos/demo-nft-marketplace/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ packages = [
]

[tool.poetry.dependencies]
python = ">=3.10,<3.11"
python = ">=3.10,<3.12"
dipdup = "^6"

[tool.poetry.group.dev.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion demos/demo-raw/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ packages = [
]

[tool.poetry.dependencies]
python = ">=3.10,<3.11"
python = ">=3.10,<3.12"
dipdup = "^6"

[tool.poetry.group.dev.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion demos/demo-token-transfers/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ packages = [
]

[tool.poetry.dependencies]
python = ">=3.10,<3.11"
python = ">=3.10,<3.12"
dipdup = "^6"

[tool.poetry.group.dev.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion demos/demo-token/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ packages = [
]

[tool.poetry.dependencies]
python = ">=3.10,<3.11"
python = ">=3.10,<3.12"
dipdup = "^6"

[tool.poetry.group.dev.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion docs/config/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<dl class="py class">
<dt class="sig sig-object py" id="DipDupConfig">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre"></span></span><span class="sig-name descname"><span class="pre">DipDupConfig</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">spec_version</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">package</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">datasources=&lt;factory&gt;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">database=SqliteDatabaseConfig(kind='sqlite'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">path=':memory:')</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">contracts=&lt;factory&gt;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">indexes=&lt;factory&gt;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">templates=&lt;factory&gt;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">jobs=&lt;factory&gt;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">hooks=&lt;factory&gt;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">hasura=None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sentry=SentryConfig(dsn=''</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">environment=None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">server_name=None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">release=None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">user_id=None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">debug=False)</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">prometheus=None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">advanced=AdvancedConfig(reindex={}</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">scheduler=None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">postpone_jobs=False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">early_realtime=False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">merge_subscriptions=False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">metadata_interface=False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">skip_version_check=False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rollback_depth=2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">crash_reporting=False)</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">custom=&lt;factory&gt;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">logging=LoggingValues.default</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#DipDupConfig" title="Permalink to this definition">¶</a></dt>
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre"></span></span><span class="sig-name descname"><span class="pre">DipDupConfig</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">spec_version</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">package</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">datasources=&lt;factory&gt;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">database=&lt;factory&gt;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">contracts=&lt;factory&gt;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">indexes=&lt;factory&gt;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">templates=&lt;factory&gt;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">jobs=&lt;factory&gt;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">hooks=&lt;factory&gt;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">hasura=None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">prometheus=None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sentry=&lt;factory&gt;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">advanced=&lt;factory&gt;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">custom=&lt;factory&gt;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">logging=LoggingValues.default</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#DipDupConfig" title="Permalink to this definition">¶</a></dt>
<dd><p>Main indexer config</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
Expand Down
4 changes: 2 additions & 2 deletions docs/deployment/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ DipDup provides multiple prebuilt images for different environments hosted on [D

| | default | pytezos | slim |
| --------------------------- |:-----------------------------------:|:-------------------------------------------:|:----------------------------------------:|
| base image | `python:3.10-slim` | `python:3.10-slim` | `python:3.10-alpine` |
| base image | `python:3.11-slim` | `python:3.11-slim` | `python:3.11-alpine` |
| platforms | `amd64`, `arm64` | `amd64`, `arm64` | `amd64`, `arm64` |
| latest tag | `{{ cookiecutter.dipdup_version }}` | `{{ cookiecutter.dipdup_version }}-pytezos` | `{{ cookiecutter.dipdup_version }}-slim` |
| image size | 376M | 496M | 97M |
| image size | 352M | 511M | 104M |
| `dipdup init` command | ✅ | ✅ | ❌ |
| `git` and `poetry` included | ✅ | ✅ | ❌ |
| PyTezos included | ❌ | ✅ | ❌ |
Expand Down
2 changes: 1 addition & 1 deletion docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ If you're using Poetry, set caret version constraint in `pyproject.toml` to use

```toml
[tool.poetry.dependencies]
python = ">=3.10,<3.11"
python = ">=3.10,<3.12"
dipdup = "^{{ cookiecutter.dipdup_version }}"
```

Expand Down
23 changes: 13 additions & 10 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ packages = [
]

[tool.poetry.dependencies]
python = ">=3.10,<3.11"
python = ">=3.10,<3.12"

asyncpg = "0.27.0"
datamodel-code-generator = "0.17.1"
Expand All @@ -42,9 +42,9 @@ anyio = "^3.3.2"
APScheduler = "^3.8.0"
asyncclick = "^8.0.1"
orjson = "^3.6.6"
prometheus-client = "^0.14.1"
prometheus-client = "^0.15.0"
pyhumps = "^3.0.2"
python-dotenv = "^0.19.0"
python-dotenv = "^0.21.0"
"ruamel.yaml" = "^0.17.2"
sentry-sdk = "^1.4.3"
sqlparse = "^0.4.2"
Expand Down Expand Up @@ -94,7 +94,7 @@ extend-select = ["B", "C4", "Q"] # todo: G, PTH, RET, RUF, S, TCH
flake8-quotes = {inline-quotes = "single", multiline-quotes = "double"}

[tool.mypy]
python_version = "3.10"
python_version = "3.11"
plugins = ["pydantic.mypy"]

[tool.pytest.ini_options]
Expand Down
Loading