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

Add support for Python 3.12 #1272

Merged
merged 50 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
047b0c2
Bump the dev-dependencies group with 13 updates
dependabot[bot] Jan 11, 2024
64a2940
Merge branch 'development' into dependabot/pip/dev-dependencies-79788…
tkumor3 Jan 19, 2024
fce1523
Merge branch 'development' into dependabot/pip/dev-dependencies-79788…
tkumor3 Jan 23, 2024
5907b65
revert pytest-asyncio to ^0.21.1 beacause of changes in the context …
tkumor3 Jan 23, 2024
432ccdb
update hash
tkumor3 Jan 23, 2024
5a2e1ab
fix lint
tkumor3 Jan 23, 2024
26808d4
fix linter
tkumor3 Jan 24, 2024
a6d542e
Add issue id to TODO
tkumor3 Jan 24, 2024
a8dc9ea
fix imports
tkumor3 Jan 24, 2024
968df99
format
tkumor3 Jan 24, 2024
9f02e73
downgrade pyright version
tkumor3 Jan 24, 2024
04b659a
Merge branch 'development' into dependabot/pip/dev-dependencies-79788…
tkumor3 Jan 24, 2024
44f34d1
Update pyproject.toml
tkumor3 Jan 24, 2024
6e0dbb1
fix
tkumor3 Jan 24, 2024
3ac813c
Add support for python 3.12*
tkumor3 Feb 1, 2024
6e22efc
Merge branch 'development' into dependabot/pip/dev-dependencies-79788…
tkumor3 Feb 1, 2024
64b4fb1
Merge branch 'dependabot/pip/dev-dependencies-79788bbfd5' into tomasz…
tkumor3 Feb 1, 2024
071903d
adds to many arguments
tkumor3 Feb 1, 2024
f2167ce
Merge branch 'dependabot/pip/dev-dependencies-79788bbfd5' into tomasz…
tkumor3 Feb 1, 2024
c55b3b2
remove v3.8 python
tkumor3 Feb 1, 2024
7a9b3ca
fix
tkumor3 Feb 1, 2024
d41b507
revert version 3.8
tkumor3 Feb 1, 2024
e39ca94
Merge branch 'development' into tomaszkumor/python-3.12-support
tkumor3 Feb 1, 2024
953a4c0
linter
tkumor3 Feb 1, 2024
f92198c
test
tkumor3 Feb 1, 2024
a0bafb6
test
tkumor3 Feb 1, 2024
95a1e9e
test
tkumor3 Feb 1, 2024
052e913
use python 3.11 to build
tkumor3 Feb 1, 2024
5711bf5
fix
tkumor3 Feb 1, 2024
930221a
update
tkumor3 Feb 1, 2024
29d7c64
try version 3.12
tkumor3 Feb 1, 2024
65f5026
test
tkumor3 Feb 2, 2024
f7c1365
Merge branch 'development' into tomaszkumor/python-3.12-support
tkumor3 Feb 5, 2024
9770e91
Merge branch 'development' into tomaszkumor/python-3.12-support
tkumor3 Feb 5, 2024
2aa8c69
Merge branch 'development' into tomaszkumor/python-3.12-support
tkumor3 Feb 7, 2024
7c4232b
update pyproject
tkumor3 Feb 7, 2024
8a5a568
fix
tkumor3 Feb 7, 2024
3037c25
feedback
tkumor3 Feb 7, 2024
66753cb
remove --without py312-dev
tkumor3 Feb 8, 2024
47dba76
update
tkumor3 Feb 8, 2024
d7437a4
test
tkumor3 Feb 8, 2024
3c5f64f
simplyfy install cairo-lang
tkumor3 Feb 8, 2024
4d28dd6
remove cairo-lang from deps
tkumor3 Feb 8, 2024
4252ad6
feedback
tkumor3 Feb 8, 2024
ffb540f
remove istall cairo-lang
tkumor3 Feb 8, 2024
b175700
Update docs/development.rst
tkumor3 Feb 9, 2024
ccfaa88
Update .github/workflows/checks.yml
tkumor3 Feb 9, 2024
c17bc1b
feedback
tkumor3 Feb 9, 2024
a97d06a
clean up
tkumor3 Feb 9, 2024
2c85691
clean up code
tkumor3 Feb 9, 2024
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
78 changes: 37 additions & 41 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,9 @@ jobs:
pip install poetry
poetry config installer.modern-installation false

- name: Install python 3.9 requirements
- name: Install python 3.12 requirements
tkumor3 marked this conversation as resolved.
Show resolved Hide resolved
run: |
poetry export -f requirements.txt --only=py39-dev --without-hashes --output requirements.txt
pip install -r requirements.txt
pip install cairo-lang==0.13.0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
Expand All @@ -98,9 +97,12 @@ jobs:

- name: Install dependencies
run: |
poetry install --without py39-dev
poetry install

