We will start out with the following file tree:
.
├── account
│ ├── account.h
│ ├── CMakeLists.txt
│ ├── implementation
│ │ └── fortran_implementation.f90
│ ├── __init__.py
│ ├── interface_file_names.cfg.in
│ ├── test.py
│ └── version.py
├── CMakeLists.txt
├── MANIFEST.in
├── README.rst
└── setup.py
The top-level CMakeLists.txt file and all sources below account, except account/CMakeLists.txt, are unchanged from how they appeared in Chapter 9, Mixed-language Projects, Recipe 6, Mixing C, C++, Fortran, and Python using Python CFFI. We will shortly discuss the small changes we need to apply to account/CMakeLists.txt. The README.rst file is identical with the previous recipe. The setup.py script contains one extra line compared to the previous recipe (the line containing install_requires=['cffi']):
# ... up to this line the script is unchanged
setup(
name=_this_package,
version=version['__version__'],
description='Description in here.',
long_description=long_description,
author='Bruce Wayne',
author_email='bruce.wayne@example.com',
url='http://example.com',
license='MIT',
packages=[_this_package],
install_requires=['cffi'],
include_package_data=True,
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Science/Research',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.6'
],
cmdclass={'build': extend_build()})
MANIFEST.in lists files that should be installed along with the Python modules and packages and contains the following:
include README.rst CMakeLists.txt
recursive-include account *.h *.f90 CMakeLists.txt
Under the account subdirectory, we see two new files. Again, there is a version.py file holding the project version for setup.py:
__version__ = '0.0.0'
The subdirectory also holds the interface_file_names.cfg.in file, which we will be discussing soon:
[configuration]
header_file_name = account.h
library_file_name = $<TARGET_FILE_NAME:account>