Skip to content

Commit

Permalink
Updating the pyproject.toml to work with the extension
Browse files Browse the repository at this point in the history
  • Loading branch information
bieniekmateusz committed Aug 19, 2023
1 parent 6d1860f commit de4cbd5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 19 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[build-system]
requires = ["setuptools"]
requires = ["setuptools", "numpy", "cython"]
build-backend = "setuptools.build_meta"
21 changes: 4 additions & 17 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,15 @@
from setuptools import setup, find_packages
from distutils.extension import Extension

# pyqcprot module for the rotation matrix
import numpy
numpy_include = numpy.get_include()

# handle cython modules: pyqcprot module for the rotation matrix
try:
from Cython.Distutils import build_ext
use_cython = True
cmdclass = {'build_ext': build_ext}
except ImportError:
use_cython = False
cmdclass = {}
finally:
print (f'use_cython: {use_cython}')

ext_modules = [Extension("ties/pyqcprotext/pyqcprot", [f"ties/pyqcprotext/pyqcprot.{'pyx' if use_cython else 'c'}"],
include_dirs=[numpy_include],
ext_modules = [Extension("ties.pyqcprotext.pyqcprot", ["ties/pyqcprotext/pyqcprot.pyx"],
include_dirs=[numpy.get_include()],
extra_compile_args=["-O3","-ffast-math"])]

setup(
name='ties',
version='20.10',
version=open("ties/version.txt").read().strip(),
description='TIES: Thermodynamic Integration with Enhanced Sampling',
long_description='Copy from README file',
url='http://ccs.chem.ucl.ac.uk',
Expand All @@ -34,6 +22,5 @@
'ties = ties:cli.command_line_script'
]
},
cmdclass = cmdclass,
ext_modules = ext_modules,
)
2 changes: 1 addition & 1 deletion ties/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.6.0
23.6.0

0 comments on commit de4cbd5

Please sign in to comment.