From 1c1c3349b43ab963dcc1407c6b07aa7630e9afa3 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 24 Jun 2020 20:51:36 +0930 Subject: [PATCH] pyln.spec.bolt*: unify setups. Signed-off-by: Rusty Russell --- contrib/pyln-spec/bolt1/boltsetup.py | 1 + contrib/pyln-spec/bolt1/setup.py | 24 ++---------------------- contrib/pyln-spec/bolt2/boltsetup.py | 1 + contrib/pyln-spec/bolt2/setup.py | 24 ++---------------------- contrib/pyln-spec/bolt4/boltsetup.py | 1 + contrib/pyln-spec/bolt4/setup.py | 24 ++---------------------- contrib/pyln-spec/bolt7/boltsetup.py | 1 + contrib/pyln-spec/bolt7/setup.py | 24 ++---------------------- contrib/pyln-spec/boltsetup.py | 20 ++++++++++++++++++++ 9 files changed, 32 insertions(+), 88 deletions(-) create mode 120000 contrib/pyln-spec/bolt1/boltsetup.py create mode 120000 contrib/pyln-spec/bolt2/boltsetup.py create mode 120000 contrib/pyln-spec/bolt4/boltsetup.py create mode 120000 contrib/pyln-spec/bolt7/boltsetup.py create mode 100644 contrib/pyln-spec/boltsetup.py diff --git a/contrib/pyln-spec/bolt1/boltsetup.py b/contrib/pyln-spec/bolt1/boltsetup.py new file mode 120000 index 000000000..7a076c981 --- /dev/null +++ b/contrib/pyln-spec/bolt1/boltsetup.py @@ -0,0 +1 @@ +../boltsetup.py \ No newline at end of file diff --git a/contrib/pyln-spec/bolt1/setup.py b/contrib/pyln-spec/bolt1/setup.py index 7b18e850e..0b4786310 100644 --- a/contrib/pyln-spec/bolt1/setup.py +++ b/contrib/pyln-spec/bolt1/setup.py @@ -1,24 +1,4 @@ from pyln.spec.bolt1 import __version__, desc -from setuptools import setup -import io +from boltsetup import bolt_setup -with io.open('requirements.txt', encoding='utf-8') as f: - requirements = [r for r in f.read().split('\n') if len(r)] - - -def do_setup(boltnum: int, version: str, desc: str): - setup(name='pyln-bolt{}'.format(boltnum), - version=version, - description=desc, - url='http://github.com/ElementsProject/lightning', - author='Rusty Russell', - author_email='rusty@rustcorp.com.au', - license='MIT', - packages=['pyln.spec.bolt{}'.format(boltnum)], - package_data={'pyln.proto.message': ['py.typed']}, - scripts=[], - zip_safe=True, - install_requires=requirements) - - -do_setup(1, __version__, desc) +bolt_setup(1, __version__, desc) diff --git a/contrib/pyln-spec/bolt2/boltsetup.py b/contrib/pyln-spec/bolt2/boltsetup.py new file mode 120000 index 000000000..7a076c981 --- /dev/null +++ b/contrib/pyln-spec/bolt2/boltsetup.py @@ -0,0 +1 @@ +../boltsetup.py \ No newline at end of file diff --git a/contrib/pyln-spec/bolt2/setup.py b/contrib/pyln-spec/bolt2/setup.py index e22cb01f7..6e3ee5344 100644 --- a/contrib/pyln-spec/bolt2/setup.py +++ b/contrib/pyln-spec/bolt2/setup.py @@ -1,24 +1,4 @@ from pyln.spec.bolt2 import __version__, desc -from setuptools import setup -import io +from boltsetup import bolt_setup -with io.open('requirements.txt', encoding='utf-8') as f: - requirements = [r for r in f.read().split('\n') if len(r)] - - -def do_setup(boltnum: int, version: str, desc: str): - setup(name='pyln-bolt{}'.format(boltnum), - version=version, - description=desc, - url='http://github.com/ElementsProject/lightning', - author='Rusty Russell', - author_email='rusty@rustcorp.com.au', - license='MIT', - packages=['pyln.spec.bolt{}'.format(boltnum)], - package_data={'pyln.proto.message': ['py.typed']}, - scripts=[], - zip_safe=True, - install_requires=requirements) - - -do_setup(2, __version__, desc) +bolt_setup(2, __version__, desc) diff --git a/contrib/pyln-spec/bolt4/boltsetup.py b/contrib/pyln-spec/bolt4/boltsetup.py new file mode 120000 index 000000000..7a076c981 --- /dev/null +++ b/contrib/pyln-spec/bolt4/boltsetup.py @@ -0,0 +1 @@ +../boltsetup.py \ No newline at end of file diff --git a/contrib/pyln-spec/bolt4/setup.py b/contrib/pyln-spec/bolt4/setup.py index ecffc05e1..ac4b6f3fc 100644 --- a/contrib/pyln-spec/bolt4/setup.py +++ b/contrib/pyln-spec/bolt4/setup.py @@ -1,24 +1,4 @@ from pyln.spec.bolt4 import __version__, desc -from setuptools import setup -import io +from boltsetup import bolt_setup -with io.open('requirements.txt', encoding='utf-8') as f: - requirements = [r for r in f.read().split('\n') if len(r)] - - -def do_setup(boltnum: int, version: str, desc: str): - setup(name='pyln-bolt{}'.format(boltnum), - version=version, - description=desc, - url='http://github.com/ElementsProject/lightning', - author='Rusty Russell', - author_email='rusty@rustcorp.com.au', - license='MIT', - packages=['pyln.spec.bolt{}'.format(boltnum)], - package_data={'pyln.proto.message': ['py.typed']}, - scripts=[], - zip_safe=True, - install_requires=requirements) - - -do_setup(4, __version__, desc) +bolt_setup(4, __version__, desc) diff --git a/contrib/pyln-spec/bolt7/boltsetup.py b/contrib/pyln-spec/bolt7/boltsetup.py new file mode 120000 index 000000000..7a076c981 --- /dev/null +++ b/contrib/pyln-spec/bolt7/boltsetup.py @@ -0,0 +1 @@ +../boltsetup.py \ No newline at end of file diff --git a/contrib/pyln-spec/bolt7/setup.py b/contrib/pyln-spec/bolt7/setup.py index 0400c648e..3971ab0f0 100644 --- a/contrib/pyln-spec/bolt7/setup.py +++ b/contrib/pyln-spec/bolt7/setup.py @@ -1,24 +1,4 @@ from pyln.spec.bolt7 import __version__, desc -from setuptools import setup -import io +from boltsetup import bolt_setup -with io.open('requirements.txt', encoding='utf-8') as f: - requirements = [r for r in f.read().split('\n') if len(r)] - - -def do_setup(boltnum: int, version: str, desc: str): - setup(name='pyln-bolt{}'.format(boltnum), - version=version, - description=desc, - url='http://github.com/ElementsProject/lightning', - author='Rusty Russell', - author_email='rusty@rustcorp.com.au', - license='MIT', - packages=['pyln.spec.bolt{}'.format(boltnum)], - package_data={'pyln.proto.message': ['py.typed']}, - scripts=[], - zip_safe=True, - install_requires=requirements) - - -do_setup(7, __version__, desc) +bolt_setup(7, __version__, desc) diff --git a/contrib/pyln-spec/boltsetup.py b/contrib/pyln-spec/boltsetup.py new file mode 100644 index 000000000..82d122205 --- /dev/null +++ b/contrib/pyln-spec/boltsetup.py @@ -0,0 +1,20 @@ +from setuptools import setup +import io + +with io.open('requirements.txt', encoding='utf-8') as f: + requirements = [r for r in f.read().split('\n') if len(r)] + + +def bolt_setup(boltnum: int, version: str, desc: str): + setup(name='pyln-bolt{}'.format(boltnum), + version=version, + description=desc, + url='http://github.com/ElementsProject/lightning', + author='Rusty Russell', + author_email='rusty@rustcorp.com.au', + license='MIT', + packages=['pyln.spec.bolt{}'.format(boltnum)], + package_data={'pyln.proto.message': ['py.typed']}, + scripts=[], + zip_safe=True, + install_requires=requirements)