|
3 | 3 | import os
|
4 | 4 |
|
5 | 5 | try:
|
6 |
| - from setuptools import setup, find_namespace_packages |
| 6 | + from setuptools import setup |
7 | 7 | from setuptools.extension import Extension
|
8 | 8 | except ImportError:
|
9 |
| - raise RuntimeError('setuptools is required') |
| 9 | + raise RuntimeError("setuptools is required") |
10 | 10 |
|
| 11 | +URL = "https://github.com/pvlib/pvlib-python" |
11 | 12 |
|
12 |
| -DESCRIPTION = ('A set of functions and classes for simulating the ' + |
13 |
| - 'performance of photovoltaic energy systems.') |
14 |
| -LONG_DESCRIPTION = """ |
15 |
| -PVLIB Python is a community supported tool that provides a set of |
16 |
| -functions and classes for simulating the performance of photovoltaic |
17 |
| -energy systems. PVLIB Python was originally ported from the PVLIB MATLAB |
18 |
| -toolbox developed at Sandia National Laboratories and it implements many |
19 |
| -of the models and methods developed at the Labs. More information on |
20 |
| -Sandia Labs PV performance modeling programs can be found at |
21 |
| -https://pvpmc.sandia.gov/. We collaborate with the PVLIB MATLAB project, |
22 |
| -but operate independently of it. |
23 |
| -
|
24 |
| -We need your help to make pvlib-python a great tool! |
25 |
| -
|
26 |
| -Documentation: http://pvlib-python.readthedocs.io |
27 |
| -
|
28 |
| -Source code: https://github.com/pvlib/pvlib-python |
29 |
| -""" |
30 |
| -LONG_DESCRIPTION_CONTENT_TYPE = "text/x-rst" |
31 |
| - |
32 |
| -DISTNAME = 'pvlib' |
33 |
| -LICENSE = 'BSD 3-Clause' |
34 |
| -AUTHOR = 'pvlib python Developers' |
35 |
| -MAINTAINER_EMAIL = '[email protected]' |
36 |
| -URL = 'https://github.com/pvlib/pvlib-python' |
37 |
| - |
38 |
| -INSTALL_REQUIRES = ['numpy >= 1.16.0', |
39 |
| - 'pandas >= 0.25.0', |
40 |
| - 'pytz', |
41 |
| - 'requests', |
42 |
| - 'scipy >= 1.4.0', |
43 |
| - 'h5py', |
44 |
| - 'importlib-metadata; python_version < "3.8"'] |
45 |
| - |
46 |
| -TESTS_REQUIRE = ['pytest', 'pytest-cov', 'pytest-mock', |
47 |
| - 'requests-mock', 'pytest-timeout', 'pytest-rerunfailures', |
48 |
| - 'pytest-remotedata', 'packaging'] |
49 |
| -EXTRAS_REQUIRE = { |
50 |
| - 'optional': ['cython', 'ephem', 'nrel-pysam', 'numba', |
51 |
| - 'solarfactors', 'statsmodels'], |
52 |
| - 'doc': ['ipython', 'matplotlib', 'sphinx == 4.5.0', |
53 |
| - 'pydata-sphinx-theme == 0.8.1', 'sphinx-gallery', |
54 |
| - 'docutils == 0.15.2', 'pillow', |
55 |
| - 'sphinx-toggleprompt >= 0.0.5', 'solarfactors'], |
56 |
| - 'test': TESTS_REQUIRE |
57 |
| -} |
58 |
| -EXTRAS_REQUIRE['all'] = sorted(set(sum(EXTRAS_REQUIRE.values(), []))) |
59 |
| - |
60 |
| -CLASSIFIERS = [ |
61 |
| - 'Development Status :: 4 - Beta', |
62 |
| - 'License :: OSI Approved :: BSD License', |
63 |
| - 'Operating System :: OS Independent', |
64 |
| - 'Intended Audience :: Science/Research', |
65 |
| - 'Programming Language :: Python', |
66 |
| - 'Programming Language :: Python :: 3', |
67 |
| - 'Topic :: Scientific/Engineering', |
68 |
| -] |
69 |
| - |
70 |
| -setuptools_kwargs = { |
71 |
| - 'zip_safe': False, |
72 |
| - 'scripts': [], |
73 |
| - 'include_package_data': True, |
74 |
| - 'python_requires': '>=3.7' |
75 |
| -} |
76 |
| - |
77 |
| -PROJECT_URLS = { |
78 |
| - "Bug Tracker": "https://github.com/pvlib/pvlib-python/issues", |
79 |
| - "Documentation": "https://pvlib-python.readthedocs.io/", |
80 |
| - "Source Code": "https://github.com/pvlib/pvlib-python", |
81 |
| -} |
82 |
| - |
83 |
| -# set up pvlib packages to be installed and extensions to be compiled |
84 |
| - |
85 |
| -# the list of packages is not just the top-level "pvlib", but also |
86 |
| -# all sub-packages like "pvlib.bifacial". Here, setuptools's definition of |
87 |
| -# "package" is, in effect, any directory you want to include in the |
88 |
| -# distribution. So even "pvlib.data" counts as a package, despite |
89 |
| -# not having any python code or even an __init__.py. |
90 |
| -# setuptools.find_namespace_packages() will find all these directories, |
91 |
| -# although to exclude "docs", "ci", etc., we include only names matching |
92 |
| -# the "pvlib*" glob. Although note that "docs" does get added separately |
93 |
| -# via the MANIFEST.in spec. |
94 |
| -PACKAGES = find_namespace_packages(include=['pvlib*']) |
95 | 13 |
|
96 | 14 | extensions = []
|
97 | 15 |
|
98 |
| -spa_sources = ['pvlib/spa_c_files/spa.c', 'pvlib/spa_c_files/spa_py.c'] |
99 |
| -spa_depends = ['pvlib/spa_c_files/spa.h'] |
100 |
| -spa_all_file_paths = map(lambda x: os.path.join(os.path.dirname(__file__), x), |
101 |
| - spa_sources + spa_depends) |
| 16 | +spa_sources = ["pvlib/spa_c_files/spa.c", "pvlib/spa_c_files/spa_py.c"] |
| 17 | +spa_depends = ["pvlib/spa_c_files/spa.h"] |
| 18 | +spa_all_file_paths = map( |
| 19 | + lambda x: os.path.join(os.path.dirname(__file__), x), spa_sources + spa_depends |
| 20 | +) |
102 | 21 |
|
103 | 22 | if all(map(os.path.exists, spa_all_file_paths)):
|
104 |
| - print('all spa_c files found') |
105 |
| - PACKAGES.append('pvlib.spa_c_files') |
106 |
| - |
107 |
| - spa_ext = Extension('pvlib.spa_c_files.spa_py', |
108 |
| - sources=spa_sources, depends=spa_depends) |
| 23 | + print("all spa_c files found") |
| 24 | + spa_ext = Extension( |
| 25 | + "pvlib.spa_c_files.spa_py", sources=spa_sources, depends=spa_depends |
| 26 | + ) |
109 | 27 | extensions.append(spa_ext)
|
110 | 28 | else:
|
111 |
| - print('WARNING: spa_c files not detected. ' + |
112 |
| - 'See installation instructions for more information.') |
| 29 | + print( |
| 30 | + "WARNING: spa_c files not detected. See installation instructions for more information." |
| 31 | + ) |
113 | 32 |
|
114 | 33 |
|
115 |
| -setup(name=DISTNAME, |
116 |
| - packages=PACKAGES, |
117 |
| - install_requires=INSTALL_REQUIRES, |
118 |
| - extras_require=EXTRAS_REQUIRE, |
119 |
| - tests_require=TESTS_REQUIRE, |
120 |
| - ext_modules=extensions, |
121 |
| - description=DESCRIPTION, |
122 |
| - long_description=LONG_DESCRIPTION, |
123 |
| - long_description_content_type=LONG_DESCRIPTION_CONTENT_TYPE, |
124 |
| - author=AUTHOR, |
125 |
| - maintainer_email=MAINTAINER_EMAIL, |
126 |
| - license=LICENSE, |
127 |
| - url=URL, |
128 |
| - project_urls=PROJECT_URLS, |
129 |
| - classifiers=CLASSIFIERS, |
130 |
| - **setuptools_kwargs) |
| 34 | +setup(ext_modules=extensions, url=URL) |
0 commit comments