diff --git a/.github/workflows/release-older-version-sdks.yml b/.github/workflows/release-older-version-sdks.yml index e05306d..7f0818f 100644 --- a/.github/workflows/release-older-version-sdks.yml +++ b/.github/workflows/release-older-version-sdks.yml @@ -82,10 +82,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up Python 3.7 + - name: Set up Python 3.9 uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.9 - name: Install dependencies run: | diff --git a/.github/workflows/release-sdks.yml b/.github/workflows/release-sdks.yml index 6981b67..1ff6e4c 100755 --- a/.github/workflows/release-sdks.yml +++ b/.github/workflows/release-sdks.yml @@ -57,10 +57,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up Python 3.7 + - name: Set up Python 3.9 uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.9 - name: Install dependencies run: | diff --git a/python/CI/generate-sdk.sh b/python/CI/generate-sdk.sh index 0a9eb04..f694e73 100755 --- a/python/CI/generate-sdk.sh +++ b/python/CI/generate-sdk.sh @@ -4,15 +4,20 @@ set -e SCHEMA_PATH=/schema # Location of Protobuf schema BASE_PATH_V3=/python/fds.protobuf.stach.v3 # Base location of Python generated classes BASE_PATH_V2=/python/fds.protobuf.stach.v2 # Base location of Python generated classes +BASE_PATH_V1=/python/fds.protobuf.stach + PACKAGE_PATH_V3=v3/fds/protobuf/stach/v3 PACKAGE_PATH_V2=v2/fds/protobuf/stach/v2 +PACKAGE_PATH_V1=v1/fds/protobuf/stach # echo Removed old generated code rm -f $BASE_PATH_V2/$PACKAGE_PATH_V2/**/*_pb2.py rm -f $BASE_PATH_V3/$PACKAGE_PATH_V3/**/*_pb2.py +rm -f $BASE_PATH_V1/$PACKAGE_PATH_V1/**/*_pb2.py mkdir -p "$BASE_PATH_V3" mkdir -p "$BASE_PATH_V2" +mkdir -p "$BASE_PATH_V1" PROTOFILES=$(find $SCHEMA_PATH/$PACKAGE_PATH_V3 -iname "*.proto") protoc --proto_path $SCHEMA_PATH/v3 --python_out $BASE_PATH_V3 $PROTOFILES @@ -28,4 +33,11 @@ for f in $(find $BASE_PATH_V2/fds/protobuf/stach/v2 -type d -maxdepth 10); do touch "$f/__init__.py" done; +PROTOFILES=$(find $SCHEMA_PATH/$PACKAGE_PATH_V1 -iname "*.proto") +protoc --proto_path $SCHEMA_PATH/v1 --python_out $BASE_PATH_V1 $PROTOFILES + +for f in $(find $BASE_PATH_V1/fds/protobuf/stach/v1 -type d -maxdepth 10); do + touch "$f/__init__.py" +done; + echo Produced new generated code diff --git a/python/Dockerfile.generate b/python/Dockerfile.generate index 4db5039..97197e9 100644 --- a/python/Dockerfile.generate +++ b/python/Dockerfile.generate @@ -9,8 +9,8 @@ RUN apt-get update && \ apt-get -y install unzip git curl && \ rm -rf /var/lib/apt/lists/* -ARG PROTOC_ZIP=protoc-3.19.4-linux-x86_64.zip -RUN curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.19.4/$PROTOC_ZIP +ARG PROTOC_ZIP=protoc-32.0-linux-x86_64.zip +RUN curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v32.0/$PROTOC_ZIP RUN unzip -o $PROTOC_ZIP -d /usr/local bin/protoc RUN unzip -o $PROTOC_ZIP -d /usr/local 'include/*' RUN rm -f $PROTOC_ZIP diff --git a/python/fds.protobuf.stach.v2/setup.py b/python/fds.protobuf.stach.v2/setup.py index 46fea79..eb01981 100644 --- a/python/fds.protobuf.stach.v2/setup.py +++ b/python/fds.protobuf.stach.v2/setup.py @@ -1,12 +1,12 @@ from setuptools import setup, find_packages setup(name='fds.protobuf.stach.v2', - version='1.0.3', + version='1.0.4', description='Stach library in python', url='', author='analytics-reporting', author_email='analytics.api.support@factset.com', license='Apache License 2.0', - install_requires=["protobuf>=3.19.4"], + install_requires=["protobuf>=3.20.0, <7.0.0"], packages=find_packages(), zip_safe=False) diff --git a/python/fds.protobuf.stach.v3/setup.py b/python/fds.protobuf.stach.v3/setup.py index bd283c6..299a8c8 100644 --- a/python/fds.protobuf.stach.v3/setup.py +++ b/python/fds.protobuf.stach.v3/setup.py @@ -7,6 +7,6 @@ author='analytics-reporting', author_email='analytics.api.support@factset.com', license='Apache License 2.0', - install_requires=["protobuf>=3.19.4"], + install_requires=["protobuf>=3.20.0, <7.0.0"], packages=find_packages(), zip_safe=False) diff --git a/python/fds.protobuf.stach/fds/protobuf/stach/NullValues.py b/python/fds.protobuf.stach/fds/protobuf/stach/NullValues.py new file mode 100644 index 0000000..c7d421e --- /dev/null +++ b/python/fds.protobuf.stach/fds/protobuf/stach/NullValues.py @@ -0,0 +1,18 @@ +from google.protobuf.duration_pb2 import Duration +from google.protobuf.timestamp_pb2 import Timestamp + +class NullValues : + + DOUBLE = float('nan') + + DURATION = Duration(seconds=315576000000, nanos=999999900) + + FLOAT = float('nan') + + INT32 = 2147483647 + + INT64 = 9223372036854775807 + + STRING = "null" + + TIMESTAMP = Timestamp(seconds=253402300799, nanos=0) diff --git a/python/fds.protobuf.stach/setup.py b/python/fds.protobuf.stach/setup.py new file mode 100644 index 0000000..d62386f --- /dev/null +++ b/python/fds.protobuf.stach/setup.py @@ -0,0 +1,12 @@ +from setuptools import setup, find_packages + +setup(name='fds.protobuf.stach', + version='1.0.1', + description='Stach library in python', + url='', + author='analytics-reporting', + author_email='analytics.api.support@factset.com', + license='Apache License 2.0', + install_requires=["protobuf>=3.20.0, <7.0.0"], + packages=find_packages(), + zip_safe=False)