|
| 1 | +import re |
1 | 2 | from setuptools import setup, find_packages
|
2 | 3 |
|
3 | 4 | PACKAGE_DATA = {
|
|
7 | 8 |
|
8 | 9 | DESCRIPTION = "cloudside - download, assess, and visualize weather data"
|
9 | 10 |
|
10 |
| -if __name__ == "__main__": |
11 |
| - setup( |
12 |
| - name="cloudside", |
13 |
| - version="0.1", |
14 |
| - author="Paul Hobson", |
15 |
| - |
16 |
| - url="http://python-metar.sourceforge.net/", |
17 |
| - description=DESCRIPTION, |
18 |
| - long_description=DESCRIPTION, |
19 |
| - package_data=PACKAGE_DATA, |
20 |
| - download_url="http://sourceforge.net/project/platformdownload.php?group_id=134052", |
21 |
| - license="BSD 3-Clause", |
22 |
| - packages=find_packages(exclude=[]), |
23 |
| - platforms="Python 3.6 and later.", |
24 |
| - classifiers=[ |
25 |
| - "Development Status :: 3 - Alpha", |
26 |
| - "Environment :: Console", |
27 |
| - "Intended Audience :: Science/Research", |
28 |
| - "License :: OSI Approved :: BSD License", |
29 |
| - "Operating System :: OS Independent", |
30 |
| - "Programming Language :: Python :: 3.6", |
31 |
| - "Topic :: Scientific/Engineering :: Atmospheric Science", |
32 |
| - "Topic :: Scientific/Engineering :: Visualization", |
33 |
| - ], |
34 |
| - entry_points={"console_scripts": ["cloudside=cloudside.cli:main"]}, |
35 |
| - ) |
| 11 | + |
| 12 | +def search(substr: str, content: str): |
| 13 | + found = re.search(substr, content) |
| 14 | + if found: |
| 15 | + return found.group(1) |
| 16 | + return "" |
| 17 | + |
| 18 | + |
| 19 | +with open("cloudside/__init__.py", encoding="utf8") as f: |
| 20 | + content = f.read() |
| 21 | + version = search(r'__version__ = "(.*?)"', content) |
| 22 | + author = search(r'__author__ = "(.*?)"', content) |
| 23 | + author_email = search(r'__email__ = "(.*?)"', content) |
| 24 | + |
| 25 | + |
| 26 | +setup( |
| 27 | + name="cloudside", |
| 28 | + version=version, |
| 29 | + author=author, |
| 30 | + author_email=author_email, |
| 31 | + url="https://github.com/Geosyntec/cloudside", |
| 32 | + description=DESCRIPTION, |
| 33 | + long_description=DESCRIPTION, |
| 34 | + package_data=PACKAGE_DATA, |
| 35 | + license="BSD 3-Clause", |
| 36 | + packages=find_packages(exclude=[]), |
| 37 | + platforms="Python 3.8 and later.", |
| 38 | + classifiers=[ |
| 39 | + "Development Status :: 3 - Alpha", |
| 40 | + "Environment :: Console", |
| 41 | + "Intended Audience :: Science/Research", |
| 42 | + "License :: OSI Approved :: BSD License", |
| 43 | + "Operating System :: OS Independent", |
| 44 | + "Programming Language :: Python :: 3.8", |
| 45 | + "Topic :: Scientific/Engineering :: Atmospheric Science", |
| 46 | + "Topic :: Scientific/Engineering :: Visualization", |
| 47 | + ], |
| 48 | + entry_points={"console_scripts": ["cloudside=cloudside.cli:main"]}, |
| 49 | +) |
0 commit comments