Skip to content

Commit

Permalink
Merge branch 'v1.0.0b5'
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdefinitelyahuman committed May 13, 2019
2 parents 06b71b2 + 96fb1cb commit 55f466d
Show file tree
Hide file tree
Showing 51 changed files with 1,350 additions and 873 deletions.
22 changes: 16 additions & 6 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
1.0.0b5
-------

- Use relative paths in build json files
- Revert calls-as-transactions when evaluating coverage
- Significant refactor and optimizations to coverage analysis
- changes to coverageMap format, add coverageMapTotals
- Save coverage data to reports/ subfolder
- Improvements to GUI

1.0.0b4
-------

- Add broadcast_reverting_tx flag
- Use py-solc-x 0.4.0
- Detect and attach to an already active RPC client, better verbosity on RPC exceptions
- introduce Singleton metaclass and refactor code to take advantage
- add EventDict and EventItem classes for transaction event logs
- Introduce Singleton metaclass and refactor code to take advantage
- Add EventDict and EventItem classes for transaction event logs
- cli.color, add _print_as_dict _print_as_list _dir_color attributes
- add conversion methods in types.convert
- remove brownie.utils package, move modules to network and project packages
- bugfixes and minor changes
- Add conversion methods in types.convert
- Remove brownie.utils package, move modules to network and project packages
- Bugfixes and minor changes

1.0.0b3
-------
Expand Down Expand Up @@ -95,4 +105,4 @@
0.9.0
-----

- Initial release
- Initial release
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ $ git clone https://github.com/HyperLink-Technology/brownie.git

Pull requests are welcomed! Please try to adhere to the following.

- Follow PEP8 code standards (max line length 100)
- include any relevant documentation updates

It's a good idea to make pull requests early on. A pull request represents the
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Brownie is a python framework for deploying, testing and interacting with Ethere

As Brownie relies on [py-solc-x](https://github.com/iamdefinitelyahuman/py-solc-x), you do not need solc installed locally but you must install all required [solc dependencies](https://solidity.readthedocs.io/en/latest/installing-solidity.html#binary-packages).


## Installation

You can install the latest release via pip:
Expand Down Expand Up @@ -44,9 +43,8 @@ Brownie documentation is hosted at [Read the Docs](https://eth-brownie.readthedo
Help is always appreciated! In particular, Brownie needs work in the following areas before we can comfortably take it out of beta:

* Tests
* Improving the documentation
* More tests
* Travis or other CI
* More tests

Feel free to open an issue if you find a problem, or a pull request if you've solved an issue.

Expand Down
11 changes: 6 additions & 5 deletions brownie/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
_Singleton
)

REPLACE_IN_UPDATE = ['active_network', 'networks']
IGNORE_IF_MISSING = ['folders', 'logging']
REPLACE = ['active_network', 'networks']
IGNORE = ['folders', 'logging']


def _load_default_config():
Expand All @@ -30,7 +30,7 @@ def _load_default_config():
config['logging'].setdefault('exc', 0)
for k, v in [(k, v) for k, v in config['logging'].items() if type(v) is list]:
config['logging'][k] = v[1 if '--verbose' in sys.argv else 0]
except:
except Exception:
config['logging'] = {"tx": 1, "exc": 1}
return config

Expand Down Expand Up @@ -71,18 +71,19 @@ def modify_network_config(network=None):
# merges project .json with brownie .json
def _recursive_update(original, new, base):
for k in new:
if type(new[k]) is dict and k in REPLACE_IN_UPDATE:
if type(new[k]) is dict and k in REPLACE:
original[k] = new[k]
elif type(new[k]) is dict and k in original:
_recursive_update(original[k], new[k], base+[k])
else:
original[k] = new[k]
for k in [i for i in original if i not in new and not set(base+[i]).intersection(IGNORE_IF_MISSING)]:
for k in [i for i in original if i not in new and not set(base+[i]).intersection(IGNORE)]:
print(
"WARNING: Value '{}' not found in the config file for this project."
" The default setting has been used.".format(".".join(base+[k]))
)


# move argv flags into FalseyDict
ARGV = _Singleton("Argv", (FalseyDict,), {})()
for key in [i for i in sys.argv if i[:2] == "--"]:
Expand Down
3 changes: 1 addition & 2 deletions brownie/cli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from brownie.cli.utils import color
import brownie.project as project

__version__ = "1.0.0b4" # did you change this in docs/conf.py as well?
__version__ = "1.0.0b5" # did you change this in docs/conf.py as well?

__doc__ = """Usage: brownie <command> [<args>...] [options <args>]
Expand Down Expand Up @@ -44,7 +44,6 @@ def main():
args = docopt(__doc__)
sys.argv += opts


cmd_list = [i.stem for i in Path(__file__).parent.glob('[!_]*.py')]
if args['<command>'] not in cmd_list:
sys.exit("Invalid command. Try 'brownie --help' for available commands.")
Expand Down
3 changes: 1 addition & 2 deletions brownie/cli/bake.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"""



def main():
args = docopt(__doc__)
path = Path(args['<path>'] or '.').resolve()
Expand All @@ -54,4 +53,4 @@ def main():
)

