Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/vyperlang/vyper into fix/…
Browse files Browse the repository at this point in the history
…extcall_range
  • Loading branch information
tserg committed Oct 11, 2024
2 parents 2772e37 + 4845fd4 commit 4dfd983
Show file tree
Hide file tree
Showing 330 changed files with 17,413 additions and 7,057 deletions.
35 changes: 0 additions & 35 deletions .github/workflows/publish.yml

This file was deleted.

58 changes: 58 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# jobs to validate pull request well-formedness

name: Validate PR metadata

on:
pull_request:
types:
- opened
- edited
- synchronize

permissions:
pull-requests: read

jobs:
validate-pr:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
name: Run conventional commit checker
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# https://github.com/amannn/action-semantic-pull-request?tab=readme-ov-file#configuration
with:
types: |
feat
perf
fix
chore
refactor
# ci: continuous integration
# docs: documentation
# test: test suite
# lang: language changes
# ux: language changes (UX)
# tool: integration
# ir: (old) IR/codegen changes
# codegen: lowering from vyper AST to codegen
# venom: venom changes
scopes: |
ci
build
docs
test
lang
ux
tool
ir
codegen
venom
requireScope: true
subjectPattern: '^(?![A-Z]).+$'
subjectPatternError: |
Starts with uppercase letter: '{subject}'
(Full PR title: '{title}')
# type[scope]<optional !>: subject
# use [] instead of () for aesthetics
headerPattern: '^(\w*)(?:\[([\w$.\-*/ ]*)\])?!?: (.*)$'
38 changes: 38 additions & 0 deletions .github/workflows/release-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# upload to pypi using the pypa publish action
# https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Publish to PyPI

on:
release:
types: [published] # releases and pre-releases (release candidates)

jobs:
publish-pypi:
runs-on: ubuntu-latest

# https://docs.pypi.org/trusted-publishers/using-a-publisher/
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
# Specifying a GitHub environment is optional, but strongly encouraged
environment: release

steps:
- uses: actions/checkout@v4

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build
run: python setup.py sdist bdist_wheel

- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
113 changes: 61 additions & 52 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,69 +62,75 @@ jobs:

# "Regular"/core tests.
tests:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os || 'ubuntu' }}-latest
# IMPORTANT: Test defaults are duplicated in the "Run tests" step below!
# it is annoying that we need to duplicate them, but it is necessary
# to avoid repeating defaults for every "include" in the matrix.
name: "${{ matrix.os && matrix.os != 'ubuntu' && format('{0}-', matrix.os) || '' }}\
py${{ matrix.python-version[1] || '311' }}\
-opt-${{ matrix.opt-mode || 'gas' }}\
${{ matrix.debug && '-debug' || '' }}\
${{ matrix.experimental-codegen && '-experimental' || '' }}\
-${{ matrix.evm-version || 'cancun' }}\
-${{ matrix.evm-backend || 'revm' }}"
strategy:
matrix:
python-version: [["3.11", "311"]]
opt-mode: ["gas", "none", "codesize"]
evm-version: [shanghai]
# declare all variables used in the "include" section here! Conflicting jobs get overwritten by GitHub actions.
os: [ubuntu]
python-version: [["3.11", "311"]] # note: do not forget to replace 311 in the job names when upgrading!
opt-mode: [gas, none, codesize]
debug: [true, false]
memorymock: [false]
evm-version: [cancun] # note: when upgrading, check the "include" section below for conflicting jobs
experimental-codegen: [false]
evm-backend: [revm]

# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#expanding-or-adding-matrix-configurations
include:
# test default settings with 3.11 across all supported evm versions
- python-version: ["3.11", "311"]
debug: false
opt-mode: gas
evm-version: london
- python-version: ["3.11", "311"]
debug: false
opt-mode: gas
evm-version: paris

# redundant rule, for clarity
- python-version: ["3.11", "311"]
debug: false
opt-mode: gas
- evm-version: london
- evm-version: paris
- evm-version: shanghai

# test pre-cancun with opt-codesize and opt-none
- evm-version: shanghai
opt-mode: none
- evm-version: shanghai
opt-mode: codesize

# test py-evm
- evm-backend: py-evm
evm-version: shanghai

