|
1 | 1 | import os
|
2 |
| -import sys |
3 |
| - |
4 | 2 | from setuptools import setup
|
5 | 3 |
|
6 |
| -# Retrieve 'VERSION' environment variable, default to '0.0' if not found. |
7 |
| -version = os.getenv('RELEASE_VERSION', '0.0') |
| 4 | +version_file = 'polypheny-connector-version.txt' |
| 5 | + |
| 6 | +if not os.path.exists(version_file): |
| 7 | + raise ValueError(f"Version file '{version_file}' not found. Please create the file with the version number.") |
| 8 | + |
| 9 | +with open(version_file, 'r') as f: |
| 10 | + version = f.read().strip() |
| 11 | + |
| 12 | +print(f"Building version: {version}") |
| 13 | + |
| 14 | +if not version.startswith('v'): |
| 15 | + raise ValueError(f"Invalid version format: {version}. Expected format 'v0.0.0'.") |
8 | 16 |
|
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 |
| 17 | +# Strip the 'v' prefix for the version |
| 18 | +version = version[1:] |
14 | 19 |
|
15 | 20 | with open('README.md', 'r', encoding='utf-8') as f:
|
16 | 21 | long_description = f.read()
|
17 | 22 |
|
18 |
| -setup(name='polypheny', |
19 |
| - version=version, |
20 |
| - description='Driver for Polypheny', |
21 |
| - long_description=long_description, |
22 |
| - long_description_content_type='text/markdown', |
23 |
| - packages=['polypheny'], |
24 |
| - install_requires=[ |
25 |
| - "polypheny-prism-api==1.9", |
26 |
| - ], |
27 |
| - ) |
| 23 | +setup( |
| 24 | + name='polypheny', |
| 25 | + version=version, |
| 26 | + description='Driver for Polypheny', |
| 27 | + long_description=long_description, |
| 28 | + long_description_content_type='text/markdown', |
| 29 | + author="The Polypheny Project", |
| 30 | + |
| 31 | + url="https://polypheny.com/", |
| 32 | + project_urls={ |
| 33 | + "Documentation": "https://docs.polypheny.com/en/latest/drivers/python/overview", |
| 34 | + "Code": "https://github.com/polypheny/Polypheny-Connector-Python", |
| 35 | + "Issue tracker": "https://github.com/polypheny/Polypheny-DB/labels/A-python" |
| 36 | + }, |
| 37 | + license="Apache License, Version 2.0", |
| 38 | + packages=['polypheny'], |
| 39 | + install_requires=[ |
| 40 | + "polypheny-prism-api==1.9", |
| 41 | + ], |
| 42 | +) |
0 commit comments