Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
Merge pull request #43 from unparalleled-js/chore/six
Browse files Browse the repository at this point in the history
chore: bump ape version
  • Loading branch information
antazoey authored Feb 1, 2023
2 parents 3d76522 + 2d4eef4 commit 1af0908
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 10 deletions.
File renamed without changes.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,7 @@ version.py

# Ape stuff
.build/

**/.DS_Store
*.swp
*.swo
5 changes: 2 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:
- id: isort

- repo: https://github.com/psf/black
rev: 22.10.0
rev: 22.12.0
hooks:
- id: black
name: black
Expand All @@ -24,14 +24,13 @@ repos:
rev: v0.991
hooks:
- id: mypy
additional_dependencies: [types-setuptools]
additional_dependencies: [types-setuptools, pydantic]

- repo: https://github.com/executablebooks/mdformat
rev: 0.7.14
hooks:
- id: mdformat
additional_dependencies: [mdformat-gfm, mdformat-frontmatter]


default_language_version:
python: python3
23 changes: 18 additions & 5 deletions ape_cairo/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,16 @@ def get_compiler_settings(
return settings

def load_dependencies(self, base_path: Optional[Path] = None):
_ = self.project_manager.dependencies
deps = self.project_manager.dependencies

# Have to re-exact manifests for some reason, maybe because of a bug
# in tempfiles. This only affects tests; real projects don't need
# this code. I am not sure why. Suddenly, the package just doesn't
# exist anymore.
for version_map in deps.values():
for dep in version_map.values():
dep.extract_manifest()

base_path = base_path or self.config_manager.contracts_folder
packages_folder = self.config_manager.packages_folder

Expand Down Expand Up @@ -75,9 +84,14 @@ def load_dependencies(self, base_path: Optional[Path] = None):
version = f"v{version}"

version = version or "" # For mypy
source_manifest_path = (
packages_folder / dependency_name / version / f"{dependency_name}.json"
)
source_manifest_path = packages_folder / dependency_name

if not source_manifest_path.is_dir():
raise CompilerError(
f"Missing dependency '{dependency_name}' from packages {source_manifest_path}."
)

source_manifest_path = source_manifest_path / version / f"{dependency_name}.json"
destination_base_path = base_path / ".cache" / dependency_name / version
if destination_base_path.is_dir() and not source_manifest_path.is_file():
# If the cache already exists and there is no dependency manifest file,
Expand All @@ -88,7 +102,6 @@ def load_dependencies(self, base_path: Optional[Path] = None):
raise CompilerError(f"Dependency '{dependency_name}={version}' missing.")

source_manifest = PackageManifest.parse_raw(source_manifest_path.read_text())
destination_base_path = base_path / ".cache" / dependency_name / version

if dependency_name not in [d.name for d in self.config_manager.dependencies]:
raise ConfigError(f"Dependency '{dependency_item}' not configured.")
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ requires = ["setuptools>=51.1.1", "wheel", "setuptools_scm[toml]>=5.0"]

[tool.mypy]
exclude = "build/"
plugins = ["pydantic.mypy"]

[tool.setuptools_scm]
write_to = "ape_cairo/version.py"
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"hypothesis>=6.2.0,<7.0", # Strategy-based fuzzer
],
"lint": [
"black>=22.10.0", # auto-formatter and linter
"black>=22.12.0", # auto-formatter and linter
"mypy>=0.991", # Static type analyzer
"types-setuptools", # Needed due to mypy typeshed
"flake8>=5.0.4", # Style linter
Expand Down Expand Up @@ -59,7 +59,7 @@
install_requires=[
"cairo-lang>=0.10.3,<0.11",
"starknet_py>=0.14.0a0,<0.15",
"eth-ape>=0.5.9,<0.6",
"eth-ape>=0.6.1,<0.7",
"ethpm-types", # Use same version as eth-ape
],
python_requires=">=3.8,<3.11",
Expand Down

0 comments on commit 1af0908

Please sign in to comment.