ape icon indicating copy to clipboard operation
ape copied to clipboard

feat: Add source_path (path) property to ContractContainer

Open sabotagebeats opened this issue 2 years ago • 4 comments

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

sabotagebeats avatar Sep 15 '22 19:09 sabotagebeats

needs code review and additional test for source_path

sabotagebeats avatar Sep 15 '22 19:09 sabotagebeats

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)

sabotagebeats avatar Sep 15 '22 19:09 sabotagebeats

Donut forget tests!

Add test_source_path in the file test_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'

sabotagebeats avatar Sep 16 '22 01:09 sabotagebeats

Passing checks but I don't think my test is right.

sabotagebeats avatar Sep 16 '22 21:09 sabotagebeats