-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build an rmgmolecule package in place, fix conda builds
- small updates to rmg-py recipe - removed conda_build.yml action since it will now be done in a private repo - added a recipe for rmgmolecule - add warnings on molecule when running from rmgmolecule that some functionality is not available
- Loading branch information
1 parent
87b96e1
commit bd8f7c3
Showing
9 changed files
with
261 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Install rmgmolecule | ||
python rmgmolecule_setup.py install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
numpy: | ||
- 1.19 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# meta.yaml - package specification for rmgmolecule subpackage | ||
package: | ||
name: rmgmolecule | ||
version: 1.0.0 | ||
|
||
source: | ||
path: ../ | ||
|
||
build: | ||
number: {{ environ.get('GIT_DESCRIBE_NUMBER', 0) }} | ||
|
||
requirements: | ||
build: | ||
- {{ compiler('c') }} # [unix] | ||
host: | ||
- cython >=0.25.2 | ||
- lpsolve55 | ||
- numpy | ||
- openbabel >=3 | ||
- pyrdl | ||
- python==3.7 | ||
- quantities | ||
- rdkit >=2018 | ||
- scipy | ||
- scikit-learn | ||
- setuptools | ||
run: | ||
- cairo | ||
- cairocffi | ||
- cython >=0.25.2 | ||
- gprof2dot | ||
- graphviz | ||
- jinja2 | ||
- jupyter | ||
- lpsolve55 | ||
- {{ pin_compatible('numpy') }} | ||
- openbabel >=3 | ||
- pydot | ||
- pyrdl | ||
- python==3.7 | ||
- quantities | ||
- rdkit >=2018 | ||
- scikit-learn | ||
test: | ||
imports: | ||
- rmgpy.molecule | ||
commands: | ||
- python -c 'from rmgpy.molecule import Molecule; mol=Molecule().from_smiles("CC")' | ||
|
||
about: | ||
home: https://github.com/ReactionMechanismGenerator/RMG-Py | ||
license: MIT | ||
summary: "The ReactionMechanismGenerator Molecule Subpackage" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,176 @@ | ||
import sys | ||
import os | ||
from collections import OrderedDict | ||
|
||
try: | ||
from distutils.core import setup | ||
from distutils.extension import Extension | ||
except ImportError: | ||
print("The distutils package is required to build or install RMG Py.") | ||
raise | ||
|
||
try: | ||
from Cython.Build import cythonize | ||
from Cython.Compiler import Options | ||
except ImportError: | ||
print("Cython (http://www.cython.org/) is required to build or install RMG Py.") | ||
raise | ||
|
||
try: | ||
import numpy | ||
except ImportError: | ||
print("NumPy (http://numpy.scipy.org/) is required to build or install RMG Py.") | ||
raise | ||
|
||
# Create annotated HTML files for each of the Cython modules | ||
Options.annotate = True | ||
|
||
directives = { | ||
# Set input language version to python 3 | ||
"language_level": 3, | ||
# Turn on profiling capacity for all Cython modules | ||
# 'profile': True, | ||
# Embed call signatures in cythonized files - enable when building documentation | ||
# 'embedsignature': True, | ||
} | ||
|
||
|
||
main_ext_modules = [ | ||
# Molecules and molecular representations | ||
Extension( | ||
"rmgpy.molecule.atomtype", | ||
["rmgpy/molecule/atomtype.py"], | ||
include_dirs=["."], | ||
), | ||
Extension( | ||
"rmgpy.molecule.element", | ||
["rmgpy/molecule/element.py"], | ||
include_dirs=["."], | ||
), | ||
Extension( | ||
"rmgpy.molecule.graph", | ||
["rmgpy/molecule/graph.pyx"], | ||
include_dirs=["."], | ||
), | ||
Extension( | ||
"rmgpy.molecule.group", | ||
["rmgpy/molecule/group.py"], | ||
include_dirs=["."], | ||
), | ||
Extension( | ||
"rmgpy.molecule.molecule", | ||
["rmgpy/molecule/molecule.py"], | ||
include_dirs=["."], | ||
), | ||
Extension( | ||
"rmgpy.molecule.symmetry", | ||
["rmgpy/molecule/symmetry.py"], | ||
include_dirs=["."], | ||
), | ||
Extension( | ||
"rmgpy.molecule.vf2", | ||
["rmgpy/molecule/vf2.pyx"], | ||
include_dirs=["."], | ||
), | ||
Extension( | ||
"rmgpy.molecule.converter", | ||
["rmgpy/molecule/converter.py"], | ||
include_dirs=["."], | ||
), | ||
Extension( | ||
"rmgpy.molecule.translator", | ||
["rmgpy/molecule/translator.py"], | ||
include_dirs=["."], | ||
), | ||
Extension( | ||
"rmgpy.molecule.util", | ||
["rmgpy/molecule/util.py"], | ||
include_dirs=["."], | ||
), | ||
Extension( | ||
"rmgpy.molecule.inchi", | ||
["rmgpy/molecule/inchi.py"], | ||
include_dirs=["."], | ||
), | ||
Extension( | ||
"rmgpy.molecule.resonance", | ||
["rmgpy/molecule/resonance.py"], | ||
include_dirs=["."], | ||
), | ||
Extension( | ||
"rmgpy.molecule.pathfinder", | ||
["rmgpy/molecule/pathfinder.py"], | ||
include_dirs=["."], | ||
), | ||
Extension( | ||
"rmgpy.molecule.kekulize", | ||
["rmgpy/molecule/kekulize.pyx"], | ||
include_dirs=["."], | ||
), | ||
Extension( | ||
"rmgpy.constants", | ||
["rmgpy/constants.py"], | ||
include_dirs=["."], | ||
), | ||
Extension( | ||
"rmgpy.quantity", | ||
["rmgpy/quantity.py"], | ||
include_dirs=["."], | ||
), | ||
Extension( | ||
"rmgpy.rmgobject", | ||
["rmgpy/rmgobject.pyx"], | ||
), | ||
] | ||
|
||
ext_modules = [] | ||
if "install" in sys.argv: | ||
# This is so users can still do simply `python setup.py install` | ||
ext_modules.extend(main_ext_modules) | ||
if "main" in sys.argv: | ||
# This is for `python setup.py build_ext main` | ||
sys.argv.remove("main") | ||
ext_modules.extend(main_ext_modules) | ||
if "minimal" in sys.argv: | ||
# This starts with the full install list, but removes anything that has a pure python mode | ||
# i.e. in only includes things whose source is .pyx | ||
sys.argv.remove("minimal") | ||
temporary_list = [] | ||
temporary_list.extend(main_ext_modules) | ||
for module in temporary_list: | ||
for source in module.sources: | ||
if os.path.splitext(source)[1] == ".pyx": | ||
ext_modules.append(module) | ||
|
||
# Remove duplicates while preserving order: | ||
ext_modules = list(OrderedDict.fromkeys(ext_modules)) | ||
|
||
scripts = [] | ||
|
||
modules = ["rmgpy.exceptions", "rmgpy.version"] | ||
|
||
__version__ = "1.0.0" | ||
|
||
import logging | ||
|
||
logging.error(ext_modules) | ||
# Initiate the build and/or installation | ||
setup( | ||
name="RMG-Py", | ||
version=__version__, | ||
description="Reaction Mechanism Generator", | ||
author="William H. Green and the RMG Team", | ||
author_email="[email protected]", | ||
url="http://reactionmechanismgenerator.github.io", | ||
packages=[ | ||
"rmgpy.molecule", | ||
], | ||
py_modules=modules, | ||
scripts=scripts, | ||
ext_modules=cythonize( | ||
ext_modules, | ||
build_dir="build", | ||
compiler_directives=directives, | ||
), | ||
include_dirs=[".", numpy.get_include()], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters