Skip to content

Commit

Permalink
v0.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
benber86 committed Aug 24, 2024
1 parent 49c3458 commit 2490301
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 26 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ repos:
rev: 23.1.0
hooks:
- id: black
language_version: python3.10
language_version: python3.11
args: [ --line-length=79 ]

- repo: https://github.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
language_version: python3.10
language_version: python3.11
args: [ --max-line-length=79 ]
stages: [ commit, push ]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.971
hooks:
- id: mypy
language_version: python3.10
language_version: python3.11
additional_dependencies: ['types-requests']
stages: [ commit, push ]
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ensure_newline_before_comments = true

[tool.black]
line-length = 79
target-version = ['py39', 'py310', 'py311', 'py312']
target-version = ['py39', 'py310', 'py311']
include = '\.pyi?$'
exclude = '''
(
Expand Down Expand Up @@ -38,7 +38,7 @@ build-backend = "setuptools.build_meta"

[tool.poetry]
name = "mamushi"
version = "0.0.2-b0"
version = "0.0.3"
description = "Vyper Formatter"
authors = ["benny <benoitb@tutanota.de>"]

Expand All @@ -58,4 +58,4 @@ coverage = ">=6.5.0"
bump2version = ">=1.0.0"

[tool.poetry.scripts]
mamushi = "mamushi.__main__:main"
mamushi = "mamushi.__main__:main"
22 changes: 11 additions & 11 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[bumpversion]
current_version = 0.0.2-b0
current_version = 0.0.3
commit = False
tag = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<build>\d+))?
serialize =
serialize =
{major}.{minor}.{patch}-{release}{build}
{major}.{minor}.{patch}

[options]
package_dir =
package_dir =
= src
packages = find:
python_requires = >= 3.9
install_requires =
install_requires =
click>=8.0.0
pathspec>=0.9.0
lark>=1.0.0
Expand All @@ -24,11 +24,11 @@ include_package_data = True
mamushi.parsing = *.lark

[options.entry_points]
console_scripts =
console_scripts =
mamushi=mamushi:main

[options.extras_require]
dev =
dev =
black==23.1.0
pre-commit==2.20.0
mypy_extensions==0.4.3
Expand All @@ -42,7 +42,7 @@ dev =

[options.packages.find]
where = src
exclude =
exclude =
tests

[metadata]
Expand All @@ -53,10 +53,10 @@ long_description = file: README.md
long_description_content_type = text/markdown
version = attr: mamushi.__version__.__version__
url = https://github.com/benber86/mamushi
project_urls =
project_urls =
Source = https://github.com/benber86/mamushi
Tracker = https://github.com/benber86/mamushi/issues
classifiers =
classifiers =
Development Status :: 4 - Beta
Environment :: Console
Intended Audience :: Developers
Expand All @@ -71,7 +71,7 @@ classifiers =

[bumpversion:part:release]
optional_value = release
values =
values =
a
b
release
Expand All @@ -82,4 +82,4 @@ values =

[bumpversion:file:pyproject.toml]
search = version = "{current_version}"
replace = version = "{new_version}"
replace = version = "{new_version}"
2 changes: 1 addition & 1 deletion src/mamushi/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.2-b0"
__version__ = "0.0.3"
4 changes: 2 additions & 2 deletions src/mamushi/utils/files.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Iterator, Optional
from typing import Iterator
from pathlib import Path

VYPER_EXTENSIONS = {".vy"}
VYPER_EXTENSIONS = {".vy", ".vyi"}
BLACKLISTED_DIRECTORIES = {
"build",
"buck-out",
Expand Down
2 changes: 1 addition & 1 deletion tests/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
THIS_DIR = Path(__file__).parent
DATA_DIR = THIS_DIR / "data"
PROJECT_ROOT = THIS_DIR.parent
VYPER_SUFFIX = ".vy"
VYPER_SUFFIXES = [".vy", ".vyi"]

MINIMAL_CONTRACT = """@external
def a():
Expand Down
26 changes: 26 additions & 0 deletions tests/data/builtins/extcall_staticcall.vy
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
def foo():
extcall foobar.test1()

def bar():
return extcall foobar.test1()

def foo_two():
extcall staticcall.test1()

def bar_two():
return staticcall foobar.test1()
# output
def foo():
extcall foobar.test1()


def bar():
return extcall foobar.test1()


def foo_two():
extcall staticcall.test1()


def bar_two():
return staticcall foobar.test1()
14 changes: 14 additions & 0 deletions tests/data/interfaces/interface_blank_lines.vyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@view
@external
def foo():





...
# output
@view
@external
def foo():
...
13 changes: 8 additions & 5 deletions tests/reader.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pathlib import Path
from typing import List, Tuple

from tests.const import DATA_DIR, PROJECT_ROOT, VYPER_SUFFIX
from tests.const import DATA_DIR, PROJECT_ROOT, VYPER_SUFFIXES


def get_base_dir(data: bool) -> Path:
Expand All @@ -20,10 +20,13 @@ def all_data_cases(subdir_name: str, data: bool = True) -> List[str]:

def get_case_path(subdir_name: str, name: str, data: bool = True) -> Path:
"""Get case path from name"""
case_path = get_base_dir(data) / subdir_name / name
case_path = case_path.with_suffix(VYPER_SUFFIX)
assert case_path.is_file(), f"{case_path} is not a file."
return case_path
base_path = get_base_dir(data) / subdir_name / name

for suffix in VYPER_SUFFIXES:
case_path = base_path.with_suffix(suffix)
if case_path.is_file():
return case_path
raise FileNotFoundError(f"No .vy or .vyi file found for {base_path}")


def read_data(
Expand Down

0 comments on commit 2490301

Please sign in to comment.