git: 828a0cf90f1e - main - finance/freqtrade: New port: Crypto trading bot

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Tue, 02 Jan 2024 05:24:39 UTC
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=828a0cf90f1eb8ac1a3284ae66f7f9832b9da686

commit 828a0cf90f1eb8ac1a3284ae66f7f9832b9da686
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2024-01-02 04:37:34 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2024-01-02 05:24:33 +0000

    finance/freqtrade: New port: Crypto trading bot
---
 finance/Makefile                                  |  1 +
 finance/freqtrade/Makefile                        | 63 +++++++++++++++++++++++
 finance/freqtrade/distinfo                        |  3 ++
 finance/freqtrade/files/patch-freqtrade_worker.py | 23 +++++++++
 finance/freqtrade/files/patch-pyproject.toml      |  9 ++++
 finance/freqtrade/files/patch-setup.py            | 11 ++++
 finance/freqtrade/pkg-descr                       |  4 ++
 7 files changed, 114 insertions(+)

diff --git a/finance/Makefile b/finance/Makefile
index 142edc5d88fd..4609d5cc8a7c 100644
--- a/finance/Makefile
+++ b/finance/Makefile
@@ -27,6 +27,7 @@
     SUBDIR += fabric
     SUBDIR += fava
     SUBDIR += fixc
+    SUBDIR += freqtrade
     SUBDIR += frontaccounting
     SUBDIR += frontaccounting24
     SUBDIR += gnucash