- python-version: ["3.11", "311"]
debug: false
opt-mode: gas
- evm-backend: py-evm
evm-version: cancun

# run with `--memorymock`, but only need to do it one configuration
# TODO: consider removing the memorymock tests
- python-version: ["3.11", "311"]
# test experimental pipeline
- experimental-codegen: true
opt-mode: gas
debug: false
evm-version: shanghai
memorymock: true
- experimental-codegen: true
opt-mode: none
- experimental-codegen: true
opt-mode: codesize

# run across other python versions. we don't really need to run all
# modes across all python versions - one is enough
- python-version: ["3.10", "310"]
opt-mode: gas
debug: false
evm-version: shanghai
- python-version: ["3.12", "312"]
opt-mode: gas
debug: false
evm-version: shanghai

name: py${{ matrix.python-version[1] }}-opt-${{ matrix.opt-mode }}${{ matrix.debug && '-debug' || '' }}${{ matrix.memorymock && '-memorymock' || '' }}-${{ matrix.evm-version }}
# os-specific rules
- os: windows
- os: macos

steps:
- uses: actions/checkout@v4
with:
# need to fetch unshallow so that setuptools_scm can infer the version
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version[0] }}
- name: Set up Python ${{ matrix.python-version[0] || '3.11' }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version[0] }}
python-version: ${{ matrix.python-version[0] || '3.11' }}
cache: "pip"

- name: Install dependencies
Expand All @@ -134,30 +140,31 @@ jobs:
run: pip freeze

- name: Run tests
run: |
pytest \
--dist worksteal \
-m "not fuzzing" \
--optimize ${{ matrix.opt-mode }} \
--evm-version ${{ matrix.evm-version }} \
${{ matrix.debug && '--enable-compiler-debug-mode' || '' }} \
${{ matrix.memorymock && '--memorymock' || '' }} \
--showlocals -r aR \
tests/
run: >
pytest
-m "not fuzzing"
--optimize ${{ matrix.opt-mode || 'gas' }}
--evm-version ${{ matrix.evm-version || 'cancun' }}
--evm-backend ${{ matrix.evm-backend || 'revm' }}
${{ matrix.debug && '--enable-compiler-debug-mode' || '' }}
${{ matrix.experimental-codegen && '--experimental-codegen' || '' }}
--cov-branch
--cov-report xml:coverage.xml
--cov=vyper
tests/
- name: Upload Coverage
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml


core-tests-success:
if: always()
# summary result from test matrix.
# see https://github.community/t/status-check-for-a-matrix-jobs/127354/7
runs-on: ubuntu-latest
needs: tests
needs: [tests]
steps:
- name: Check tests tests all succeeded
if: ${{ needs.tests.result != 'success' }}
Expand Down Expand Up @@ -201,11 +208,13 @@ jobs:
--splits 120 \
--group ${{ matrix.group }} \
--splitting-algorithm least_duration \
--dist worksteal \
-r aR tests/
--cov-branch \
--cov-report xml:coverage.xml \
--cov=vyper \
tests/
- name: Upload Coverage
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ vyper/vyper_git_commithash.txt
*.spec

# mac
.DS_Store
.DS_Store
10 changes: 10 additions & 0 deletions FUNDING.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"drips": {
"ethereum": {
"ownedBy": "0x70CCBE10F980d80b7eBaab7D2E3A73e87D67B775"
}
},
"opRetro": {
"projectId": "0x9ca1f7b0e0d10d3bd2619e51a54f2e4175e029c87a2944cf1ebc89164ba77ea0"
}
}
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,18 @@ test:
lint: mypy black flake8 isort

mypy:
mypy --install-types --non-interactive --follow-imports=silent --ignore-missing-imports --implicit-optional -p vyper
mypy \
--disable-error-code "annotation-unchecked" \
--follow-imports=silent \
--ignore-missing-imports \
--implicit-optional \
-p vyper

black:
black -C -t py311 vyper/ tests/ setup.py --force-exclude=vyper/version.py

flake8: black
flake8 vyper/ tests/
flake8 --enable-extensions=FS003 vyper/ tests/

isort: black
isort vyper/ tests/ setup.py
Expand Down
Loading

0 comments on commit 4dfd983

Please sign in to comment.