diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md index a60c9b71..91fc385b 100644 --- a/.github/ISSUE_TEMPLATE/bug.md +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -1,11 +1,12 @@ --- name: Bug report about: Report an error that you've encountered. -labels: 'bug' +labels: bug --- + ### Environment information -* `ape` and plugin versions: +- `ape` and plugin versions: ``` $ ape --version @@ -15,16 +16,16 @@ $ ape plugins list # ...copy and paste result of above command here... ``` -* Python Version: x.x.x -* OS: osx/linux/win +- Python Version: x.x.x +- OS: osx/linux/win ### What went wrong? Please include information like: -* what command you ran -* the code that caused the failure (see [this link](https://help.github.com/articles/basic-writing-and-formatting-syntax/) for help with formatting code) -* full output of the error you received +- what command you ran +- the code that caused the failure (see [this link](https://help.github.com/articles/basic-writing-and-formatting-syntax/) for help with formatting code) +- full output of the error you received ### How can it be fixed? diff --git a/.github/ISSUE_TEMPLATE/feature.md b/.github/ISSUE_TEMPLATE/feature.md index 742ce669..1b560561 100644 --- a/.github/ISSUE_TEMPLATE/feature.md +++ b/.github/ISSUE_TEMPLATE/feature.md @@ -1,15 +1,15 @@ --- name: Feature request about: Request a new feature, or an improvement to existing functionality. -labels: 'enhancement' +labels: enhancement --- ### Overview Provide a simple overview of what you wish to see added. Please include: -* What you are trying to do -* Why Ape's current functionality is inadequate to address your goal +- What you are trying to do +- Why Ape's current functionality is inadequate to address your goal ### Specification diff --git a/.github/ISSUE_TEMPLATE/work-item.md b/.github/ISSUE_TEMPLATE/work-item.md index 3aa53f5e..a8b05242 100644 --- a/.github/ISSUE_TEMPLATE/work-item.md +++ b/.github/ISSUE_TEMPLATE/work-item.md @@ -1,41 +1,48 @@ --- name: Work item about: New work item for Ape team -labels: 'backlog' - +labels: backlog --- -### Elevator pitch: +### Elevator pitch + -### Value: +### Value + -### Dependencies: +### Dependencies + -### Design approach: +### Design approach + -### Task list: +### Task list + -* [ ] Tasks go here -### Estimated completion date: +- [ ] Tasks go here + +### Estimated completion date +### Design review -### Design review: + Do not signoff unless: -- 1) agreed the tasks and design approach will achieve acceptance, and -- 2) the work can be completed by one person within the SLA. -Design reviewers should consider simpler approaches to achieve goals. + +- 1. agreed the tasks and design approach will achieve acceptance, and +- 2. the work can be completed by one person within the SLA. + Design reviewers should consider simpler approaches to achieve goals. (Please leave a comment to sign off) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 1d93a39a..544cbc61 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,6 +1,7 @@ ### What I did + fixes: # ### How I did it diff --git a/.github/workflows/commitlint.yaml b/.github/workflows/commitlint.yaml index c274de90..142ebb94 100644 --- a/.github/workflows/commitlint.yaml +++ b/.github/workflows/commitlint.yaml @@ -9,12 +9,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.9 diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index c210c22d..20c11752 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -10,10 +10,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.9 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d547fc22..321d19e5 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -2,15 +2,22 @@ on: ["push", "pull_request"] name: Test +concurrency: + # Cancel older, in-progress jobs from the same PR, same workflow. + # use run_id if the job is triggered by a push to ensure + # push-triggered jobs to not get canceled. + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: linting: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.9 @@ -22,20 +29,23 @@ jobs: - name: Run Black run: black --check . + - name: Run isort + run: isort --check-only . + - name: Run flake8 run: flake8 . - - name: Run isort - run: isort --check-only . + - name: Run mdformat + run: mdformat . --check type-check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.9 @@ -59,10 +69,10 @@ jobs: GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/title.yaml b/.github/workflows/title.yaml index 9b546d4f..a38ab969 100644 --- a/.github/workflows/title.yaml +++ b/.github/workflows/title.yaml @@ -12,10 +12,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.9 diff --git a/.mdformat.toml b/.mdformat.toml new file mode 100644 index 00000000..01b2fb06 --- /dev/null +++ b/.mdformat.toml @@ -0,0 +1 @@ +number = true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bee797bd..e1b5c680 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,6 +26,12 @@ repos: - id: mypy additional_dependencies: [types-PyYAML, types-requests, types-setuptools] +- repo: https://github.com/executablebooks/mdformat + rev: 0.7.14 + hooks: + - id: mdformat + additional_dependencies: [mdformat-gfm, mdformat-frontmatter] + default_language_version: python: python3 diff --git a/README.md b/README.md index e3d7a91c..caaf6aa2 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Plugins for the [StarkNet Ethereum L2 networks](https://starkware.co/starknet/). ## Dependencies -* [python3](https://www.python.org/downloads) version 3.8 or greater, python3-dev +- [python3](https://www.python.org/downloads) version 3.8 or greater, python3-dev ## Installation @@ -113,7 +113,7 @@ ape starknet accounts delete --network starknet:testnet While generally bad practice, sometimes it is necessary to have unlocked keyfile accounts auto-signing messages. An example would be during testnet automated deployments. -To achieve this, use the ``set_autosign()`` method available on the keyfile accounts: +To achieve this, use the `set_autosign()` method available on the keyfile accounts: ```python import keyring @@ -224,7 +224,7 @@ contract = Contract(contract_address, contract_type=project.MyContract.contract_ ### Contract Interaction After you have deployed your contracts, you can begin interacting with them. -``deploy`` methods return a contract instance from which you can call methods on: +`deploy` methods return a contract instance from which you can call methods on: ```python from ape import project @@ -262,7 +262,7 @@ receipt = contract.store_my_list(3, [1, 2, 3]) #### Accounts -You can use ``starknet-devnet`` accounts in your tests. +You can use `starknet-devnet` accounts in your tests. ```python import pytest diff --git a/setup.py b/setup.py index c478adfb..3a074caf 100644 --- a/setup.py +++ b/setup.py @@ -18,6 +18,9 @@ "types-setuptools", # Needed due to mypy typeshed "flake8>=5.0.4", # Style linter "isort>=5.10.1", # Import sorting linter + "mdformat>=0.7.16", # Auto-formatter for markdown + "mdformat-gfm>=0.3.5", # Needed for formatting GitHub-flavored markdown + "mdformat-frontmatter>=0.4.1", # Needed for frontmatters-style headers in issue templates "types-pkg-resources>=0.1.3,<0.2", ], "release": [ # `release` GitHub Action job uses this @@ -62,12 +65,12 @@ "hexbytes", # Use same version as eth-ape "pydantic", # Use same version as eth-ape # ** ApeWorX maintained ** - "eth-ape>=0.5.1,<0.6", + "eth-ape>=0.5.9,<0.6", "ethpm-types", # Use same version as eth-ape # ** Starknet Ecosystem ** - "cairo-lang==0.10.2", - "starknet.py==0.10.2a0", - "starknet-devnet==0.4.1", + "cairo-lang>=0.10.3,<0.11", + "starknet.py>=0.12.a0,<0.13", + "starknet-devnet>=0.4.3,<0.5", ], entry_points={"ape_cli_subcommands": ["ape_starknet=ape_starknet._cli:cli"]}, python_requires=">=3.8,<3.11", diff --git a/tests/integration/test_console.py b/tests/integration/test_console.py index 23e5ae97..96a074b8 100644 --- a/tests/integration/test_console.py +++ b/tests/integration/test_console.py @@ -15,6 +15,6 @@ def test_console_accounts_object(ape_cli, console_runner, key_file_account, netw # NOTE: This console connects to Eth-Tester and makes sure we can still _read_ # starknet accounts. output = console_runner.invoke( - input=["accounts", f"accounts['{key_file_account.alias}']", "exit"] + input=["accounts", f"accounts['{key_file_account.address}']", "exit"] ) - assert key_file_account.address in output, [e.name for e in networks.ecosystems] + assert key_file_account.address in output, output