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