From 08bd5091a9590aeb4add2d0bb4391f5e056700c3 Mon Sep 17 00:00:00 2001 From: In-Ho Yi Date: Tue, 27 Sep 2022 20:43:31 -0400 Subject: [PATCH 1/3] Add top-level setup.py With this, we can now pip install directly from the repo dir. --- setup.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 setup.py diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..1dced98 --- /dev/null +++ b/setup.py @@ -0,0 +1,30 @@ +import io +import os +import re + +from setuptools import setup + +# Get the version from src/huggingmolecules/__init__.py +# Adapted from https://stackoverflow.com/a/39671214 +this_directory = os.path.dirname(os.path.realpath(__file__)) +init_path = os.path.join(this_directory, 'src', 'huggingmolecules', '__init__.py') +version_matches = re.search( + r'__version__\s*=\s*[\'"]([^\'"]*)[\'"]', + io.open(init_path, encoding='utf_8_sig').read(), +) +if version_matches is None: + raise Exception('Could not determine huggingmolecules version from __init__.py') +__version__ = version_matches.group(1) + +setup( + name='huggingmolecules', + version=__version__, + packages=['huggingmolecules'], + package_dir={'':'src'}, + install_requires=[ + 'torch>=1.7.0', + 'scikit-learn>=0.23.2', + 'filelock>=3.0.12', + 'gdown>=3.12.2' + ] +) From d1c4755fca541797d09337d7aa9535d296ca61d1 Mon Sep 17 00:00:00 2001 From: In-Ho Yi Date: Tue, 27 Sep 2022 20:58:41 -0400 Subject: [PATCH 2/3] Use find_package to list all packages --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 1dced98..d80e2cd 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ import os import re -from setuptools import setup +from setuptools import setup, find_packages # Get the version from src/huggingmolecules/__init__.py # Adapted from https://stackoverflow.com/a/39671214 @@ -19,7 +19,7 @@ setup( name='huggingmolecules', version=__version__, - packages=['huggingmolecules'], + packages=find_packages('src', include=['huggingmolecules*']), package_dir={'':'src'}, install_requires=[ 'torch>=1.7.0', From ebe0c9b7fe78b65136169f4dd123605d92d0a6aa Mon Sep 17 00:00:00 2001 From: In-Ho Yi Date: Tue, 27 Sep 2022 21:14:48 -0400 Subject: [PATCH 3/3] Add rdkit and setuptools as requirements --- setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d80e2cd..df6b913 100644 --- a/setup.py +++ b/setup.py @@ -25,6 +25,8 @@ 'torch>=1.7.0', 'scikit-learn>=0.23.2', 'filelock>=3.0.12', - 'gdown>=3.12.2' + 'gdown>=3.12.2', + 'rdkit', + 'setuptools', ] )