Skip to content

Commit

Permalink
revision
Browse files Browse the repository at this point in the history
  • Loading branch information
justmert committed Dec 1, 2024
1 parent 6601b94 commit 69369d7
Show file tree
Hide file tree
Showing 19 changed files with 197 additions and 251 deletions.
27 changes: 12 additions & 15 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: "CodeQL"

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]

jobs:
analyze:
Expand All @@ -15,20 +15,17 @@ jobs:
contents: read
security-events: write

strategy:
fail-fast: false

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: python
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: python

- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: Autobuild
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
30 changes: 16 additions & 14 deletions .github/workflows/commitlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,23 @@ name: Commit Message
# NOTE: Skip check on PR so as not to confuse contributors
# NOTE: Also install a PR title checker so we don't mess up merges
jobs:
check:
runs-on: ubuntu-latest
commit-msg:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install Dependencies
run: pip install commitizen
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r cz-requirement.txt
- name: Check commit history
run: cz check --rev-range $(git rev-list --all --reverse | head -1)..HEAD
- name: Check commit history
run: cz check --rev-range $(git rev-list --all --reverse | head -1)..HEAD
2 changes: 1 addition & 1 deletion .github/workflows/draft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
contents: write
steps:
# Drafts your next Release notes as Pull Requests are merged into "main"
- uses: release-drafter/release-drafter@v6
- uses: release-drafter/release-drafter@v5
with:
disable-autolabeler: true
env:
Expand Down
30 changes: 16 additions & 14 deletions .github/workflows/prtitle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,23 @@ on:
- synchronize

jobs:
check:
runs-on: ubuntu-latest
pr-title:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install Dependencies
run: pip install commitizen
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install commitizen>=2.40,<2.41
- name: Check PR Title
env:
TITLE: ${{ github.event.pull_request.title }}
run: cz check --message "$TITLE"
- name: Check PR Title
env:
TITLE: ${{ github.event.pull_request.title }}
run: cz check --message "$TITLE"
35 changes: 17 additions & 18 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,26 @@ on:

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[release]
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[release]
- name: Build
run: python setup.py sdist bdist_wheel
- name: Build
run: python setup.py sdist bdist_wheel

- name: Publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload dist/* --verbose
- name: Publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload dist/*
168 changes: 75 additions & 93 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,96 +10,78 @@ concurrency:
cancel-in-progress: true

jobs:
linting:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install .[lint]
- name: Run Black
run: black --check .

- name: Run isort
run: isort --check-only .

- name: Run flake8
run: flake8 .

- name: Run mdformat
run: mdformat . --check

type-check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install .[lint,test]
- name: Run MyPy
run: mypy .

functional:
runs-on: ${{ matrix.os }}

strategy:
matrix:
# TODO: Replace with macos-latest when works again.
# https://github.com/actions/setup-python/issues/808
os: [ubuntu-latest, macos-12] # eventually add `windows-latest`
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install .[test]
- name: Run Tests
run: pytest -m "not fuzzing" -n 0 -s --cov

# NOTE: uncomment this block after you've marked tests with @pytest.mark.fuzzing
# fuzzing:
# runs-on: ubuntu-latest
#
# strategy:
# fail-fast: true
#
# steps:
# - uses: actions/checkout@v4
#
# - name: Setup Python
# uses: actions/setup-python@v5
# with:
# python-version: "3.10"
#
# - name: Install Dependencies
# run: pip install .[test]
#
# - name: Run Tests
# run: pytest -m "fuzzing" --no-cov -s
linting:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install .[lint]
- name: Run Black
run: black --check .

- name: Run isort
run: isort --check-only .

- name: Run flake8
run: flake8 .

- name: Run mdformat
run: mdformat . --check

type-check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install .[lint,test]
- name: Run MyPy
run: mypy .

test:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, macos-latesst]
python-version: ["3.9", "3.10", "3.11", "3.12"]

env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install .[test]
- name: Run Tests
run: pytest -m "not fuzzing" -n 0 -s --cov
23 changes: 0 additions & 23 deletions ape-config.yaml

This file was deleted.

3 changes: 1 addition & 2 deletions ape_starknet/accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
MAX_FEE,
OPENZEPPELIN_ACCOUNTS,
)
from ape_starknet.provider import StarknetDevnetProvider, StarknetProvider
from ape_starknet.provider import StarknetDevnetProvider
from ape_starknet.transactions import (
BaseTransactionT,
DepreciatedTxs,
Expand Down Expand Up @@ -1077,7 +1077,6 @@ def sign_message(self, msg: StarknetSignableMessage) -> Optional[ECSignature]:
def deployments(self) -> List[StarknetAccountDeployment]:
deployments = self.account_data.get("deployments", [])

# Add salt if missing (migration)
for deployment in deployments:
if "salt" not in deployment and to_int(deployment["contract_address"]) == to_int(self.default_address):
deployment["salt"] = self.salt
Expand Down
Loading

0 comments on commit 69369d7

Please sign in to comment.