question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add params to brownie run

See original GitHub issue

Overview

Now we can put args and kwargs into brownie run, when we are using brownie console mode (here in code), but we can’t do it through calling of brownie run from shell. Possible it’s very useful feature in CI/CD, scripts etc

  • I want to deploy my token in CI/CD with dynamic params (for example address of other contracts, which have deployed earlier in CI/CD). Now I deploy their manually through brownie console.
  • I want to run my brownie scripts without interactive mode in docker files.

Specification

For example we can add args and kwargs so: brownie run <filename> [<function>] [<args1>] … [<argsN>] [options] [kwargs], where * [<args1>] … [<argsN>] - is tuple of args *[kwars] - is kwargs, but without reserves keys like --network

Dependencies

I could not search.

If we can do these changes, than I can implement it at the next week.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
pjennesscommented, Oct 2, 2021

Hiya

Did this ever get resolved?

Im trying to run
brownie run ‘./scripts/create_myToken.py --name “Myname”’ --network rinkeby

I have args = sys.argv[1:] to catch --name etc like normal python

But brownie doesnt seem to like this command line format and returns error “Usage: brownie run <filename> [<function>] [options]”

Is there a solution ?

Cheers -P

2reactions
iamdefinitelyahumancommented, Apr 8, 2020

Thanks for this proposal! I agree with you on all points:

  • There is a valid use case
  • the run method already exposes this functionality
  • it won’t break anything to add it to the CLI

If you are OK with implementing the functionality, I’m happy to add it to the next release 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to call `brownie run` with extra script parameters
All arguments are passed into the docopt function which parses the options based on the docstring. Any extra arguments that are not listed ......
Read more >
Quickstart — Brownie 1.19.2 documentation
Brownie - Python development framework for Ethereum Compiling contracts. ... To use a fixture, add an argument with the same name to the...
Read more >
eth-brownie/community - Gitter
Is it possible to pass parameters in the script main function from the command line? scripts/test.py: def main(param): print(param). From cmd: brownie run...
Read more >
Bountysource
Add params to brownie run.
Read more >
The Brownie Python tutorial series—Part 2 - Chainstack
Once we create our scripts, we can use the brownie run command to automatically ... By using all these parameters, you can add...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found