Completed
Pull Request — master (#20)
by
unknown
03:41
created

setup.read()   A

Complexity

Conditions 1

Size

Total Lines 5
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nop 2
1
#!/usr/bin/env python
2
# -*- encoding: utf-8 -*-
3
import os
4
5
# Include extensions only when not on readthedocs.org
6
if os.environ.get('READTHEDOCS', None) == 'True':
7
    from setuptools import setup
8
    from distutils.core import Extension
9
    extensions = []
10
else:
11
    from numpy.distutils.core import setup, Extension
12
13
    # add MinGW to Windows only, if needed
14
    if os.name == 'nt':
15
        sfn = os.path.join(os.path.dirname(__file__), 'setup.cfg')
16
        stxt = open(sfn).read()
17
        if '[build_ext]' not in stxt:
18
            with open(sfn, 'a') as f:
19
                f.write("\n[build_ext]\ncompiler = mingw32")
20
21
    extensions = [
22
        Extension(name='apexpy.fortranapex',
23
                  sources=['src/fortranapex/magfld.f', 'src/fortranapex/apex.f',
24
                           'src/fortranapex/makeapexsh.f90',
25
                           'src/fortranapex/apexsh.f90',
26
                           'src/fortranapex/checkapexsh.f90'])]
27
28
setup(ext_modules=extensions)
29