diff --git a/.mdformat.toml b/.mdformat.toml deleted file mode 100644 index 01b2fb0..0000000 --- a/.mdformat.toml +++ /dev/null @@ -1 +0,0 @@ -number = true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 708039f..28881d1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.2.0 + rev: v4.5.0 hooks: - id: check-yaml @@ -10,24 +10,24 @@ repos: - id: isort - repo: https://github.com/psf/black - rev: 23.3.0 + rev: 23.12.0 hooks: - id: black name: black - repo: https://github.com/pycqa/flake8 - rev: 6.0.0 + rev: 6.1.0 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.991 + rev: v1.7.1 hooks: - id: mypy additional_dependencies: [types-setuptools, pydantic==1.10.4] - repo: https://github.com/executablebooks/mdformat - rev: 0.7.16 + rev: 0.7.17 hooks: - id: mdformat additional_dependencies: [mdformat-gfm, mdformat-frontmatter] diff --git a/ape_cairo/compiler.py b/ape_cairo/compiler.py index 1923f33..8f80258 100644 --- a/ape_cairo/compiler.py +++ b/ape_cairo/compiler.py @@ -3,7 +3,7 @@ import shutil import subprocess from pathlib import Path -from typing import Dict, List, Optional, Set, Tuple, cast +from typing import Dict, List, Optional, Sequence, Set, Tuple, cast from ape.api import CompilerAPI, PluginConfig from ape.exceptions import CompilerError, ConfigError @@ -11,7 +11,7 @@ from ape.utils import get_relative_path from eth_utils import to_hex from ethpm_types import ContractType, PackageManifest -from semantic_version import Version # type: ignore +from packaging.version import Version # type: ignore STARKNET_COMPILE = "starknet-compile" STARKNET_SIERRA_COMPILE = "starknet-sierra-compile" @@ -138,7 +138,7 @@ def starknet_sierra_compile( return _compile(*arguments) def get_compiler_settings( - self, contract_filepaths: List[Path], base_path: Optional[Path] = None + self, contract_filepaths: Sequence[Path], base_path: Optional[Path] = None ) -> Dict[Version, Dict]: settings: Dict[Version, Dict] = {} for version in self.get_versions(contract_filepaths): @@ -223,14 +223,14 @@ def load_dependencies(self, base_path: Optional[Path] = None): destination_path.touch() destination_path.write_text(source.content) - def get_versions(self, all_paths: List[Path]) -> Set[str]: + def get_versions(self, all_paths: Sequence[Path]) -> Set[str]: if not all_paths: return set() return {"v1.0.0-alpha.7"} def compile( - self, contract_filepaths: List[Path], base_path: Optional[Path] = None + self, contract_filepaths: Sequence[Path], base_path: Optional[Path] = None ) -> List[ContractType]: base_path = base_path or self.project_manager.contracts_folder diff --git a/pyproject.toml b/pyproject.toml index eae274b..8a43fa8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,3 +38,4 @@ force_grid_wrap = 0 include_trailing_comma = true multi_line_output = 3 use_parentheses = true + diff --git a/setup.py b/setup.py index 4e0a827..7d0b776 100644 --- a/setup.py +++ b/setup.py @@ -5,19 +5,22 @@ extras_require = { "test": [ # `test` GitHub Action jobs uses this "pytest>=6.0,<8", # Core testing package - "pytest-xdist", # multi-process runner + "pytest-xdist", # Multi-process runner "pytest-cov", # Coverage analyzer plugin "hypothesis>=6.70,<7.0", # Strategy-based fuzzer ], "lint": [ - "black>=23.3.0", # auto-formatter and linter - "mypy>=0.991,<1", # Static type analyzer - "types-setuptools", # Needed due to mypy typeshed - "flake8>=6.0.0,<7", # Style linter + "black>=23.11.0,<24", # Auto-formatter and linter + "mypy>=1.7.1,<2", # Static type analyzer + "types-setuptools", # Needed for mypy type shed + "flake8>=6.1.0,<7", # Style linter + "flake8-breakpoint>=1.1.0,<2", # Detect breakpoints left in code + "flake8-print>=5.0.0,<6", # Detect print statements left in code "isort>=5.10.1,<6", # Import sorting linter - "mdformat>=0.7.16,<0.8", # Auto-formatter for markdown - "mdformat-gfm>=0.3.5,<0.4", # Needed for formatting GitHub-flavored markdown - "mdformat-frontmatter>=0.4.1,<0.5", # Needed for headers in GH issue templates + "mdformat>=0.7.17", # Auto-formatter for markdown + "mdformat-gfm>=0.3.5", # Needed for formatting GitHub-flavored markdown + "mdformat-frontmatter>=0.4.1", # Needed for frontmatters-style headers in issue templates + "mdformat-pyproject>=0.0.1", # Allows configuring in pyproject.toml ], "release": [ # `release` GitHub Action job uses this "setuptools", # Installation tool @@ -57,7 +60,7 @@ url="https://github.com/ApeWorX/ape-cairo", include_package_data=True, install_requires=[ - "eth-ape>=0.6.8,<0.7", + "eth-ape>=0.7.0,<0.8", "ethpm-types", # Use same version as eth-ape ], python_requires=">=3.8,<4",