|
5 | 5 | with open("README.md", "r") as fh: |
6 | 6 | long_description = fh.read() |
7 | 7 |
|
| 8 | +def get_version(path): |
| 9 | + with open(path, "r") as fh: |
| 10 | + for line in fh.readlines(): |
| 11 | + if line.startswith("__version__"): |
| 12 | + return line.split('"' if '"' in line else "'")[1] |
| 13 | + else: |
| 14 | + raise RuntimeError(f"Unable to find version string in {path}") |
| 15 | + |
| 16 | +version = get_version("hass_pyscript_kernel/version.py") |
| 17 | + |
8 | 18 | setup( |
9 | | - name='hass_pyscript_kernel', |
10 | | - version='0.30', |
11 | | - author='Craig Barratt', |
12 | | - author_email='@alumni.stanford.edu', |
13 | | - description='Home Assistant Pyscript Jupyter kernel shim', |
14 | | - url='https://github.com/craigbarratt/hass-pyscript-jupyter', |
15 | | - download_url='https://github.com/craigbarratt/hass-pyscript-jupyter/archive/0.30.tar.gz', |
16 | | - packages=['hass_pyscript_kernel'], |
| 19 | + name="hass_pyscript_kernel", |
| 20 | + version=version, |
| 21 | + author="Craig Barratt", |
| 22 | + |
| 23 | + description="Home Assistant Pyscript Jupyter kernel shim", |
| 24 | + url="https://github.com/craigbarratt/hass-pyscript-jupyter", |
| 25 | + download_url=f"https://github.com/craigbarratt/hass-pyscript-jupyter/archive/{version}.tar.gz", |
| 26 | + packages=["hass_pyscript_kernel"], |
17 | 27 | long_description=long_description, |
18 | 28 | long_description_content_type="text/markdown", |
19 | 29 | install_requires=[ |
20 | | - 'aiohttp', |
21 | | - 'aiohttp_socks', |
22 | | - 'jupyter-client', |
23 | | - 'jupyter-core', |
| 30 | + "aiohttp", |
| 31 | + "aiohttp_socks", |
| 32 | + "jupyter-client", |
| 33 | + "jupyter-core", |
24 | 34 | ], |
25 | 35 | python_requires=">=3.7", |
26 | 36 | zip_safe=False, |
|
33 | 43 | ], |
34 | 44 | }, |
35 | 45 | entry_points={ |
36 | | - 'console_scripts': [ |
37 | | - 'jupyter-pyscript=hass_pyscript_kernel:install_main', |
| 46 | + "console_scripts": [ |
| 47 | + "jupyter-pyscript=hass_pyscript_kernel:install_main", |
38 | 48 | ], |
39 | 49 | }, |
40 | 50 | ) |
0 commit comments