pyln.client: don't try to use module inside setup.py.

This fails once it has dependencies (next patch): instead extract version
manually.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2021-09-07 13:38:48 +09:30
parent 6b8d3a05f5
commit 07d2639f51

View File

@ -1,5 +1,4 @@
from setuptools import setup
from pyln import client
import io
@ -9,8 +8,14 @@ with io.open('README.md', encoding='utf-8') as f:
with io.open('requirements.txt', encoding='utf-8') as f:
requirements = [r for r in f.read().split('\n') if len(r)]
# setup shouldn't try to load module, so we hack-parse __init__.py
with io.open('pyln/client/__init__.py', encoding='utf-8') as f:
for line in f.read().split('\n'):
if line.startswith('__version__ = "'):
version = line.split('"')[1]
setup(name='pyln-client',
version=client.__version__,
version=version,
description='Client library for lightningd',
long_description=long_description,
long_description_content_type='text/markdown',