Skip to content

Commit

Permalink
Merge branch 'master' of github.com:vyperlang/vvm
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSchiavini committed Sep 11, 2024
2 parents 61f3d97 + c6e273b commit cced970
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 103 deletions.
93 changes: 16 additions & 77 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,98 +28,37 @@ jobs:
- name: Run Tox
run: tox -e lint

py36:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Setup Python 3.6
uses: actions/setup-python@v2
with:
python-version: 3.6

- name: Install Tox
run: pip install tox wheel

- name: Run Tox
run: tox -e py36

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
fail_ci_if_error: true

py37:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Setup Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Install Tox
run: pip install tox wheel

- name: Run Tox
run: tox -e py37

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
fail_ci_if_error: true

py38:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Setup Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install Tox
run: pip install tox wheel

- name: Run Tox
run: tox -e py38

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
fail_ci_if_error: true

py39:
runs-on: ${{ matrix.os }}
test:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
os: [ubuntu-latest]
python-version: [["3.8", "38"], ["3.9", "39"], ["3.10", "310"], ["3.11", "311"], ["3.12", "312"]]
include:
- os: macos-latest
python-version: ["3.11", "311"]
- os: windows-latest
python-version: ["3.11", "311"]

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

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

- name: Setup Python 3.9
- name: Setup Python ${{ matrix.python-version[0] }}
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: ${{ matrix.python-version[0] }}

- name: Install Tox
run: pip install tox wheel

