From 6bb98acca47a478ebd1314f1368b80ce264bddad Mon Sep 17 00:00:00 2001 From: Gianluca Micchi Date: Tue, 6 Dec 2022 16:38:01 +0000 Subject: [PATCH 1/2] Add a setup.py --- setup.py | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 setup.py diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..e34737df --- /dev/null +++ b/setup.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python + +from distutils.core import setup +from pathlib import Path + +from setuptools import find_packages + + +def read_version() -> str: + """ + This script reads the information inside AugmentedNet/__init__.py without + importing the package, which is not allowed inside the setup.py file + """ + version = None + + with open(Path(__file__).parent / "AugmentedNet" / "__init__.py", "r") as f: + lines = f.readlines() + + for line in lines: + if line.startswith("__version__"): + version = line.split('"')[1] + if version is None: + raise RuntimeError( + "Can't read package version from file AugmentedNet/__init__.py" + ) + return version + + +setup( + name="AugmentedNet", + version=read_version(), + description="A Roman Numeral Analysis Network with Synthetic Training Examples and Additional Tonal Tasks", + author="Néstor Nápoles López", + author_email="", + url="https://github.com/napulen/AugmentedNet/", + python_requires=">=3.7", + install_requires=[ + "music21>=6.7,<7", + "numpy>=1.19,<2", + "pandas>=1.4,<2", + "tensorflow>=2.5,<3", + "mlflow>=1.23<2", + ], + packages=find_packages(), +) From 663377260449ca29faaded82561aa17fc732f8e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A9stor=20N=C3=A1poles=20L=C3=B3pez?= Date: Tue, 3 Jan 2023 21:22:51 -0500 Subject: [PATCH 2/2] setup.py: format with black; add email --- setup.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index e34737df..5fa4795f 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,6 @@ from distutils.core import setup from pathlib import Path - from setuptools import find_packages @@ -13,7 +12,9 @@ def read_version() -> str: """ version = None - with open(Path(__file__).parent / "AugmentedNet" / "__init__.py", "r") as f: + with open( + Path(__file__).parent / "AugmentedNet" / "__init__.py", "r" + ) as f: lines = f.readlines() for line in lines: @@ -31,7 +32,7 @@ def read_version() -> str: version=read_version(), description="A Roman Numeral Analysis Network with Synthetic Training Examples and Additional Tonal Tasks", author="Néstor Nápoles López", - author_email="", + author_email="napulen@gmail.com", url="https://github.com/napulen/AugmentedNet/", python_requires=">=3.7", install_requires=[