Skip to content

Commit

Permalink
Merge branch 'main' into fix-interactive-mode-provider-disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
z80dev authored Nov 18, 2023
2 parents f764b80 + f2511ae commit 914a872
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 14 deletions.
4 changes: 2 additions & 2 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: 23.10.1
rev: 23.11.0
hooks:
- id: black
name: black
Expand All @@ -21,7 +21,7 @@ repos:
- id: flake8

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.6.1
rev: v1.7.0
hooks:
- id: mypy
additional_dependencies: [
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"hypothesis-jsonschema==0.19.0", # JSON Schema fuzzer extension
],
"lint": [
"black>=23.10.1,<24", # Auto-formatter and linter
"mypy>=1.6.1,<2", # Static type analyzer
"black>=23.11.0,<24", # Auto-formatter and linter
"mypy>=1.7.0,<2", # Static type analyzer
"types-PyYAML", # Needed due to mypy typeshed
"types-requests", # Needed due to mypy typeshed
"types-setuptools", # Needed due to mypy typeshed
Expand Down Expand Up @@ -124,7 +124,7 @@
"web3[tester]>=6.7.0,<7",
# ** Dependencies maintained by ApeWorX **
"eip712>=0.2.1,<0.3",
"ethpm-types>=0.5.8,<0.6",
"ethpm-types>=0.5.10,<0.6",
"evm-trace>=0.1.0a23",
],
entry_points={
Expand Down
2 changes: 1 addition & 1 deletion src/ape/api/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def _create_manifest(
initial_manifest: Optional[PackageManifest] = None,
) -> PackageManifest:
manifest = initial_manifest or PackageManifest()
manifest.name = PackageName(name.lower()) if name is not None else manifest.name
manifest.name = PackageName(__root__=name.lower()) if name is not None else manifest.name
manifest.version = version or manifest.version
manifest.sources = cls._create_source_dict(source_paths, contracts_path)
manifest.contract_types = contract_types
Expand Down
6 changes: 3 additions & 3 deletions src/ape/managers/project/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,12 @@ def extract_manifest(self) -> PackageManifest:
return manifest

def _extract_manifest_dependencies(self) -> Optional[Dict[PackageName, AnyUrl]]:
package_dependencies: Dict[PackageName, AnyUrl] = {}
package_dependencies: Dict[str, AnyUrl] = {}
for dependency_config in self.config_manager.dependencies:
package_name = dependency_config.name.replace("_", "-").lower()
package_dependencies[PackageName(package_name)] = dependency_config.uri
package_dependencies[package_name] = dependency_config.uri

return package_dependencies
return cast(Optional[Dict[PackageName, AnyUrl]], package_dependencies)

@property
def _package_deployments_folder(self) -> Path:
Expand Down
2 changes: 1 addition & 1 deletion src/ape/utils/basemodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def __getattr__(self, name: str) -> Any:
"""

try:
return super().__getattr__(name)
return super().__getattribute__(name)
except AttributeError:
extras_checked = set()
for ape_extra in self.__ape_extra_attributes__():
Expand Down
3 changes: 3 additions & 0 deletions src/ape_plugins/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,9 @@ def __str__(self) -> str:
if PluginType.AVAILABLE in self.include and self.metadata.available:
sections.append(self.metadata.available)

if not sections:
return ""

# Use a single max length for all the sections.
max_length = max(x.max_name_length for x in sections)

Expand Down
13 changes: 9 additions & 4 deletions tests/functional/test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ def test_is_available(self):

class TestApePluginsRepr:
def test_str(self, plugin_metadata):
plugin_map = ApePluginsRepr(plugin_metadata)
actual = str(plugin_map)
representation = ApePluginsRepr(plugin_metadata)
actual = str(representation)
expected = f"""
Installed Plugins
installed {VERSION}
Expand All @@ -127,8 +127,8 @@ def test_str(self, plugin_metadata):
assert actual == expected.strip()

def test_str_all_types(self, plugin_metadata):
plugin_map = ApePluginsRepr(plugin_metadata, include=list(PluginType))
actual = str(plugin_map)
representation = ApePluginsRepr(plugin_metadata, include=list(PluginType))
actual = str(representation)
expected = f"""
Core Plugins
run
Expand All @@ -143,3 +143,8 @@ def test_str_all_types(self, plugin_metadata):
available
"""
assert actual == expected.strip()

def test_str_no_plugins(self):
plugins = PluginMetadataList.from_package_names([])
representation = ApePluginsRepr(plugins)
assert str(representation) == ""

0 comments on commit 914a872

Please sign in to comment.