pylightning: allow version querying from within modules.

With the preceeding UTF-8 fix, I'd like to detect UTF-8 support.  But
AFAICT Python doesn't have a standard way of doing version exposure.

So I added __version__, but now we need to make sure it matches.  I
used the hackiest possible method.

[ Christian Decker fixed version to be sane, so previous comment no longer
  applies! --RR ]
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2019-03-04 13:38:48 +10:30 committed by Christian Decker
parent cc342fda83
commit 1facf626d5
3 changed files with 6 additions and 2 deletions

View file

@ -1,2 +1,2 @@
from .lightning import LightningRpc, RpcError, Millisatoshi
from .lightning import LightningRpc, RpcError, Millisatoshi, __version__
from .plugin import Plugin, monkey_patch

View file

@ -3,6 +3,8 @@ import json
import logging
import socket
__version__ = "0.0.7.1"
class RpcError(ValueError):
def __init__(self, method, payload, error):

View file

@ -1,10 +1,12 @@
from setuptools import setup
import lightning
with open('README.md', encoding='utf-8') as f:
long_description = f.read()
setup(name='pylightning',
version='0.0.7',
version=lightning.__version__,
description='Client library for lightningd',
long_description=long_description,
long_description_content_type='text/markdown',