- name: Run Tox
run: tox -e py39
run: tox -e py${{ matrix.python-version[1] }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
fail_ci_if_error: true
# for now not failing, this may be reverted once we set it up properly
fail_ci_if_error: false
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased](https://github.com/vyperlang/vvm/)
### Changed
- Update contact information in `CONTRIBUTING.md`
- Update dependencies. Minimum python version is now 3.8 ([#22](https://github.com/vyperlang/vvm/pull/22))
- Add `output_format` argument to `compile_source` and `compile_files` ([#21](https://github.com/vyperlang/vvm/pull/21))

## [0.1.0](https://github.com/vyperlang/vvm/tree/v0.1.0) - 2020-10-07
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vvm

[![Pypi Status](https://img.shields.io/pypi/v/vvm.svg)](https://pypi.org/project/vvm/) [![Build Status](https://img.shields.io/github/workflow/status/vyperlang/vvm/vvm%20workflow)](https://github.com/vyperlang/vvm/actions) [![Coverage Status](https://img.shields.io/codecov/c/github/vyperlang/vvm)](https://codecov.io/gh/vyperlang/vvm)
[![Pypi Status](https://img.shields.io/pypi/v/vvm.svg)](https://pypi.org/project/vvm/) [![Build Status](https://img.shields.io/github/actions/workflow/status/vyperlang/vvm/main.yaml?branch=master)](https://github.com/vyperlang/vvm/actions) [![Coverage Status](https://img.shields.io/codecov/c/github/vyperlang/vvm)](https://codecov.io/gh/vyperlang/vvm)

Vyper version management tool.

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.black]
line-length = 100
target-version = ['py36', 'py37', 'py38']
target-version = ['py38', 'py39', 'py310', 'py311', 'py312']
include = '\.pyi?$'
exclude = '''
/(
Expand Down
23 changes: 12 additions & 11 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
black==24.4.2
bumpversion==0.5.3
flake8==3.8.3
isort==4.3.21
mypy==0.982
pytest>6.0.0,<7.0.0
pytest-cov==2.10.1
tox==3.18.0
tqdm>=4.41.0,<5.0.0
twine>=4.0.2,<5.0.0
wheel>=0.35.1
black==24.8.0
bumpversion>=0.6.0,<1.0.0
flake8>=7.1.1,<8.0.0
isort>=5.13.2,<6.0.0
mypy>=1.11.2,<2.0.0
pytest>=8.3.2,<9.0.0
pytest-cov>=5.0.0,<6.0.0
tox>=4.18.0,<5.0.0
tqdm>=4.66.5,<5.0.0
twine>=5.1.1,<6.0.0
wheel>=0.44.0,<1.0.0
types-requests>2.32.0,<3.0.0
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
url="https://github.com/vyperlang/vvm",
include_package_data=True,
py_modules=["vvm"],
python_requires=">=3.6, <4",
install_requires=["requests>=2.19.0,<3", "packaging>=23.1,<24"],
python_requires=">=3.8, <4",
install_requires=["requests>=2.32.3,<3", "packaging>=24.1,<25"],
license="MIT",
zip_safe=False,
keywords="ethereum vyper",
Expand Down
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ def foo_source(vyper_version):
visibility = "external" if vyper_version >= Version("0.2.0") else "public"
interface = "IERC20" if vyper_version >= Version("0.4.0a") else "ERC20"
import_path = "ethereum.ercs" if vyper_version >= Version("0.4.0a") else "vyper.interfaces"
pragma_version = "pragma version" if vyper_version >= Version("0.3.10") else "@version"
pragma_version = "pragma version" if vyper_version >= Version("0.3.8") else "@version"
yield f"""
#{pragma_version} ^{vyper_version}
#{pragma_version} {vyper_version}
from {import_path} import {interface}
@{visibility}
Expand All @@ -82,7 +82,7 @@ def foo() -> int128:

@pytest.fixture
def foo_path(tmp_path_factory, foo_source, vyper_version):
source = tmp_path_factory.getbasetemp().joinpath(f"Foo-{vyper_version}.sol")
source = tmp_path_factory.getbasetemp().joinpath(f"Foo-{vyper_version}.vy")
if not source.exists():
with source.open("w") as fp:
fp.write(foo_source)
Expand Down
12 changes: 8 additions & 4 deletions tests/test_compile_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@
import vvm


def test_compile_source(foo_source):
def test_compile_source(foo_source, vyper_version):
if Version("0.4.0b1") <= vyper_version <= Version("0.4.0b5"):
pytest.skip("vyper 0.4.0b1 to 0.4.0b5 have a bug with combined_json")
output = vvm.compile_source(foo_source)
assert "<stdin>" in output


def test_compile_files(foo_path):
def test_compile_files(foo_path, vyper_version):
if Version("0.4.0b1") <= vyper_version <= Version("0.4.0b5"):
pytest.skip("vyper 0.4.0b1 to 0.4.0b5 have a bug with combined_json")
output = vvm.compile_files([foo_path])
assert foo_path.as_posix() in output

Expand All @@ -35,13 +39,13 @@ def foo() -> int128:

def test_compile_metadata(foo_source, vyper_version):
if vyper_version <= Version("0.3.1"):
raise pytest.skip("metadata output not supported in vyper < 0.3.2")
pytest.skip("metadata output not supported in vyper < 0.3.2")
output = vvm.compile_source(foo_source, output_format="metadata")
assert "function_info" in output


def test_compile_metadata_from_file(foo_path, vyper_version):
if vyper_version <= Version("0.3.1"):
raise pytest.skip("metadata output not supported in vyper < 0.3.2")
pytest.skip("metadata output not supported in vyper < 0.3.2")
output = vvm.compile_files([foo_path], output_format="metadata")
assert "function_info" in output
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[tox]
envlist =
lint
py{36,37,38,39}
py{38,39,310,311,312}

[testenv]
passenv =
GITHUB_TOKEN
deps = -r{toxinidir}/requirements-dev.txt
commands =
py{36,37,38,39}: python -m pytest tests/
py{38,39,310,311,312}: python -m pytest tests/

[testenv:lint]
extras=linter
commands =
black --check {toxinidir}/vvm {toxinidir}/tests
flake8 {toxinidir}/vvm {toxinidir}/tests
isort --check-only --diff --recursive {toxinidir}/vvm {toxinidir}/tests
mypy --disallow-untyped-defs {toxinidir}/vvm
isort --check-only --diff {toxinidir}/vvm {toxinidir}/tests
mypy --disallow-untyped-defs {toxinidir}/vvm --implicit-optional

0 comments on commit cced970

Please sign in to comment.