From f81b43d22b9744be14c90430e40392b26d1483e9 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 9 Mar 2022 13:25:21 -0500 Subject: [PATCH 1/4] Compile cairo from source --- pyproject.toml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 039f26fb..b43f6c58 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,7 +31,15 @@ test-command = "pytest --exitfirst --verbose --failed-first {package}/tests" before-all = [ # Has eigen3-devel.aarch64 "yum install -y epel-release", - "yum install -y wget freetype-devel zlib-devel libpng12-devel pixman-devel eigen3-devel cairo-devel", + "yum install -y wget freetype-devel libpng12-devel pixman-devel zlib-devel eigen3-devel", + # cairo-devel from the centos repo does not work, build here + "wget https://www.cairographics.org/snapshots/cairo-1.15.14.tar.xz --no-check-certificate", + "tar xvf cairo-*", + "cd cairo-*", + "./configure", + "make -j 20", + "make install", + "cd ..", ] repair-wheel-command = [ From 94e1bda6f4901a0a20cdcf6779e8234018255284 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 9 Mar 2022 13:25:42 -0500 Subject: [PATCH 2/4] Add test for draw import --- tests/test_main.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_main.py b/tests/test_main.py index fed63cc8..6f09b7cf 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -27,3 +27,9 @@ def test_data_dir_and_chemical_features(): m = Chem.MolFromSmiles("OCc1ccccc1CN") feats = factory.GetFeaturesForMol(m) assert len(feats) == 8 + + +def test_rdkit_chem_draw_import(): + # This segfaults if the compiled cairo version from centos is used + from rdkit.Chem.Draw import ReactionToImage + from rdkit.Chem.Draw import IPythonConsole From c82eb26de76f6f57f28fa4fc4baeb07a114ca75b Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 9 Mar 2022 13:27:13 -0500 Subject: [PATCH 3/4] Append .1 to RDKit version for PyPi --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 962e35a1..e7ec460b 100644 --- a/setup.py +++ b/setup.py @@ -255,7 +255,7 @@ def to_win_path(pt: Path): setup( name="rdkit-pypi", - version=rdkit_tag.replace("Release_", "").replace("_", "."), + version=rdkit_tag.replace("Release_", "").replace("_", ".") + ".1", description="A collection of chemoinformatics and machine-learning software written in C++ and Python", author="Christopher Kuenneth", author_email="chris@kuenneth.dev", From 75e2bd582459ddc0729ba558ae161f631f73a4c7 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 9 Mar 2022 14:12:27 -0500 Subject: [PATCH 4/4] Ooopsi --- tests/test_main.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_main.py b/tests/test_main.py index 6f09b7cf..2d626bca 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -32,4 +32,3 @@ def test_data_dir_and_chemical_features(): def test_rdkit_chem_draw_import(): # This segfaults if the compiled cairo version from centos is used from rdkit.Chem.Draw import ReactionToImage - from rdkit.Chem.Draw import IPythonConsole