From f5ce6524a727ed5ffab913420a41bea210b3db84 Mon Sep 17 00:00:00 2001 From: lartpang Date: Wed, 31 Mar 2021 19:44:49 +0800 Subject: [PATCH] fix error in `setup.py` --- py_sod_metrics/sod_metrics.py | 1 - setup.py | 5 +++-- version.txt | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 version.txt diff --git a/py_sod_metrics/sod_metrics.py b/py_sod_metrics/sod_metrics.py index 59413ec..16c3b5e 100644 --- a/py_sod_metrics/sod_metrics.py +++ b/py_sod_metrics/sod_metrics.py @@ -5,7 +5,6 @@ _EPS = 1e-16 _TYPE = np.float64 -__version__ = "1.2.4" def _prepare_data(pred: np.ndarray, gt: np.ndarray) -> tuple: diff --git a/setup.py b/setup.py index e7db716..18450a0 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,8 @@ from setuptools import find_packages, setup -from py_sod_metrics.sod_metrics import __version__ +with open("./version.txt", encoding="utf-8", mode="r") as f: + version = f.readline().strip() with open("readme.md", "r") as fh: long_description = fh.read() @@ -10,7 +11,7 @@ setup( name="pysodmetrics", packages=find_packages(), - version=__version__, + version=version, license="MIT", description="A simple and efficient implementation of SOD metrics.", long_description=long_description, diff --git a/version.txt b/version.txt new file mode 100644 index 0000000..e8ea05d --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +1.2.4