From c6e273b52e8e43000f17d4684dae24cf9c3205ba Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Tue, 10 Sep 2024 18:30:49 +0200 Subject: [PATCH] chore: upgrade dependencies (#22) update dependencies and python versions for tests --- .github/workflows/main.yaml | 93 +++++++----------------------------- .gitignore | 3 ++ CHANGELOG.md | 1 + README.md | 2 +- pyproject.toml | 2 +- requirements-dev.txt | 23 ++++----- setup.py | 4 +- tests/conftest.py | 6 ++- tests/test_compile_source.py | 9 +++- tox.ini | 8 ++-- 10 files changed, 51 insertions(+), 100 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index d4624c0..48f172b 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -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 diff --git a/.gitignore b/.gitignore index b6e4761..bd6ad26 100644 --- a/.gitignore +++ b/.gitignore @@ -127,3 +127,6 @@ dmypy.json # Pyre type checker .pyre/ + +# PyCharm +.idea/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c0650f..5e1fb8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)) ## [0.1.0](https://github.com/vyperlang/vvm/tree/v0.1.0) - 2020-10-07 ### Added diff --git a/README.md b/README.md index 936b11a..acf7e82 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/pyproject.toml b/pyproject.toml index e4603ae..6bd8c60 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.black] line-length = 100 -target-version = ['py36', 'py37', 'py38'] +target-version = ['py38', 'py39', 'py310', 'py311', 'py312'] include = '\.pyi?$' exclude = ''' /( diff --git a/requirements-dev.txt b/requirements-dev.txt index 2ee9944..dab7795 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -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 \ No newline at end of file diff --git a/setup.py b/setup.py index c8bb10a..fca6a1d 100644 --- a/setup.py +++ b/setup.py @@ -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", diff --git a/tests/conftest.py b/tests/conftest.py index 098eec0..0e39069 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,8 +1,8 @@ #!/usr/bin/python3 import pytest -from requests import ConnectionError from packaging.version import Version +from requests import ConnectionError import vvm @@ -67,8 +67,10 @@ def all_versions(request): @pytest.fixture def foo_source(all_versions): visibility = "external" if all_versions >= Version("0.2.0") else "public" + interface = "IERC20" if all_versions >= Version("0.4.0a") else "ERC20" + import_path = "ethereum.ercs" if all_versions >= Version("0.4.0a") else "vyper.interfaces" yield f""" -from vyper.interfaces import ERC20 +from {import_path} import {interface} @{visibility} def foo() -> int128: diff --git a/tests/test_compile_source.py b/tests/test_compile_source.py index c8f0cb5..ff7f400 100644 --- a/tests/test_compile_source.py +++ b/tests/test_compile_source.py @@ -1,14 +1,19 @@ import pytest +from packaging.version import Version import vvm -def test_compile_source(foo_source): +def test_compile_source(foo_source, all_versions): + if Version("0.4.0b1") <= all_versions <= 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 "" in output -def test_compile_files(foo_path): +def test_compile_files(foo_path, all_versions): + if Version("0.4.0b1") <= all_versions <= 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 diff --git a/tox.ini b/tox.ini index 914ba79..5960bc5 100644 --- a/tox.ini +++ b/tox.ini @@ -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