diff --git a/finance/freqtrade/Makefile b/finance/freqtrade/Makefile
new file mode 100644
index 000000000000..21c142d4a22e
--- /dev/null
+++ b/finance/freqtrade/Makefile
@@ -0,0 +1,63 @@
+PORTNAME=	freqtrade
+DISTVERSION=	2023.12
+CATEGORIES=	finance python
+MASTER_SITES=	PYPI
+
+MAINTAINER=	yuri@FreeBSD.org
+COMMENT=	Crypto trading bot
+WWW=		https://www.freqtrade.io/
+
+LICENSE=	GPLv3
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+PY_DEPENDS=	${PYTHON_PKGNAMEPREFIX}sqlalchemy20>=2.0.6:databases/py-sqlalchemy20@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}ta-lib>0:finance/py-ta-lib@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}aiofiles>0:devel/py-aiofiles@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}aiohttp>0:www/py-aiohttp@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}arrow>=1.0.0:devel/py-arrow@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}ast-comments>0:misc/py-ast-comments@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}cachetools>0:devel/py-cachetools@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}ccxt>=4.0.0:finance/py-ccxt@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}colorama>0:devel/py-colorama@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}cryptography>=0:security/py-cryptography@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}dateutil>0:devel/py-dateutil@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}fastapi>0:www/py-fastapi@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}httpx>=0.24.1:www/py-httpx@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}janus>0:devel/py-janus@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}Jinja2>0:devel/py-Jinja2@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}joblib>=1.2.0:devel/py-joblib@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}jsonschema>0:devel/py-jsonschema@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}numpy>0:math/py-numpy@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}orjson>0:devel/py-orjson@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}packaging>0:devel/py-packaging@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}pandas-ta>0:finance/py-pandas-ta@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}pandas>0:math/py-pandas@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}prompt-toolkit>0:devel/py-prompt-toolkit@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}psutil>0:sysutils/py-psutil@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}py-find-1st>0:math/py-py-find-1st@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}pyarrow>0:databases/py-pyarrow@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}pycoingecko>0:finance/py-pycoingecko@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}pydantic2>=2.2.0:devel/py-pydantic2@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}pyjwt>0:www/py-pyjwt@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}python-rapidjson>0:devel/py-python-rapidjson@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}python-telegram-bot>0:net-im/py-python-telegram-bot@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}questionary>0:devel/py-questionary@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}requests>0:www/py-requests@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}rich>=0:textproc/py-rich@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}schedule>0:devel/py-schedule@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}tabulate>0:devel/py-tabulate@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}technical>0:finance/py-technical@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}urllib3>0:net/py-urllib3@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}uvicorn>0:www/py-uvicorn@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}websockets>0:devel/py-websockets@${PY_FLAVOR}
+BUILD_DEPENDS=	${PY_SETUPTOOLS} \
+		${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR} \
+		${PY_DEPENDS}
+RUN_DEPENDS=	${PY_DEPENDS}
+
+USES=		python
+USE_PYTHON=	pep517 concurrent autoplist pytest
+
+NO_ARCH=	yes
+
+.include <bsd.port.mk>
diff --git a/finance/freqtrade/distinfo b/finance/freqtrade/distinfo
new file mode 100644
index 000000000000..b205df53a02f
--- /dev/null
+++ b/finance/freqtrade/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1704018214
+SHA256 (freqtrade-2023.12.tar.gz) = 61526673ced27ee8d9b383757b7edd137abbb5e8b03cd2238dfca2a2121d0cb0
+SIZE (freqtrade-2023.12.tar.gz) = 512883
diff --git a/finance/freqtrade/files/patch-freqtrade_worker.py b/finance/freqtrade/files/patch-freqtrade_worker.py
new file mode 100644
index 000000000000..5239082adc6f
--- /dev/null
+++ b/finance/freqtrade/files/patch-freqtrade_worker.py
@@ -0,0 +1,23 @@
+--- freqtrade/worker.py.orig	2023-02-13 07:56:01 UTC
++++ freqtrade/worker.py
+@@ -7,7 +7,7 @@ import traceback
+ from os import getpid
+ from typing import Any, Callable, Dict, Optional
+ 
+-import sdnotify
++#import sdnotify
+ 
+ from freqtrade import __version__
+ from freqtrade.configuration import Configuration
+@@ -57,8 +57,9 @@ class Worker:
+                                                    PROCESS_THROTTLE_SECS)
+         self._heartbeat_interval = internals_config.get('heartbeat_interval', 60)
+ 
+-        self._sd_notify = sdnotify.SystemdNotifier() if \
+-            self._config.get('internals', {}).get('sd_notify', False) else None
++        #self._sd_notify = sdnotify.SystemdNotifier() if \
++        #    self._config.get('internals', {}).get('sd_notify', False) else None
++        self._sd_notify = None
+ 
+     def _notify(self, message: str) -> None:
+         """
diff --git a/finance/freqtrade/files/patch-pyproject.toml b/finance/freqtrade/files/patch-pyproject.toml
new file mode 100644
index 000000000000..89a4d57a58ed
--- /dev/null
+++ b/finance/freqtrade/files/patch-pyproject.toml
@@ -0,0 +1,9 @@
+--- pyproject.toml.orig	2023-12-30 09:59:44 UTC
++++ pyproject.toml
+@@ -1,5 +1,5 @@
+ [build-system]
+-requires = ["setuptools >= 64.0.0", "wheel"]
++requires = ["setuptools", "wheel"]
+ build-backend = "setuptools.build_meta"
+ 
+ [tool.black]
diff --git a/finance/freqtrade/files/patch-setup.py b/finance/freqtrade/files/patch-setup.py
new file mode 100644
index 000000000000..6602df38ab50
--- /dev/null
+++ b/finance/freqtrade/files/patch-setup.py
@@ -0,0 +1,11 @@
+--- setup.py.orig	2023-11-30 17:32:59 UTC
++++ setup.py
+@@ -86,7 +86,7 @@ setup(
+         'py_find_1st',
+         'python-rapidjson',
+         'orjson',
+-        'sdnotify',
++        #'sdnotify',
+         'colorama',
+         'jinja2',
+         'questionary',
diff --git a/finance/freqtrade/pkg-descr b/finance/freqtrade/pkg-descr
new file mode 100644
index 000000000000..511715400773
--- /dev/null
+++ b/finance/freqtrade/pkg-descr
@@ -0,0 +1,4 @@
+pycoingecko is Pi ython wrapper for the CoinGecko API.
+
+CoinGecko provides information about cryptocurrency prices, excghange rates,
+market caps, etc.