ape
ape copied to clipboard
feat: Add source_path (path) property to ContractContainer
What I did
add source_path property
fixes: #1005
How I did it
add source path property within contract container
How to verify it
Checklist
- [ ] All changes are completed
- [ ] New test cases have been added
- [ ] Documentation has been updated
needs code review and additional test for source_path
mypy errors:
Run mypy .
src/ape/contracts/base.py:84[7](https://github.com/ApeWorX/ape/actions/runs/3063285932/jobs/4945189666#step:5:8): error: Missing return statement
src/ape/contracts/base.py:[8](https://github.com/ApeWorX/ape/actions/runs/3063285932/jobs/4945189666#step:5:9)53: error: Argument 1 to "_get_contract" of "ProjectManager" has incompatible type "Optional[str]"; expected "str"
src/ape/contracts/base.py:855: error: Unsupported operand types for / ("Path" and "None")
src/ape/contracts/base.py:855: note: Right operand is of type "Optional[str]"
Found 3 errors in 1 file (checked 168 source files)
Donut forget tests!
Add
test_source_path
in the filetest_contract_container.py
and see what you can do
I'm getting the error on my breakpoint that's preventing me from running source_path
. I think it is because the contract container is not the same in the test, but I'm still investigating.
(Pdb) contract_container.source_path
*** AttributeError: 'NoneType' object has no attribute 'contract_type'
Passing checks but I don't think my test is right.