Skip to content

Commit b1ec8eb

Browse files

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

bitcoin/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313

1414
import bitcoin.core
1515

16+
# Note that setup.py can break if __init__.py imports any external
17+
# dependencies, as these might not be installed when setup.py runs. In this
18+
# case __version__ could be moved to a separate version.py and imported here.
19+
__version__ = '0.4.1.dev0'
20+
1621
class MainParams(bitcoin.core.CoreMainParams):
1722
MESSAGE_START = b'\xf9\xbe\xb4\xd9'
1823
DEFAULT_PORT = 8333

bitcoin/messages.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ def __init__(self, protover=PROTO_VERSION):
121121
self.addrTo = CAddress(PROTO_VERSION)
122122
self.addrFrom = CAddress(PROTO_VERSION)
123123
self.nNonce = random.getrandbits(64)
124-
self.strSubVer = b'/python-bitcoin-0.0.1/'
124+
self.strSubVer = (b'/python-bitcoinlib:' +
125+
bitcoin.__version__.encode('ascii') + b'/')
125126
self.nStartingHeight = -1
126127

127128
@classmethod

doc/conf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# serve to show the default.
1313

1414
PROJECT = 'python-bitcoinlib'
15-
VERSION = '0.4.0'
1615
DESCRIPTION = 'The Swiss Army Knife of the Bitcoin protocol.'
1716
AUTHORS = 'The python-bitcoinlib developers'
1817

@@ -25,6 +24,8 @@
2524
# documentation root, use os.path.abspath to make it absolute, like shown here.
2625
sys.path.insert(0, os.path.abspath('..'))
2726

27+
from bitcoin import __version__
28+
2829
# Prevent loading openssl when generating API docs. Either the whole library or
2930
# the necessary elliptic curve might not be available, causing import to fail.
3031
try:
@@ -66,9 +67,9 @@
6667
# built documents.
6768
#
6869
# The short X.Y version.
69-
version = VERSION
70+
version = __version__
7071
# The full version, including alpha/beta/rc tags.
71-
release = VERSION
72+
release = __version__
7273

7374
# The language for content autogenerated by Sphinx. Refer to documentation
7475
# for a list of supported languages.

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@
33
from setuptools import setup, find_packages
44
import os
55

6+
from bitcoin import __version__
7+
68
here = os.path.abspath(os.path.dirname(__file__))
79
with open(os.path.join(here, 'README')) as f:
810
README = f.read()
911

1012
requires = []
1113

1214
setup(name='python-bitcoinlib',
13-
version='0.4.1-SNAPSHOT',
15+
version=__version__,
1416
description='The Swiss Army Knife of the Bitcoin protocol.',
1517
long_description=README,
1618
classifiers=[

0 commit comments

Comments
 (0)