|
1 | 1 | import os |
| 2 | +import sys |
2 | 3 |
|
3 | 4 | from setuptools import setup |
4 | 5 |
|
5 | | -version = os.getenv('version', '0.0') |
6 | | -major, minor = version.split('.') |
| 6 | +# Retrieve 'VERSION' environment variable, default to '0.0' if not found. |
| 7 | +version = os.getenv('VERSION', '0.0') |
| 8 | + |
| 9 | +# Attempt to split the version number, default to '0' for both if it fails |
| 10 | +try: |
| 11 | + major, minor = version.split('.') |
| 12 | +except ValueError: |
| 13 | + major, minor = '0', '0' # Default to '0.0' if the version isn't in a 'major.minor' format |
| 14 | + |
7 | 15 |
|
8 | 16 | with open('org/polypheny/prism/version.py', 'w') as f: |
9 | 17 | f.write(f'MAJOR_VERSION = {major}\n') |
10 | 18 | f.write(f'MINOR_VERSION = {minor}\n') |
11 | 19 |
|
12 | | -setup(name='polyphenyprism', |
| 20 | + |
| 21 | +with open('README.md', 'r', encoding='utf-8') as f: |
| 22 | + long_description = f.read() |
| 23 | + |
| 24 | +setup(name='polypheny-prism-api', |
13 | 25 | version=version, |
14 | | - description='Protobuf files for Polypheny', |
| 26 | + description='Polypheny Prism API files for Python', |
| 27 | + long_description=long_description, |
| 28 | + long_description_content_type='text/markdown', |
15 | 29 | packages=['org/polypheny/prism'], |
16 | 30 | install_requires=[ |
17 | 31 | "protobuf==4.24.3", |
|
0 commit comments