Skip to content

Update module import script#1654

Open
otis01 wants to merge 1 commit intoeth-brownie:masterfrom
otis01:master
Open

Update module import script#1654
otis01 wants to merge 1 commit intoeth-brownie:masterfrom
otis01:master

Conversation

@otis01
Copy link
Copy Markdown

@otis01 otis01 commented Dec 30, 2022

Currently, running brownie run scripts/deploy.py fails when the path to the project has a . in it.

The following path

/Users/john.doe/Projects/Chainlink

Gets converted to

Users.john.doe.Projects.Chainlink

Which fails because it thinks that john and doe are two directories. Using the above method fixes this error.

What I did

Add an import_module script that works regardless of the path.

How I did it

Using "/" instead if "." in the path string.

How to verify it

Run it locally in a path that has a . in it.

Checklist

  • I have confirmed that my PR passes all linting checks
  • I have included test cases
  • I have updated the documentation
  • I have added an entry to the changelog

Currently, running `brownie run scripts/deploy.py` fails when the path to the project has a `.` in it.

The following path
```
/Users/john.doe/Projects/Chainlink
```

Gets converted to
```
Users.john.doe.Projects.Chainlink
```
Which fails because it thinks that `john` and `doe` are two directories.
Using the above method fixes this error.
@BobTheBuidler
Copy link
Copy Markdown
Collaborator

@otis01 could you add some tests for this? I'd be happy to merge with those added

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants