Skip to content

Commit f716bf5

Browse files
committed
added setup info
1 parent efe32aa commit f716bf5

File tree

2 files changed

+51
-11
lines changed

2 files changed

+51
-11
lines changed

.github/workflows/test.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
runs-on: ubuntu-latest
8080
needs: build-polypheny
8181
steps:
82-
- name: Set stroe env variable
82+
- name: Set store env variable
8383
run: |
8484
echo "DEFAULT_STORE=${{ matrix.adapter }}" >> $GITHUB_ENV
8585
- uses: actions/setup-python@v5

setup.py

+50-10
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,62 @@
11
import os
2-
from setuptools import setup
2+
import sys
3+
from setuptools import setup, find_packages
4+
5+
THIS_DIR = os.path.dirname(os.path.realpath(__file__))
6+
CONNECTOR_SRC_DIR = os.path.join(THIS_DIR, "polypheny")
7+
8+
VERSION = (1, 1, 1, None) # Default
9+
VERSION = "v1.1.1" # Default
10+
311

412
version_file = 'polypheny-connector-version.txt'
513

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.")
14+
# necessary for automated build pipeline
15+
if os.path.exists(version_file):
16+
with open(version_file, 'r') as f:
17+
version = f.read().strip()
18+
19+
else:
20+
version = VERSION
21+
#raise ValueError(f"Version file '{version_file}' not found. Please create the file with the version number.")
822

9-
with open(version_file, 'r') as f:
10-
version = f.read().strip()
1123

12-
print(f"Building version: {version}")
24+
#print(f"Building version: {version}")
1325

1426
if not version.startswith('v'):
1527
raise ValueError(f"Invalid version format: {version}. Expected format 'v0.0.0'.")
1628

1729
# Strip the 'v' prefix for the version
1830
version = version[1:]
1931

20-
with open('README.md', 'r', encoding='utf-8') as f:
21-
long_description = f.read()
32+
33+
### Parse command line flags
34+
35+
# This list defines the options definitions in a set
36+
options_def = {
37+
"--debug",
38+
}
39+
40+
# Options is the final parsed command line options
41+
options = {e.lstrip("-"): False for e in options_def}
42+
43+
44+
for flag in options_def:
45+
if flag in sys.argv:
46+
options[flag.lstrip("-")] = True
47+
sys.argv.remove(flag)
48+
49+
50+
def readme():
51+
with open(os.path.join(THIS_DIR, 'README.md'), encoding="utf-8" ) as f:
52+
return f.read()
53+
2254

2355
setup(
2456
name='polypheny',
2557
version=version,
2658
description='Driver for Polypheny',
27-
long_description=long_description,
59+
long_description=readme(),
2860
long_description_content_type='text/markdown',
2961
author="The Polypheny Project",
3062
author_email="[email protected]",
@@ -35,7 +67,15 @@
3567
"Issue tracker": "https://github.com/polypheny/Polypheny-DB/labels/A-python"
3668
},
3769
license="Apache License, Version 2.0",
38-
packages=['polypheny'],
70+
packages=find_packages(),
71+
include_package_data=True,
72+
command_options={
73+
'build_sphinx': {
74+
'version': ('setup.py', version),
75+
'release': ('setup.py', version),
76+
},
77+
},
78+
python_requires=">=3.8",
3979
install_requires=[
4080
"polypheny-prism-api==1.9",
4181
],

0 commit comments

Comments
 (0)