Skip to content

Commit

Permalink
Add support for Python 3.12 (#1272)
Browse files Browse the repository at this point in the history
* Bump the dev-dependencies group with 13 updates

Bumps the dev-dependencies group with 13 updates:

| Package | From | To |
| --- | --- | --- |
| [pytest](https://github.com/pytest-dev/pytest) | `7.4.0` | `7.4.4` |
| [black](https://github.com/psf/black) | `23.7.0` | `23.12.1` |
| [poethepoet](https://github.com/nat-n/poethepoet) | `0.22.0` | `0.24.4` |
| [coverage](https://github.com/nedbat/coveragepy) | `7.3.0` | `7.4.0` |
| [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) | `0.21.1` | `0.23.3` |
| [pylint](https://github.com/pylint-dev/pylint) | `2.17.5` | `3.0.3` |
| [setuptools](https://github.com/pypa/setuptools) | `68.1.2` | `69.0.3` |
| [pytest-mock](https://github.com/pytest-dev/pytest-mock) | `3.11.1` | `3.12.0` |
| [pytest-xdist](https://github.com/pytest-dev/pytest-xdist) | `3.3.1` | `3.5.0` |
| [pyright](https://github.com/RobertCraigie/pyright-python) | `1.1.325` | `1.1.345` |
| [isort](https://github.com/pycqa/isort) | `5.12.0` | `5.13.2` |
| [pytest-rerunfailures](https://github.com/pytest-dev/pytest-rerunfailures) | `12.0` | `13.0` |
| [cairo-lang](https://github.com/starkware-libs/cairo-lang) | `0.12.2` | `0.13.0` |


Updates `pytest` from 7.4.0 to 7.4.4
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](pytest-dev/pytest@7.4.0...7.4.4)

Updates `black` from 23.7.0 to 23.12.1
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](psf/black@23.7.0...23.12.1)

Updates `poethepoet` from 0.22.0 to 0.24.4
- [Release notes](https://github.com/nat-n/poethepoet/releases)
- [Commits](nat-n/poethepoet@v0.22.0...v0.24.4)

Updates `coverage` from 7.3.0 to 7.4.0
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](nedbat/coveragepy@7.3.0...7.4.0)

Updates `pytest-asyncio` from 0.21.1 to 0.23.3
- [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases)
- [Commits](pytest-dev/pytest-asyncio@v0.21.1...v0.23.3)

Updates `pylint` from 2.17.5 to 3.0.3
- [Release notes](https://github.com/pylint-dev/pylint/releases)
- [Commits](pylint-dev/pylint@v2.17.5...v3.0.3)

Updates `setuptools` from 68.1.2 to 69.0.3
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](pypa/setuptools@v68.1.2...v69.0.3)

Updates `pytest-mock` from 3.11.1 to 3.12.0
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases)
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/main/CHANGELOG.rst)
- [Commits](pytest-dev/pytest-mock@v3.11.1...v3.12.0)

Updates `pytest-xdist` from 3.3.1 to 3.5.0
- [Release notes](https://github.com/pytest-dev/pytest-xdist/releases)
- [Changelog](https://github.com/pytest-dev/pytest-xdist/blob/master/CHANGELOG.rst)
- [Commits](pytest-dev/pytest-xdist@v3.3.1...v3.5.0)

Updates `pyright` from 1.1.325 to 1.1.345
- [Release notes](https://github.com/RobertCraigie/pyright-python/releases)
- [Commits](RobertCraigie/pyright-python@v1.1.325...v1.1.345)

Updates `isort` from 5.12.0 to 5.13.2
- [Release notes](https://github.com/pycqa/isort/releases)
- [Changelog](https://github.com/PyCQA/isort/blob/main/CHANGELOG.md)
- [Commits](PyCQA/isort@5.12.0...5.13.2)

Updates `pytest-rerunfailures` from 12.0 to 13.0
- [Changelog](https://github.com/pytest-dev/pytest-rerunfailures/blob/master/CHANGES.rst)
- [Commits](pytest-dev/pytest-rerunfailures@12.0...13.0)

Updates `cairo-lang` from 0.12.2 to 0.13.0
- [Release notes](https://github.com/starkware-libs/cairo-lang/releases)
- [Commits](starkware-libs/cairo-lang@v0.12.2...v0.13.0)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-dependencies
- dependency-name: black
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-dependencies
- dependency-name: poethepoet
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-dependencies
- dependency-name: coverage
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-dependencies
- dependency-name: pytest-asyncio
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-dependencies
- dependency-name: pylint
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: dev-dependencies
- dependency-name: setuptools
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: dev-dependencies
- dependency-name: pytest-mock
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-dependencies
- dependency-name: pytest-xdist
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-dependencies
- dependency-name: pyright
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-dependencies
- dependency-name: isort
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-dependencies
- dependency-name: pytest-rerunfailures
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: dev-dependencies
- dependency-name: cairo-lang
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-dependencies
...

Signed-off-by: dependabot[bot] <[email protected]>

* revert pytest-asyncio to ^0.21.1  beacause of changes in the context of event_loop

* update hash

* fix lint

* fix linter

* Add issue id to TODO

* fix imports

* format

* downgrade pyright version

* Update pyproject.toml

Co-authored-by: ddoktorski <[email protected]>

* fix

* Add support for python 3.12*

* adds to many arguments

* remove v3.8 python

* fix

* revert version 3.8

* linter

* test

* test

* test

* use python 3.11 to build

* fix

* update

* try version 3.12

* test

* update pyproject

* fix

* feedback

* remove --without py312-dev

* update

* test

* simplyfy install cairo-lang

* remove cairo-lang from deps

* feedback

* remove istall cairo-lang

* Update docs/development.rst

Co-authored-by: ddoktorski <[email protected]>

* Update .github/workflows/checks.yml

Co-authored-by: ddoktorski <[email protected]>

* feedback

* clean up

* clean up code

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: ddoktorski <[email protected]>
  • Loading branch information
3 people authored Feb 9, 2024
1 parent 976f1fd commit c44e782
Show file tree
Hide file tree
Showing 6 changed files with 989 additions and 1,942 deletions.
75 changes: 25 additions & 50 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ jobs:
pip install poetry
poetry config installer.modern-installation false
- name: Set up Python 3.9
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.12"
cache: 'poetry'

- name: Install dependencies
run: |
poetry install --without py39-dev
poetry install
- name: Check poetry.lock
run: |
Expand All @@ -67,7 +67,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.9" ]
python-version: [ "3.12" ]
steps:

# ====================== SETUP ====================== #
Expand All @@ -76,7 +76,7 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.12"
cache: 'pip'

- name: Install poetry
Expand All @@ -85,10 +85,10 @@ jobs:
pip install poetry
poetry config installer.modern-installation false
- name: Install python 3.9 requirements
- name: Install deprecated cairo compiler
run: |
poetry export -f requirements.txt --only=py39-dev --without-hashes --output requirements.txt
pip install -r requirements.txt
pip install --upgrade setuptools
pip install cairo-lang==0.13.0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
Expand All @@ -98,7 +98,7 @@ jobs:

- name: Install dependencies
run: |
poetry install --without py39-dev
poetry install
# ====================== CONTRACTS v0 ====================== #

Expand Down Expand Up @@ -131,7 +131,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
steps:
- uses: actions/checkout@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
Expand All @@ -145,7 +145,7 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.12"
cache: 'pip'

# ====================== SETUP PYTHON ====================== #
Expand All @@ -156,11 +156,6 @@ jobs:
pip install poetry
poetry config installer.modern-installation false
- name: Install python 3.9 requirements
run: |
poetry export -f requirements.txt --only=py39-dev --without-hashes --output requirements.txt
pip install -r requirements.txt
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand All @@ -169,7 +164,7 @@ jobs:

- name: Install dependencies
run: |
poetry install --without py39-dev
poetry install
# ====================== SETUP DEVNET ====================== #

Expand Down Expand Up @@ -227,7 +222,7 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.12"
cache: 'pip'

# ====================== SETUP PYTHON ====================== #
Expand All @@ -238,20 +233,15 @@ jobs:
pip install poetry
poetry config installer.modern-installation false
- name: Install python 3.9 requirements
run: |
poetry export -f requirements.txt --only=py39-dev --without-hashes --output requirements.txt
pip install -r requirements.txt
- name: Set up Python 3.9
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.12"
cache: 'poetry'

- name: Install dependencies
run: |
poetry install --without py39-dev
poetry install
# ====================== RUN TESTS ====================== #

Expand Down Expand Up @@ -282,7 +272,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
steps:
- uses: actions/checkout@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
Expand All @@ -296,7 +286,7 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.12"
cache: 'pip'

# ====================== SETUP DEVNET ====================== #
Expand All @@ -312,11 +302,6 @@ jobs:
pip install poetry
poetry config installer.modern-installation false
- name: Install python 3.9 requirements
run: |
poetry export -f requirements.txt --only=py39-dev --without-hashes --output requirements.txt
pip install -r requirements.txt
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand All @@ -325,7 +310,7 @@ jobs:

- name: Install dependencies
run: |
poetry install --without py39-dev
poetry install
# ====================== RUN TESTS ====================== #

Expand Down Expand Up @@ -356,7 +341,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
steps:
- uses: actions/checkout@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
Expand All @@ -370,7 +355,7 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.12"
cache: 'pip'

# ====================== SETUP PYTHON ====================== #
Expand All @@ -381,11 +366,6 @@ jobs:
pip install poetry
poetry config installer.modern-installation false
- name: Install python 3.9 requirements
run: |
poetry export -f requirements.txt --only=py39-dev --without-hashes --output requirements.txt
pip install -r requirements.txt
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand All @@ -394,7 +374,7 @@ jobs:

- name: Install dependencies
run: |
poetry install --without py39-dev
poetry install
# ====================== SETUP DEVNET ====================== #

Expand Down Expand Up @@ -430,7 +410,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
steps:
- uses: actions/checkout@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
Expand All @@ -444,7 +424,7 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.12"
cache: 'pip'

# ====================== SETUP PYTHON ====================== #
Expand All @@ -455,11 +435,6 @@ jobs:
pip install poetry
poetry config installer.modern-installation false
- name: Install python 3.9 requirements
run: |
poetry export -f requirements.txt --only=py39-dev --without-hashes --output requirements.txt
pip install -r requirements.txt
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand All @@ -468,7 +443,7 @@ jobs:

- name: Install dependencies
run: |
poetry install --without py39-dev
poetry install
# ====================== SETUP DEVNET ====================== #

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/manual_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ on:
- '3.9'
- '3.10'
- '3.11'
- '3.12'

jobs:
setup:
Expand Down
3 changes: 1 addition & 2 deletions docs/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ Development dependencies
------------------------
- `poetry <https://python-poetry.org/>`_ - dependency manager.
- `pyenv <https://github.com/pyenv/pyenv>`_ - recommended for installing and switching python versions locally.

Make sure running ``poetry run python --version`` returns ``Python 3.9.x``.
- `cairo-lang <https://pypi.org/project/cairo-lang/>`_ - required to compile contracts (`poe compile_contracts`)

Setup
-----
Expand Down
Loading

0 comments on commit c44e782

Please sign in to comment.