Skip to content

Commit 96922cf

Browse files
committed
update setup process
1 parent c7db42d commit 96922cf

File tree

2 files changed

+62
-26
lines changed

2 files changed

+62
-26
lines changed

setup.cfg

+22
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,28 @@
22
description-file = readme.rst
33
license_file = LICENSE
44

5+
[options]
6+
python_requires = >= 3.8
7+
install_requires =
8+
click
9+
requests
10+
numpy
11+
matplotlib
12+
pandas
13+
tqdm
14+
metar >= 1.5
15+
16+
[options.extras_require]
17+
dev =
18+
black
19+
codecov
20+
coverage
21+
flake8
22+
pytest
23+
pytest-flake8
24+
pytest-mpl
25+
pytest-cov
26+
527
[tool:pytest]
628
testpaths = cloudside
729
markers =

setup.py

+40-26
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import re
12
from setuptools import setup, find_packages
23

34
PACKAGE_DATA = {
@@ -7,29 +8,42 @@
78

89
DESCRIPTION = "cloudside - download, assess, and visualize weather data"
910

10-
if __name__ == "__main__":
11-
setup(
12-
name="cloudside",
13-
version="0.1",
14-
author="Paul Hobson",
15-
author_email="[email protected]",
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

Comments
 (0)