-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
48 lines (39 loc) · 1.53 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import os
from setuptools import setup
version_file = 'prism-api-version.txt'
if not os.path.exists(version_file):
raise ValueError(f"Version file '{version_file}' not found. Please create the file with the version number.")
with open(version_file, 'r') as f:
version = f.read().strip()
print(f"Building version: {version}")
if version == '0.0':
raise ValueError("Version is set to '0.0'. Please set a valid version number in the version file.")
# Attempt to split the version number, default to '0' for both if it fails
try:
major, minor = version.split('.')
except ValueError:
raise ValueError(f"Invalid version format: {version}. Expected 'major.minor' format.")
with open('org/polypheny/prism/version.py', 'w') as f:
f.write(f'MAJOR_VERSION = {major}\n')
f.write(f'MINOR_VERSION = {minor}\n')
with open('README.md', 'r', encoding='utf-8') as f:
long_description = f.read()
setup(
name='polypheny-prism-api',
version=version,
description='Polypheny Prism API files for Python',
long_description=long_description,
long_description_content_type='text/markdown',
author="The Polypheny Project",
author_email="[email protected]",
url="https://polypheny.com/",
project_urls={
"Documentation": "https://docs.polypheny.com/en/latest/query_interfaces/prism/protocol",
"Code": "https://github.com/polypheny/Polypheny-Prism-API"
},
license="Apache License, Version 2.0",
packages=['org/polypheny/prism'],
install_requires=[
"protobuf==5.27.2",
],
)