# ====================== CONTRACTS v0 ====================== #
- name: Install setuptools
run: |
pip install --upgrade setuptools
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the rationale behind this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python 3.12 doesn't install it in the default

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use 3.11 for the setup and then omit this action?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that was the first solution! We decided with @THenry14 to use 3.12 everywhere where possible.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess if we use 3.11 here we can also get rid of setuptools from pyproject.toml, is that correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can check it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it works


- name: Cache contracts
id: cache-contracts
Expand All @@ -110,7 +112,6 @@ jobs:
key: ${{ runner.os }}-contracts-${{ hashFiles('starknet_py/tests/e2e/mock/contracts', 'poetry.lock') }}

- name: Compile contracts
if: steps.cache-contracts.outputs.cache-hit != 'true'
tkumor3 marked this conversation as resolved.
Show resolved Hide resolved
run: |
poetry run poe compile_contracts

Expand All @@ -131,7 +132,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" ]
tkumor3 marked this conversation as resolved.
Show resolved Hide resolved
steps:
- uses: actions/checkout@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
Expand All @@ -145,7 +146,7 @@ jobs:

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

# ====================== SETUP PYTHON ====================== #
Expand All @@ -156,10 +157,9 @@ jobs:
pip install poetry
poetry config installer.modern-installation false

- name: Install python 3.9 requirements
- name: Install python 3.12 requirements
run: |
poetry export -f requirements.txt --only=py39-dev --without-hashes --output requirements.txt
pip install -r requirements.txt
pip install cairo-lang==0.13.0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
Expand All @@ -169,7 +169,7 @@ jobs:

- name: Install dependencies
run: |
poetry install --without py39-dev
poetry install

# ====================== SETUP DEVNET ====================== #

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

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

# ====================== SETUP PYTHON ====================== #
Expand All @@ -238,20 +238,19 @@ jobs:
pip install poetry
poetry config installer.modern-installation false

- name: Install python 3.9 requirements
- name: Install python 3.12 requirements
run: |
poetry export -f requirements.txt --only=py39-dev --without-hashes --output requirements.txt
pip install -r requirements.txt
pip install cairo-lang==0.13.0
tkumor3 marked this conversation as resolved.
Show resolved Hide resolved

- 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 +281,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" ]
tkumor3 marked this conversation as resolved.
Show resolved Hide resolved
steps:
- uses: actions/checkout@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
Expand All @@ -296,7 +295,7 @@ jobs:

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

# ====================== SETUP DEVNET ====================== #
Expand All @@ -312,10 +311,9 @@ jobs:
pip install poetry
poetry config installer.modern-installation false

- name: Install python 3.9 requirements
- name: Install python 3.12 requirements
run: |
poetry export -f requirements.txt --only=py39-dev --without-hashes --output requirements.txt
pip install -r requirements.txt
pip install cairo-lang==0.13.0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
Expand All @@ -325,7 +323,7 @@ jobs:

- name: Install dependencies
run: |
poetry install --without py39-dev
poetry install

# ====================== RUN TESTS ====================== #

Expand Down Expand Up @@ -356,7 +354,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 +368,7 @@ jobs:

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

# ====================== SETUP PYTHON ====================== #
Expand All @@ -381,10 +379,9 @@ jobs:
pip install poetry
poetry config installer.modern-installation false

- name: Install python 3.9 requirements
- name: Install python 3.12 requirements
run: |
poetry export -f requirements.txt --only=py39-dev --without-hashes --output requirements.txt
pip install -r requirements.txt
pip install cairo-lang==0.13.0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
Expand All @@ -394,7 +391,7 @@ jobs:

- name: Install dependencies
run: |
poetry install --without py39-dev
poetry install

# ====================== SETUP DEVNET ====================== #

Expand Down Expand Up @@ -430,7 +427,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 +441,7 @@ jobs:

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

# ====================== SETUP PYTHON ====================== #
Expand All @@ -455,10 +452,9 @@ jobs:
pip install poetry
poetry config installer.modern-installation false

- name: Install python 3.9 requirements
- name: Install python 3.12 requirements
run: |
poetry export -f requirements.txt --only=py39-dev --without-hashes --output requirements.txt
pip install -r requirements.txt
pip install cairo-lang==0.13.0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
Expand All @@ -468,7 +464,7 @@ jobs:

- name: Install dependencies
run: |
poetry install --without py39-dev
poetry install

# ====================== SETUP DEVNET ====================== #

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manual_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ on:
type: choice
description: 'Python version'
options:
- '3.8'
tkumor3 marked this conversation as resolved.
Show resolved Hide resolved
- '3.9'
- '3.10'
- '3.11'
- '3.12'

jobs:
setup:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: '3.12'
tkumor3 marked this conversation as resolved.
Show resolved Hide resolved

- name: Install poetry
run: python -X utf8 -m pip install poetry
Expand Down
2 changes: 1 addition & 1 deletion docs/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,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``.
Make sure running ``poetry run python --version`` returns ``Python 3.12.x``.
ddoktorski marked this conversation as resolved.
Show resolved Hide resolved

Setup
-----
Expand Down
Loading
Loading