Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/release-older-version-sdks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-sdks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
12 changes: 12 additions & 0 deletions python/CI/generate-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
4 changes: 2 additions & 2 deletions python/Dockerfile.generate
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions python/fds.protobuf.stach.v2/setup.py
Original file line number Diff line number Diff line change
@@ -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='[email protected]',
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)
2 changes: 1 addition & 1 deletion python/fds.protobuf.stach.v3/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
author='analytics-reporting',
author_email='[email protected]',
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)
18 changes: 18 additions & 0 deletions python/fds.protobuf.stach/fds/protobuf/stach/NullValues.py
Original file line number Diff line number Diff line change
@@ -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)
12 changes: 12 additions & 0 deletions python/fds.protobuf.stach/setup.py
Original file line number Diff line number Diff line change
@@ -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='[email protected]',
license='Apache License 2.0',
install_requires=["protobuf>=3.20.0, <7.0.0"],
packages=find_packages(),
zip_safe=False)
Loading