print("Brownie mix '{}' has been initiated at {}".format(args['<mix>'], final_path))
sys.exit()
sys.exit()
3 changes: 1 addition & 2 deletions brownie/cli/compile.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/python3

from docopt import docopt
from pathlib import Path
import shutil

import brownie.project as project
Expand All @@ -18,7 +17,7 @@


def main():
args = docopt(__doc__)
docopt(__doc__)
project_path = project.check_for_project('.')
build_path = project_path.joinpath('build/contracts')
if ARGV['all']:
Expand Down
10 changes: 5 additions & 5 deletions brownie/cli/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
import sys
import threading

import brownie
import brownie.network as network
from brownie.cli.utils import color
from brownie._config import ARGV, CONFIG

if sys.platform == "win32":
from pyreadline import Readline
readline = Readline()
else:
import readline

import brownie
import brownie.network as network
from brownie.cli.utils import color
from brownie._config import ARGV, CONFIG


__doc__ = """Usage: brownie console [options]
Expand Down
4 changes: 2 additions & 2 deletions brownie/cli/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
__doc__ = """Usage: brownie gui
Options:
--help -h Display this message
--help -h Display this message
Opens the brownie GUI. Basic functionality is as follows:
Expand All @@ -28,7 +28,7 @@


def main():
args = docopt(__doc__)
docopt(__doc__)
print("Loading Brownie GUI...")
Gui().mainloop()
print("GUI was terminated.")
1 change: 1 addition & 0 deletions brownie/cli/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
build/ Compiled contracts and test data
contracts/ Contract source code
reports/ Report files for contract analysis
scripts/ Scripts for deployment and interaction
tests/ Scripts for project testing
brownie-config.json Project configuration file"""
Expand Down
12 changes: 7 additions & 5 deletions brownie/cli/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
from pathlib import Path
import sys


import brownie.network as network
from brownie.cli.utils import color
from brownie._config import ARGV, CONFIG



__doc__ = """Usage: brownie run <filename> [<function>] [options]
Arguments:
Expand All @@ -27,25 +25,29 @@
Use run to execute scripts that deploy or interact with contracts on the network.
""".format(CONFIG['network_defaults']['name'])

ERROR = "{0[error]}ERROR{0}: ".format(color)


def main():
args = docopt(__doc__)
ARGV._update_from_args(args)
name = args['<filename>'].replace(".py", "")
fn = args['<function>'] or "main"
if not Path(CONFIG['folders']['project']).joinpath('scripts/{}.py'.format(name)):
sys.exit("{0[error]}ERROR{0}: Cannot find {0[module]}scripts/{1}.py{0}".format(color, name))
sys.exit(ERROR+"Cannot find {0[module]}scripts/{1}.py{0}".format(color, name))
network.connect(ARGV['network'])
module = importlib.import_module("scripts."+name)
if not hasattr(module, fn):
sys.exit("{0[error]}ERROR{0}: {0[module]}scripts/{1}.py{0} has no '{0[callable]}{2}{0}' function.".format(color, name, fn))
sys.exit(ERROR+"{0[module]}scripts/{1}.py{0} has no '{0[callable]}{2}{0}' function.".format(
color, name, fn
))
print("Running '{0[module]}{1}{0}.{0[callable]}{2}{0}'...".format(color, name, fn))
try:
getattr(module, fn)()
print("\n{0[success]}SUCCESS{0}: script '{0[module]}{1}{0}' completed.".format(color, name))
except Exception as e:
if CONFIG['logging']['exc'] >= 2:
print("\n"+color.format_tb(sys.exc_info()))
print("\n{0[error]}ERROR{0}: Script '{0[module]}{1}{0}' failed from unhandled {2}: {3}".format(
print(ERROR+"Script '{0[module]}{1}{0}' failed from unhandled {2}: {3}".format(
color, name, type(e).__name__, e
))
Loading

0 comments on commit 55f466d

Please sign in to comment.