From 74fd685219a30fa05165df08c13fc4eb02e44f90 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Mon, 21 Feb 2022 19:27:33 +0100 Subject: [PATCH] pyln: Fix the pyln-proto version and migrate to PEP 517 (poetry) --- contrib/pyln-proto/.gitignore | 1 + contrib/pyln-proto/pyln/proto/__init__.py | 3 +- contrib/pyln-proto/pyproject.toml | 25 +++++++++++++ contrib/pyln-proto/requirements.txt | 7 ---- contrib/pyln-proto/setup.py | 43 ----------------------- 5 files changed, 28 insertions(+), 51 deletions(-) create mode 100644 contrib/pyln-proto/.gitignore create mode 100644 contrib/pyln-proto/pyproject.toml delete mode 100644 contrib/pyln-proto/requirements.txt delete mode 100644 contrib/pyln-proto/setup.py diff --git a/contrib/pyln-proto/.gitignore b/contrib/pyln-proto/.gitignore new file mode 100644 index 000000000..c04bc49f7 --- /dev/null +++ b/contrib/pyln-proto/.gitignore @@ -0,0 +1 @@ +poetry.lock diff --git a/contrib/pyln-proto/pyln/proto/__init__.py b/contrib/pyln-proto/pyln/proto/__init__.py index d9fea85d2..2a54c4f3c 100644 --- a/contrib/pyln-proto/pyln/proto/__init__.py +++ b/contrib/pyln-proto/pyln/proto/__init__.py @@ -3,7 +3,8 @@ from .primitives import ShortChannelId, PublicKey from .invoice import Invoice from .onion import OnionPayload, TlvPayload, LegacyOnionPayload from .wire import LightningConnection, LightningServerSocket -from .__version__ import __version__ + +__version__ = "0.10.2" __all__ = [ "Invoice", diff --git a/contrib/pyln-proto/pyproject.toml b/contrib/pyln-proto/pyproject.toml new file mode 100644 index 000000000..6bb2af431 --- /dev/null +++ b/contrib/pyln-proto/pyproject.toml @@ -0,0 +1,25 @@ +[tool.poetry] +name = "pyln-proto" +version = "0.10.2" +description = "This package implements some of the Lightning Network protocol in pure python. It is intended for protocol testing and some minor tooling only. It is not deemed secure enough to handle any amount of real funds (you have been warned!)." +authors = ["Christian Decker "] +license = "BSD-MIT" + +packages = [ + { include = "pyln/proto" }, +] + +[tool.poetry.dependencies] +python = "^3.7" +base58 = "^2.1.1" +bitstring = "^3.1.9" +coincurve = "^17.0.0" +cryptography = "^36.0.1" +PySocks = "^1.7.1" + +[tool.poetry.dev-dependencies] +pytest = "^7" + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" diff --git a/contrib/pyln-proto/requirements.txt b/contrib/pyln-proto/requirements.txt deleted file mode 100644 index 0c81a83bc..000000000 --- a/contrib/pyln-proto/requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -base58 ~= 2.0.1 -bitstring ~= 3.1.6 -coincurve ~= 13.0 -cryptography ~= 3.2 -mypy>=0.790 -pysocks ~= 1.7.1 -pycparser==2.20 diff --git a/contrib/pyln-proto/setup.py b/contrib/pyln-proto/setup.py deleted file mode 100644 index 9530d8cee..000000000 --- a/contrib/pyln-proto/setup.py +++ /dev/null @@ -1,43 +0,0 @@ - -from setuptools import setup -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() - - -setup(name='pyln-proto', - description='Pure python implementation of the Lightning Network protocol', - long_description=long_description, - long_description_content_type='text/markdown', - url='http://github.com/ElementsProject/lightning', - author='Christian Decker', - author_email='decker.christian@gmail.com', - license='MIT', - packages=['pyln.proto', 'pyln.proto.message'], - package_data={'pyln.proto.message': ['py.typed']}, - scripts=[], - zip_safe=True, - use_scm_version={ - "root": "../..", - "relative_to": __file__, - "write_to": "contrib/pyln-proto/pyln/proto/__version__.py", - "write_to_template": "__version__ = \"{version}\"\n", - "version_scheme": "post-release", - "local_scheme": "no-local-version", - }, - setup_requires=["setuptools_scm"], - install_requires=requirements)