Skip to content

Commit

Permalink
don't bundle xbr abi files anymore; update changelog and bump version (
Browse files Browse the repository at this point in the history
  • Loading branch information
oberstet committed Feb 11, 2021
1 parent 5008987 commit 19ff6ea
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 34 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ jobs:
- name: Install this package
run: |
make abi_files
pip install .[all]
- name: Run unit tests (PyTest)
Expand Down Expand Up @@ -134,7 +133,6 @@ jobs:
- name: Install this package
run: |
make abi_files
pip install .[all]
- name: Run Sphinx
Expand Down
2 changes: 0 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include LICENSE
include autobahn/nvx/_utf8validator.c
recursive-include autobahn/wamp/gen/schema *
recursive-include autobahn/xbr/contracts *
recursive-include autobahn/xbr/templates *
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ all:
@echo " flake8 Run flake8 code checking"
@echo ""

# deprecated with v21.2.1 (ABI files are no longer bundled in this package)
abi_files:
curl -s https://xbr.network/lib/abi/xbr-protocol-latest.zip -o /tmp/xbr-protocol-latest.zip
unzip -t /tmp/xbr-protocol-latest.zip
rm -rf ${PWD}/autobahn/xbr/contracts
unzip /tmp/xbr-protocol-latest.zip -d ${PWD}/autobahn/xbr/contracts

# install locally
install: abi_files
install:
-pip uninstall -y pytest_asyncio # remove the broken shit
-pip uninstall -y pytest_cov # remove the broken shit
# enforce use of bundled libsodium
Expand Down
2 changes: 1 addition & 1 deletion autobahn/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
#
###############################################################################

__version__ = '21.2.1.dev1'
__version__ = '21.2.1'
22 changes: 15 additions & 7 deletions autobahn/xbr/_abi.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@
# print('Using eth_hash backend {}'.format(keccak256))
import web3

import xbr


XBR_ABI_VERSION = xbr.__version__
"""
XBR Protocol contracts ABI bundle (Python package) version.
"""


#
# Set default XBR contract addresses to
Expand Down Expand Up @@ -120,7 +128,7 @@


def _load_json(contract_name):
fn = pkg_resources.resource_filename('autobahn', 'xbr/contracts/{}.json'.format(contract_name))
fn = pkg_resources.resource_filename('xbr', 'abi/{}.json'.format(contract_name))
with open(fn) as f:
data = json.loads(f.read())
return data
Expand All @@ -129,12 +137,12 @@ def _load_json(contract_name):
#
# XBR contract ABI file names
#
XBR_TOKEN_FN = pkg_resources.resource_filename('autobahn', 'xbr/contracts/XBRToken.json')
XBR_NETWORK_FN = pkg_resources.resource_filename('autobahn', 'xbr/contracts/XBRNetwork.json')
XBR_DOMAIN_FN = pkg_resources.resource_filename('autobahn', 'xbr/contracts/XBRDomain.json')
XBR_CATALOG_FN = pkg_resources.resource_filename('autobahn', 'xbr/contracts/XBRCatalog.json')
XBR_MARKET_FN = pkg_resources.resource_filename('autobahn', 'xbr/contracts/XBRMarket.json')
XBR_CHANNEL_FN = pkg_resources.resource_filename('autobahn', 'xbr/contracts/XBRChannel.json')
XBR_TOKEN_FN = pkg_resources.resource_filename('xbr', 'abi/XBRToken.json')
XBR_NETWORK_FN = pkg_resources.resource_filename('xbr', 'abi/XBRNetwork.json')
XBR_DOMAIN_FN = pkg_resources.resource_filename('xbr', 'abi/XBRDomain.json')
XBR_CATALOG_FN = pkg_resources.resource_filename('xbr', 'abi/XBRCatalog.json')
XBR_MARKET_FN = pkg_resources.resource_filename('xbr', 'abi/XBRMarket.json')
XBR_CHANNEL_FN = pkg_resources.resource_filename('xbr', 'abi/XBRChannel.json')


#
Expand Down
7 changes: 0 additions & 7 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ pip install awscli
which aws
aws --version

# ABI JSON files are extracted directly into the package source directory, so they are bundled in the package
echo 'downloading and extracting XBR ABI files ..'
curl -s https://xbr.network/lib/abi/xbr-protocol-latest.zip -o /tmp/xbr-protocol-latest.zip
unzip -t /tmp/xbr-protocol-latest.zip
rm -rf ./autobahn/xbr/contracts
unzip /tmp/xbr-protocol-latest.zip -d ./autobahn/xbr/contracts

# build python source dist and wheels
echo 'building package ..'
python setup.py sdist bdist_wheel --universal
Expand Down
7 changes: 7 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
Changelog
=========

21.2.1
------

* new: XBR ABI files now via separate package ("xbr") - substantially reduce package size for non-XBR users
* fix: circular dependency in "xbr" install flavor (prohibited pip install from github master)
* fix: XBR package manifest and CLI user profile loading

21.1.1
------

Expand Down
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@
cffi_modules.append('autobahn/nvx/_utf8validator.py:ffi')

extras_require_xbr = [
# XBR contracts and ABI file bundle
'xbr>=20.1.1', # Apache 2.0

'cbor2>=5.1.0', # MIT license
'zlmdb>=20.4.1', # MIT license
'twisted>=20.3.0', # MIT license
Expand Down
14 changes: 0 additions & 14 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,6 @@ setenv =
# AUTOBAHN_CI_ENABLE_RNG_DEPLETION_TESTS = 1

commands =
# download and extract archive with XBR ABI files into package directory for bundling
rm -f /tmp/xbr-protocol-latest.zip
curl -s https://xbr.network/lib/abi/xbr-protocol-latest.zip -o /tmp/xbr-protocol-latest.zip
unzip -t /tmp/xbr-protocol-latest.zip
rm -rf ./autobahn/xbr/contracts
unzip /tmp/xbr-protocol-latest.zip -d ./autobahn/xbr/contracts

# install package
pip install -U pip
sh -c "which python && which pip && python -V"
Expand Down Expand Up @@ -146,13 +139,6 @@ extras =
passenv =
CODECOV_TOKEN
commands =
# download and extract archive with XBR ABI files into package directory for bundling
rm -f /tmp/xbr-protocol-latest.zip
curl -s https://xbr.network/lib/abi/xbr-protocol-latest.zip -o /tmp/xbr-protocol-latest.zip
unzip -t /tmp/xbr-protocol-latest.zip
rm -rf ./autobahn/xbr/contracts
unzip /tmp/xbr-protocol-latest.zip -d ./autobahn/xbr/contracts

# install package with all optional extensions
pip install .[all]

Expand Down

0 comments on commit 19ff6ea

Please sign in to comment.