mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 06:41:44 +01:00
pyln: Change the setup.py file not to import the package
This would lead to errors about missing dependencies when attempting to install using `pyhon setup.py install`. This is because the `setup.py` file effectively is the manifest file used to discover which dependencies are needed, so when using it to detect dependencies we obviously don't have them yet. See https://packaging.python.org/guides/single-sourcing-package-version/
This commit is contained in:
parent
1bebdfdd5f
commit
6b0a7b173c
1 changed files with 20 additions and 2 deletions
|
@ -1,16 +1,34 @@
|
|||
from setuptools import setup
|
||||
from pyln.proto import __version__
|
||||
import codecs
|
||||
import io
|
||||
import os.path
|
||||
|
||||
|
||||
with io.open('README.md', encoding='utf-8') as f:
|
||||
long_description = f.read()
|
||||
|
||||
|
||||
with io.open('requirements.txt', encoding='utf-8') as f:
|
||||
requirements = [r for r in f.read().split('\n') if len(r)]
|
||||
|
||||
|
||||
def read(rel_path):
|
||||
here = os.path.abspath(os.path.dirname(__file__))
|
||||
with codecs.open(os.path.join(here, rel_path), 'r') as fp:
|
||||
return fp.read()
|
||||
|
||||
|
||||
def get_version(rel_path):
|
||||
for line in read(rel_path).splitlines():
|
||||
if line.startswith('__version__'):
|
||||
delim = '"' if '"' in line else "'"
|
||||
return line.split(delim)[1]
|
||||
else:
|
||||
raise RuntimeError("Unable to find version string.")
|
||||
|
||||
|
||||
setup(name='pyln-proto',
|
||||
version=__version__,
|
||||
version=get_version("pyln/proto/__init__.py"),
|
||||
description='Pure python implementation of the Lightning Network protocol',
|
||||
long_description=long_description,
|
||||
long_description_content_type='text/markdown',
|
||||
|
|
Loading…
Add table
Reference in a new issue