diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1149be7f..3039f1bb 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -79,7 +79,7 @@ jobs: runs-on: ubuntu-latest needs: build-polypheny steps: - - name: Set stroe env variable + - name: Set store env variable run: | echo "DEFAULT_STORE=${{ matrix.adapter }}" >> $GITHUB_ENV - uses: actions/setup-python@v5 diff --git a/setup.py b/setup.py index 0149373a..190a2563 100644 --- a/setup.py +++ b/setup.py @@ -1,15 +1,27 @@ import os -from setuptools import setup +import sys +from setuptools import setup, find_packages + +THIS_DIR = os.path.dirname(os.path.realpath(__file__)) +CONNECTOR_SRC_DIR = os.path.join(THIS_DIR, "polypheny") + +VERSION = (1, 1, 1, None) # Default +VERSION = "v1.1.1" # Default + version_file = 'polypheny-connector-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.") +# necessary for automated build pipeline +if os.path.exists(version_file): + with open(version_file, 'r') as f: + version = f.read().strip() + +else: + version = VERSION + #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}") +#print(f"Building version: {version}") if not version.startswith('v'): raise ValueError(f"Invalid version format: {version}. Expected format 'v0.0.0'.") @@ -17,14 +29,34 @@ # Strip the 'v' prefix for the version version = version[1:] -with open('README.md', 'r', encoding='utf-8') as f: - long_description = f.read() + +### Parse command line flags + +# This list defines the options definitions in a set +options_def = { + "--debug", +} + +# Options is the final parsed command line options +options = {e.lstrip("-"): False for e in options_def} + + +for flag in options_def: + if flag in sys.argv: + options[flag.lstrip("-")] = True + sys.argv.remove(flag) + + +def readme(): + with open(os.path.join(THIS_DIR, 'README.md'), encoding="utf-8" ) as f: + return f.read() + setup( name='polypheny', version=version, description='Driver for Polypheny', - long_description=long_description, + long_description=readme(), long_description_content_type='text/markdown', author="The Polypheny Project", author_email="mail@polypheny.org", @@ -35,7 +67,15 @@ "Issue tracker": "https://github.com/polypheny/Polypheny-DB/labels/A-python" }, license="Apache License, Version 2.0", - packages=['polypheny'], + packages=find_packages(), + include_package_data=True, + command_options={ + 'build_sphinx': { + 'version': ('setup.py', version), + 'release': ('setup.py', version), + }, + }, + python_requires=">=3.8", install_requires=[ "polypheny-prism-api==1.9", ],