Skip to content

Commit

Permalink
VERSION 10.3.3 to use newer grpc package (#343)
Browse files Browse the repository at this point in the history
* VERSION 10.3.3 to use newer grpc package

* use schema 0.7.5

* change timestamps to uuids to avoid races

* update changelog

* update two more uuids

* the RAG client also used timestamps

* updated changelog again
  • Loading branch information
zeiler committed May 7, 2024
1 parent ebee50e commit edc6ede
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 16 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## [[10.3.3]](https://github.com/Clarifai/clarifai-python/releases/tag/10.3.3) - [PyPI](https://pypi.org/project/clarifai/10.3.3/) - 2024-05-07

### Changed
- Upgrade to clarifai-grpc 10.3.4
- RAG apps, workflows and other resources automatically setup now use UUIDs in their IDs instead of timestamps to avoid races.

### Fixed
- Use UUIDs in tests to avoid race conditions with timestamps.
- Hardcoded shcema package to 0.7.5 as it introduced breaking changes.

## [[10.3.2]](https://github.com/Clarifai/clarifai-python/releases/tag/10.3.2) - [PyPI](https://pypi.org/project/clarifai/10.3.2/) - 2024-05-03

### Added
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.3.2
10.3.3
3 changes: 1 addition & 2 deletions clarifai/rag/rag.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import uuid
from datetime import datetime
from typing import List

import yaml
Expand Down Expand Up @@ -76,7 +75,7 @@ def setup(cls,
>>> rag_agent = RAG.setup(app_url=YOUR_APP_URL)
>>> rag_agent.chat(messages=[{"role":"human", "content":"What is Clarifai"}])
"""
now_ts = str(int(datetime.now().timestamp()))
now_ts = uuid.uuid4().hex[:10]
if user_id and not app_url:
user = User(user_id=user_id, base_url=base_url, pat=pat)
## Create an App
Expand Down
2 changes: 1 addition & 1 deletion clarifai/versions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

CLIENT_VERSION = "10.3.2"
CLIENT_VERSION = "10.3.3"
OS_VER = os.sys.platform
PYTHON_VERSION = '.'.join(
map(str, [os.sys.version_info.major, os.sys.version_info.minor, os.sys.version_info.micro]))
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
clarifai-grpc~=10.2.3
clarifai-grpc~=10.3.4
numpy>=1.22.0
tqdm>=4.65.0
tritonclient>=2.34.0
rich>=13.4.2
PyYAML>=6.0.1
schema>=0.7.5
schema==0.7.5
Pillow>=9.5.0
inquirerpy==0.3.4
tabulate>=0.9.0
4 changes: 2 additions & 2 deletions tests/test_app.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import logging
import os
from datetime import datetime
import uuid

import pytest

from clarifai.client.app import App
from clarifai.client.user import User
from clarifai.constants.search import DEFAULT_TOP_K

NOW = str(int(datetime.now().timestamp()))
NOW = uuid.uuid4().hex[:10]
MAIN_APP_ID = "main"
MAIN_APP_USER_ID = "clarifai"
GENERAL_MODEL_ID = "general-image-recognition"
Expand Down
4 changes: 2 additions & 2 deletions tests/test_data_upload.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import logging
import os
from datetime import datetime
import uuid

import pytest

from clarifai.client.user import User
from clarifai.datasets.upload.utils import load_module_dataloader

CREATE_APP_USER_ID = os.environ["CLARIFAI_USER_ID"]
NOW = str(int(datetime.now().timestamp()))
NOW = uuid.uuid4().hex[:10]
CREATE_APP_ID = f"ci_input_app_{NOW}"
CREATE_DATASET_ID = "ci_input_test_dataset"

Expand Down
4 changes: 2 additions & 2 deletions tests/test_eval.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import logging
import os
from datetime import datetime
import uuid

import pytest

from clarifai.client.user import User

CREATE_APP_USER_ID = os.environ["CLARIFAI_USER_ID"]
NOW = str(int(datetime.now().timestamp()))
NOW = uuid.uuid4().hex[:10]
CREATE_APP_ID = f"ci_input_app_{NOW}"
CREATE_DATASET_ID = "ci_input_test_dataset"
CREATE_MODEL_ID = "ci_input_test_model_1"
Expand Down
4 changes: 2 additions & 2 deletions tests/test_model_train.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import logging
import os
import time
from datetime import datetime
import uuid

import pytest
import yaml

from clarifai.client.user import User

CREATE_APP_USER_ID = os.environ["CLARIFAI_USER_ID"]
NOW = str(int(datetime.now().timestamp()))
NOW = uuid.uuid4().hex[:10]
CREATE_APP_ID = f"ci_input_app_{NOW}"
CREATE_DATASET_ID = "ci_input_test_dataset"
CREATE_MODEL_ID = "ci_input_test_model"
Expand Down
4 changes: 2 additions & 2 deletions tests/workflow/test_create_delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
import logging
import os
import typing
from datetime import datetime
import uuid

import pytest

from clarifai.client.user import User

NOW = str(int(datetime.now().timestamp()))
NOW = uuid.uuid4().hex[:10]
CREATE_APP_USER_ID = os.environ["CLARIFAI_USER_ID"]
CREATE_APP_ID = f"test_workflow_create_delete_app_{NOW}"

Expand Down

0 comments on commit edc6ede

Please sign in to comment.