From 9773b3092b2555a26c987aa19afec377b66804e9 Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Tue, 25 Jan 2022 14:10:19 +0100 Subject: [PATCH 1/6] Simplify installation The pyproject.toml should tell build systems that torch needs to be available _before_ installation so there's no issues with the torch_scatter --- pyproject.toml | 7 ++++++- setup.py | 3 ++- tox.ini | 6 ++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 471f3c9..d6f9675 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,8 @@ +# See https://setuptools.readthedocs.io/en/latest/build_meta.html +[build-system] +requires = ["setuptools", "wheel", "torch"] +build-backend = "setuptools.build_meta:__legacy__" + [tool.black] line-length = 120 target-version = ["py37", "py38", "py39"] @@ -6,4 +11,4 @@ target-version = ["py37", "py38", "py39"] profile = "black" multi_line_output = 3 include_trailing_comma = true -reverse_relative = true \ No newline at end of file +reverse_relative = true diff --git a/setup.py b/setup.py index f5264d1..c6e5b90 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,8 @@ setup_requires = ["pytest-runner"] -tests_require = ["pytest", "pytest-cov"] +tests_require = ["pytest", "pytest-cov", "coverage"] + extras_require = { "tests": tests_require, diff --git a/tox.ini b/tox.ini index a45dc17..1c30aef 100644 --- a/tox.ini +++ b/tox.ini @@ -16,10 +16,8 @@ envlist = [testenv] commands = coverage run -m pytest -deps = - torch - pytest - coverage +extras = + tests [testenv:coverage] commands = From 905c814450ba372e4309ec82f0c9f9aa6215a6f9 Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Fri, 28 Jan 2022 21:53:18 +0100 Subject: [PATCH 2/6] Update setup configuration --- setup.cfg | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 75 ------------------------------------------------- tox.ini | 1 + 3 files changed, 84 insertions(+), 75 deletions(-) delete mode 100644 setup.py diff --git a/setup.cfg b/setup.cfg index 95b61ac..f805138 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,5 +2,88 @@ # Setup.py Configuration # ########################## [metadata] +name = chemicalx +version = 0.0.8 +description = A Deep Learning Library for Drug Pair Scoring long_description = file: README.md long_description_content_type = text/markdown + +# Links +url = https://github.com/AstraZeneca/chemicalx +download_url = https://github.com/AstraZeneca/chemicalx/archive/v0.0.8.tar.gz +project_urls = + Bug Tracker = https://github.com/AstraZeneca/chemicalx/issues + + +# Author information +author = Benedek Rozemberczki and Charles Hoyt +author_email = benedek.rozemberczki@gmail.com +maintainer = Benedek Rozemberczki +maintainer_email = benedek.rozemberczki@gmail.com + +# License information +license = Apache-2.0 +license_file = LICENSE + +# Search tags +classifiers = + Development Status :: 3 - Alpha + Intended Audience :: Developers + Topic :: Software Development :: Build Tools + License :: OSI Approved :: Apache Software License + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 +keywords = + drug + deep-learning + deep-chemistry + deep-ai + torch-drug + synergy-prediction + synergy + drug-combination + deep-synergy + drug-interaction + chemistry + pharma + +[options] +install_requires = + numpy + torch>=1.10.0 + torchdrug + torch-scatter>=2.0.8 + pandas<=1.3.5 + tqdm + scikit-learn + class-resolver>=0.2.1 + tabulate + pystow + pytdc + +zip_safe = false +include_package_data = True +python_requires = >=3.7 + +# Where is my code +packages = find: +package_dir = + = src + +[options.packages.find] +where = src + +[options.extras_require] +tests = + pytest + pytest-cov + coverage +docs = + sphinx + sphinx-rtd-theme + sphinx-click + sphinx-autodoc-typehints + sphinx_automodapi + nbsphinx_link + jupyter-sphinx diff --git a/setup.py b/setup.py deleted file mode 100644 index c6e5b90..0000000 --- a/setup.py +++ /dev/null @@ -1,75 +0,0 @@ -"""Setup the package.""" - -from setuptools import find_packages, setup - -install_requires = [ - "numpy", - "torch>=1.10.0", - "torchdrug", - "torch-scatter>=2.0.8", - "pandas<=1.3.5", - "tqdm", - "scikit-learn", - "class-resolver", -] - - -setup_requires = ["pytest-runner"] - -tests_require = ["pytest", "pytest-cov", "coverage"] - - -extras_require = { - "tests": tests_require, - "docs": [ - "sphinx", - "sphinx-rtd-theme", - "sphinx-click", - "sphinx-autodoc-typehints", - "sphinx_automodapi", - "nbsphinx_link", - "jupyter-sphinx", - ], -} - -keywords = [ - "drug", - "deep-learning", - "deep-chemistry", - "deep-ai", - "torch-drug", - "synergy-prediction", - "synergy", - "drug-combination", - "deep-synergy", - "drug-interaction", - "chemistry", - "pharma", -] - - -setup( - name="chemicalx", - packages=find_packages(), - version="0.0.8", - license="Apache License, Version 2.0", - description="A Deep Learning Library for Drug Pair Scoring.", - author="Benedek Rozemberczki and Charles Hoyt", - author_email="benedek.rozemberczki@gmail.com", - url="https://github.com/AstraZeneca/chemicalx", - download_url="https://github.com/AstraZeneca/chemicalx/archive/v0.0.8.tar.gz", - keywords=keywords, - install_requires=install_requires, - setup_requires=setup_requires, - tests_require=tests_require, - extras_require=extras_require, - classifiers=[ - "Development Status :: 3 - Alpha", - "Intended Audience :: Developers", - "Topic :: Software Development :: Build Tools", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - ], -) diff --git a/tox.ini b/tox.ini index 1c30aef..c12f1e5 100644 --- a/tox.ini +++ b/tox.ini @@ -4,6 +4,7 @@ # and then run "tox" from this directory. [tox] +isolated_build = true envlist = lint flake8 From 49fe46894c93dcbfe514c8885315ba9d80be2fc4 Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Fri, 28 Jan 2022 21:59:48 +0100 Subject: [PATCH 3/6] Update to src layout --- {chemicalx => src/chemicalx}/__init__.py | 0 {chemicalx => src/chemicalx}/constants.py | 0 {chemicalx => src/chemicalx}/data/__init__.py | 0 {chemicalx => src/chemicalx}/data/batchgenerator.py | 0 {chemicalx => src/chemicalx}/data/contextfeatureset.py | 0 {chemicalx => src/chemicalx}/data/datasetloader.py | 0 {chemicalx => src/chemicalx}/data/drugfeatureset.py | 0 {chemicalx => src/chemicalx}/data/drugpairbatch.py | 0 {chemicalx => src/chemicalx}/data/labeledtriples.py | 0 {chemicalx => src/chemicalx}/models/__init__.py | 0 {chemicalx => src/chemicalx}/models/base.py | 0 {chemicalx => src/chemicalx}/models/caster.py | 0 {chemicalx => src/chemicalx}/models/deepddi.py | 0 {chemicalx => src/chemicalx}/models/deepdds.py | 0 {chemicalx => src/chemicalx}/models/deepdrug.py | 0 {chemicalx => src/chemicalx}/models/deepsynergy.py | 0 {chemicalx => src/chemicalx}/models/epgcnds.py | 0 {chemicalx => src/chemicalx}/models/gcnbmp.py | 0 {chemicalx => src/chemicalx}/models/matchmaker.py | 0 {chemicalx => src/chemicalx}/models/mhcaddi.py | 0 {chemicalx => src/chemicalx}/models/mrgnn.py | 0 {chemicalx => src/chemicalx}/models/ssiddi.py | 0 {chemicalx => src/chemicalx}/pipeline.py | 0 {chemicalx => src/chemicalx}/version.py | 0 24 files changed, 0 insertions(+), 0 deletions(-) rename {chemicalx => src/chemicalx}/__init__.py (100%) rename {chemicalx => src/chemicalx}/constants.py (100%) rename {chemicalx => src/chemicalx}/data/__init__.py (100%) rename {chemicalx => src/chemicalx}/data/batchgenerator.py (100%) rename {chemicalx => src/chemicalx}/data/contextfeatureset.py (100%) rename {chemicalx => src/chemicalx}/data/datasetloader.py (100%) rename {chemicalx => src/chemicalx}/data/drugfeatureset.py (100%) rename {chemicalx => src/chemicalx}/data/drugpairbatch.py (100%) rename {chemicalx => src/chemicalx}/data/labeledtriples.py (100%) rename {chemicalx => src/chemicalx}/models/__init__.py (100%) rename {chemicalx => src/chemicalx}/models/base.py (100%) rename {chemicalx => src/chemicalx}/models/caster.py (100%) rename {chemicalx => src/chemicalx}/models/deepddi.py (100%) rename {chemicalx => src/chemicalx}/models/deepdds.py (100%) rename {chemicalx => src/chemicalx}/models/deepdrug.py (100%) rename {chemicalx => src/chemicalx}/models/deepsynergy.py (100%) rename {chemicalx => src/chemicalx}/models/epgcnds.py (100%) rename {chemicalx => src/chemicalx}/models/gcnbmp.py (100%) rename {chemicalx => src/chemicalx}/models/matchmaker.py (100%) rename {chemicalx => src/chemicalx}/models/mhcaddi.py (100%) rename {chemicalx => src/chemicalx}/models/mrgnn.py (100%) rename {chemicalx => src/chemicalx}/models/ssiddi.py (100%) rename {chemicalx => src/chemicalx}/pipeline.py (100%) rename {chemicalx => src/chemicalx}/version.py (100%) diff --git a/chemicalx/__init__.py b/src/chemicalx/__init__.py similarity index 100% rename from chemicalx/__init__.py rename to src/chemicalx/__init__.py diff --git a/chemicalx/constants.py b/src/chemicalx/constants.py similarity index 100% rename from chemicalx/constants.py rename to src/chemicalx/constants.py diff --git a/chemicalx/data/__init__.py b/src/chemicalx/data/__init__.py similarity index 100% rename from chemicalx/data/__init__.py rename to src/chemicalx/data/__init__.py diff --git a/chemicalx/data/batchgenerator.py b/src/chemicalx/data/batchgenerator.py similarity index 100% rename from chemicalx/data/batchgenerator.py rename to src/chemicalx/data/batchgenerator.py diff --git a/chemicalx/data/contextfeatureset.py b/src/chemicalx/data/contextfeatureset.py similarity index 100% rename from chemicalx/data/contextfeatureset.py rename to src/chemicalx/data/contextfeatureset.py diff --git a/chemicalx/data/datasetloader.py b/src/chemicalx/data/datasetloader.py similarity index 100% rename from chemicalx/data/datasetloader.py rename to src/chemicalx/data/datasetloader.py diff --git a/chemicalx/data/drugfeatureset.py b/src/chemicalx/data/drugfeatureset.py similarity index 100% rename from chemicalx/data/drugfeatureset.py rename to src/chemicalx/data/drugfeatureset.py diff --git a/chemicalx/data/drugpairbatch.py b/src/chemicalx/data/drugpairbatch.py similarity index 100% rename from chemicalx/data/drugpairbatch.py rename to src/chemicalx/data/drugpairbatch.py diff --git a/chemicalx/data/labeledtriples.py b/src/chemicalx/data/labeledtriples.py similarity index 100% rename from chemicalx/data/labeledtriples.py rename to src/chemicalx/data/labeledtriples.py diff --git a/chemicalx/models/__init__.py b/src/chemicalx/models/__init__.py similarity index 100% rename from chemicalx/models/__init__.py rename to src/chemicalx/models/__init__.py diff --git a/chemicalx/models/base.py b/src/chemicalx/models/base.py similarity index 100% rename from chemicalx/models/base.py rename to src/chemicalx/models/base.py diff --git a/chemicalx/models/caster.py b/src/chemicalx/models/caster.py similarity index 100% rename from chemicalx/models/caster.py rename to src/chemicalx/models/caster.py diff --git a/chemicalx/models/deepddi.py b/src/chemicalx/models/deepddi.py similarity index 100% rename from chemicalx/models/deepddi.py rename to src/chemicalx/models/deepddi.py diff --git a/chemicalx/models/deepdds.py b/src/chemicalx/models/deepdds.py similarity index 100% rename from chemicalx/models/deepdds.py rename to src/chemicalx/models/deepdds.py diff --git a/chemicalx/models/deepdrug.py b/src/chemicalx/models/deepdrug.py similarity index 100% rename from chemicalx/models/deepdrug.py rename to src/chemicalx/models/deepdrug.py diff --git a/chemicalx/models/deepsynergy.py b/src/chemicalx/models/deepsynergy.py similarity index 100% rename from chemicalx/models/deepsynergy.py rename to src/chemicalx/models/deepsynergy.py diff --git a/chemicalx/models/epgcnds.py b/src/chemicalx/models/epgcnds.py similarity index 100% rename from chemicalx/models/epgcnds.py rename to src/chemicalx/models/epgcnds.py diff --git a/chemicalx/models/gcnbmp.py b/src/chemicalx/models/gcnbmp.py similarity index 100% rename from chemicalx/models/gcnbmp.py rename to src/chemicalx/models/gcnbmp.py diff --git a/chemicalx/models/matchmaker.py b/src/chemicalx/models/matchmaker.py similarity index 100% rename from chemicalx/models/matchmaker.py rename to src/chemicalx/models/matchmaker.py diff --git a/chemicalx/models/mhcaddi.py b/src/chemicalx/models/mhcaddi.py similarity index 100% rename from chemicalx/models/mhcaddi.py rename to src/chemicalx/models/mhcaddi.py diff --git a/chemicalx/models/mrgnn.py b/src/chemicalx/models/mrgnn.py similarity index 100% rename from chemicalx/models/mrgnn.py rename to src/chemicalx/models/mrgnn.py diff --git a/chemicalx/models/ssiddi.py b/src/chemicalx/models/ssiddi.py similarity index 100% rename from chemicalx/models/ssiddi.py rename to src/chemicalx/models/ssiddi.py diff --git a/chemicalx/pipeline.py b/src/chemicalx/pipeline.py similarity index 100% rename from chemicalx/pipeline.py rename to src/chemicalx/pipeline.py diff --git a/chemicalx/version.py b/src/chemicalx/version.py similarity index 100% rename from chemicalx/version.py rename to src/chemicalx/version.py From ba1395ec36c640b60470deb20e8c4986b4344098 Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Fri, 28 Jan 2022 22:05:58 +0100 Subject: [PATCH 4/6] Update setup.cfg --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index f805138..358bd50 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,7 +16,7 @@ project_urls = # Author information -author = Benedek Rozemberczki and Charles Hoyt +author = Benedek Rozemberczki and Charles Tapley Hoyt author_email = benedek.rozemberczki@gmail.com maintainer = Benedek Rozemberczki maintainer_email = benedek.rozemberczki@gmail.com From a32655878591d0b302bde9ac71d3e99843f15e80 Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Fri, 28 Jan 2022 22:06:03 +0100 Subject: [PATCH 5/6] Update readthedocs.yaml --- readthedocs.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/readthedocs.yaml b/readthedocs.yaml index 569cf45..afbfaf9 100644 --- a/readthedocs.yaml +++ b/readthedocs.yaml @@ -13,9 +13,8 @@ formats: python: version: "3.7" - system_packages: "True" install: - requirements: docs/requirements_1.txt - - method: setuptools + - method: pip path: . system_packages: true From e60bbf975a2668ff157ed714e690d2f4f2686ba9 Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Tue, 1 Feb 2022 17:06:41 +0100 Subject: [PATCH 6/6] Update tox.ini --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index c12f1e5..2f3628b 100644 --- a/tox.ini +++ b/tox.ini @@ -98,7 +98,7 @@ skip_install = true deps = docstr-coverage commands = - docstr-coverage chemicalx/ examples/ tests/ data_cleaning/ --skip-private --skip-magic + docstr-coverage src/chemicalx examples/ tests/ data_cleaning/ --skip-private --skip-magic description = Run the docstr-coverage tool to check documentation coverage [testenv:pyroma]