forked from AnMoreau/PyMoosh
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
60 lines (51 loc) · 2.23 KB
/
setup.py
File metadata and controls
60 lines (51 loc) · 2.23 KB
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
import re
import os
from setuptools import setup, find_packages
# =============================================================================
# helper functions to extract meta-info from package
# =============================================================================
def read_version_file(*parts):
return open(os.path.join(*parts), 'r').read()
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
def find_version(*file_paths):
version_file = read_version_file(*file_paths)
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")
def find_name(*file_paths):
version_file = read_version_file(*file_paths)
version_match = re.search(r"^__name__ = ['\"]([^'\"]*)['\"]",
version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find name string.")
def find_author(*file_paths):
version_file = read_version_file(*file_paths)
version_match = re.search(r"^__author__ = ['\"]([^'\"]*)['\"]",
version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find author string.")
# =============================================================================
# setup
# =============================================================================
setup(
name = find_name("PyMoosh", "__init__.py"),
version = find_version("PyMoosh", "__init__.py"),
author = find_author("PyMoosh", "__init__.py"),
author_email='antoine.moreau@uca.fr',
license='GPLv3+',
packages=['PyMoosh'],
include_package_data=True, # add data folder containing material dispersions
description = ("A scattering matrix formalism to solve Maxwell's equations " +
"in a multilayered structure."),
long_description=read('README.md'),
url='https://github.com/AnMoreau/PyMoosh',
keywords=['Moosh','Maxwell','Optics','Multilayers','Plasmonics','Photovoltaics'],
install_requires=[
'numpy','matplotlib','scipy'
],
)