File: setup.py

package info (click to toggle)
abinit 9.10.4-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 518,712 kB
  • sloc: xml: 877,568; f90: 577,240; python: 80,760; perl: 7,019; ansic: 4,585; sh: 1,925; javascript: 601; fortran: 557; cpp: 454; objc: 323; makefile: 77; csh: 42; pascal: 31
file content (96 lines) | stat: -rw-r--r-- 2,849 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# coding: utf-8

import os
from glob import glob

from setuptools import setup, find_packages

#---------------------------------------------------------------------------
# Basic project information
#---------------------------------------------------------------------------

# release.py contains version, authors, license, url, keywords, etc.
release_file = os.path.join('ElectronPhononCoupling', 'config', 'release.py')

with open(release_file) as f:
    code = compile(f.read(), release_file, 'exec')
    exec(code)


#---------------------------------------------------------------------------
# Find scripts
#---------------------------------------------------------------------------

def get_long_desc():
    with open("README.rst") as f:
        return f.read()

def write_manifest():
    # FIXME need a more flexible formulation for data files to exclude.
    content = """
    include *.rst
    recursive-include ElectronPhononCoupling *.py
    recursive-include ElectronPhononCoupling/scripts *
    recursive-include ElectronPhononCoupling/data *
    prune ElectronPhononCoupling/data/LiF_g2/epc_inputs/output
    graft Examples
    exclude Examples/Calculations/*/odat*
    exclude Examples/Calculations/*/*.out*
    exclude Examples/Calculations/*/*.log*
    exclude Examples/Calculations/*/*fort*
    exclude Examples/Out/*
    """
    with open('MANIFEST.in', 'write') as f:
        for line in content.strip().splitlines():
            f.write(line.strip() + '\n')


def find_package_data(dirname):
    paths = []
    for (path, directories, filenames) in os.walk(dirname):
        for filename in filenames:
            # We need the path relative to the main source directory.
            paths.append(os.path.join('..', path, filename))
    return paths

#---------------------------------------------------------------------------
# Setup
#---------------------------------------------------------------------------

write_manifest()

install_requires = [
    'numpy >=1.8',
    'mpi4py >=2.0',
    'netCDF4 >=1.2',
    ]


my_package_data = {'' :
    find_package_data('ElectronPhononCoupling/data/Psps_for_tests')
  + find_package_data('ElectronPhononCoupling/data/LiF_g2')
  + find_package_data('ElectronPhononCoupling/data/LiF_g4')
    }

my_exclude_package_data = {
    }


setup_args = dict(
      name             = name,
      version          = __version__,
      description      = description,
      long_description = long_description,
      author           = author,
      author_email     = author_email,
      url              = url,
      license          = license,
      packages         = find_packages(),
      package_data     = my_package_data,
      exclude_package_data = my_exclude_package_data,
      install_requires = install_requires,
      )

if __name__ == "__main__":
    setup(**setup_args)