Skip to content

Commit

Permalink
Merge branch 'master' into chore/relax_integrator
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Sep 19, 2023
2 parents be8d7ef + 823675a commit 08813b0
Show file tree
Hide file tree
Showing 20 changed files with 646 additions and 194 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and release artifacts
name: Build artifacts

on:
workflow_dispatch:
Expand All @@ -8,8 +8,9 @@ on:
push:
branches:
- master
pull_request:
release:
types: [released]
types: [published] # releases and pre-releases (release candidates)

defaults:
run:
Expand Down Expand Up @@ -38,10 +39,11 @@ jobs:

- name: Generate Binary
run: >-
pip install --no-binary pycryptodome . &&
pip install --no-binary pycryptodome --no-binary cbor2 . &&
pip install pyinstaller &&
make freeze
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -98,6 +100,16 @@ jobs:
-X POST \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"\
-H "Content-Type: application/octet-stream" \
"https://uploads.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}/assets?name=${BIN_NAME}" \
"https://uploads.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}/assets?name=${BIN_NAME/+/%2B}" \
--data-binary "@${BIN_NAME}"
done
# check build success for pull requests
build-success:
if: always()
runs-on: ubuntu-latest
needs: [windows-build, unix-build]
steps:
- name: check that all builds succeeded
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Publish to PyPI

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

jobs:

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
**Vyper compiler security audit competition starts 14th September with $150k worth of bounties.** [See the competition on CodeHawks](https://www.codehawks.com/contests/cll5rujmw0001js08menkj7hc) and find [more details in this blog post](https://mirror.xyz/0xBA41A04A14aeaEec79e2D694B21ba5Ab610982f1/WTZ3l3MLhTz9P4avq6JqipN5d4HJNiUY-d8zT0pfmXg).

<img src="https://raw.githubusercontent.com/vyperlang/vyper/master/logo/vyper-logo-transparent.svg?sanitize=true" alt="" width="110">

Expand Down
2 changes: 1 addition & 1 deletion docs/structure-of-a-contract.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Vyper supports several source code directives to control compiler modes and help
Version Pragma
--------------

The version pragma ensures that a contract is only compiled by the intended compiler version, or range of versions. Version strings use `NPM <https://docs.npmjs.com/about-semantic-versioning>`_ style syntax.
The version pragma ensures that a contract is only compiled by the intended compiler version, or range of versions. Version strings use `NPM <https://docs.npmjs.com/about-semantic-versioning>`_ style syntax. Starting from v0.4.0 and up, version strings will use `PEP440 version specifiers <https://peps.python.org/pep-0440/#version-specifiers>_`.

As of 0.3.10, the recommended way to specify the version pragma is as follows:

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def _global_version(version):
"cbor2>=5.4.6,<6",
"asttokens>=2.0.5,<3",
"pycryptodome>=3.5.1,<4",
"semantic-version>=2.10,<3",
"packaging>=23.1,<24",
"importlib-metadata",
"wheel",
],
Expand Down
32 changes: 7 additions & 25 deletions tests/ast/test_pre_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,9 @@ def set_version(version):
"0.1.1",
">0.0.1",
"^0.1.0",
"<=1.0.0 >=0.1.0",
"0.1.0 - 1.0.0",
"~0.1.0",
"0.1",
"0",
"*",
"x",
"0.x",
"0.1.x",
"0.2.0 || 0.1.1",
"<=1.0.0,>=0.1.0",
# "0.1.0 - 1.0.0",
"~=0.1.0",
]
invalid_versions = [
"0.1.0",
Expand All @@ -44,7 +37,6 @@ def set_version(version):
"1.x",
"0.2.x",
"0.2.0 || 0.1.3",
"==0.1.1",
"abc",
]

Expand All @@ -70,29 +62,19 @@ def test_invalid_version_pragma(file_version, mock_version):
"<0.1.1-rc.1",
">0.1.1a1",
">0.1.1-alpha.1",
"0.1.1a9 - 0.1.1-rc.10",
">=0.1.1a9,<=0.1.1-rc.10",
"<0.1.1b8",
"<0.1.1rc1",
"<0.2.0",
]
prerelease_invalid_versions = [
">0.1.1-beta.9",
">0.1.1b9",
"0.1.1b8",
"0.1.1rc2",
"0.1.1-rc.9 - 0.1.1-rc.10",
"<0.2.0",
pytest.param(
"<0.1.1b1",
marks=pytest.mark.xfail(
reason="https://github.com/rbarrois/python-semanticversion/issues/100"
),
),
pytest.param(
"<0.1.1a9",
marks=pytest.mark.xfail(
reason="https://github.com/rbarrois/python-semanticversion/issues/100"
),
),
"<0.1.1b1",
"<0.1.1a9",
]


Expand Down
23 changes: 20 additions & 3 deletions tests/parser/exceptions/test_structure_exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,26 @@ def double_nonreentrant():
""",
"""
@external
@nonreentrant("B")
@nonreentrant("C")
def double_nonreentrant():
@nonreentrant(" ")
def invalid_nonreentrant_key():
pass
""",
"""
@external
@nonreentrant("")
def invalid_nonreentrant_key():
pass
""",
"""
@external
@nonreentrant("123")
def invalid_nonreentrant_key():
pass
""",
"""
@external
@nonreentrant("!123abcd")
def invalid_nonreentrant_key():
pass
""",
"""
Expand Down
4 changes: 2 additions & 2 deletions tests/parser/features/decorators/test_nonreentrant.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def set_callback(c: address):
@external
@payable
@nonreentrant('default')
@nonreentrant("lock")
def protected_function(val: String[100], do_callback: bool) -> uint256:
self.special_value = val
_amount: uint256 = msg.value
Expand All @@ -166,7 +166,7 @@ def unprotected_function(val: String[100], do_callback: bool):
@external
@payable
@nonreentrant('default')
@nonreentrant("lock")
def __default__():
pass
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/parser/test_call_graph_stability.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from hypothesis import given, settings

import vyper.ast as vy_ast
from vyper.ast.identifiers import RESERVED_KEYWORDS
from vyper.compiler.phases import CompilerData
from vyper.semantics.namespace import RESERVED_KEYWORDS


def _valid_identifier(attr):
Expand Down
Loading

0 comments on commit 08813b0

Please sign in to comment.