From 34e40528173e2c96f0c8832405f401e1be10bf80 Mon Sep 17 00:00:00 2001 From: Vishal Date: Fri, 5 Jan 2024 14:53:26 +0530 Subject: [PATCH] add python 3.10 compatibility (#19) * fix deprecation warning * moved circle ci workflow and added jobs * added changelog and version bump * updated yml daily build config * updated build job * updated build step * updatec context * updatec context --------- Co-authored-by: Tim Shih --- .circleci/config.yml | 206 +++++++++++++++++++++++++++++++++++++++ CHANGELOG.md | 11 +++ circle.yml | 19 ---- setup.py | 2 +- transit/class_hash.py | 4 +- transit/transit_types.py | 4 +- 6 files changed, 222 insertions(+), 24 deletions(-) create mode 100644 .circleci/config.yml create mode 100644 CHANGELOG.md delete mode 100644 circle.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..1cbba39 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,206 @@ +version: 2.1 + +jobs: + build_test_v3_4: + docker: + - image: circleci/python:3.4 + steps: + - checkout + - run: + name: 'Setup virtual env' + command: | + python3 -m venv stitch-client + source stitch-client/bin/activate + pip install 'pip<19.2' 'setuptools<51.0.0' + pip install . + - run: + name: 'run tests' + command: | + source stitch-client/bin/activate + python -m unittest + build_test_v3_5: + docker: + - image: cimg/python:3.5 + steps: + - checkout + - run: + name: 'Setup virtual env' + command: | + python3 -m venv stitch-client + source stitch-client/bin/activate + pip install 'pip<19.2' 'setuptools<51.0.0' + pip install . + - run: + name: 'run tests' + command: | + source stitch-client/bin/activate + python -m unittest + build_test_v3_6: + docker: + - image: cimg/python:3.6 + steps: + - checkout + - run: + name: 'Setup virtual env' + command: | + python3 -m venv stitch-client + source stitch-client/bin/activate + pip install 'pip<19.2' 'setuptools<51.0.0' + pip install . + - run: + name: 'run tests' + command: | + source stitch-client/bin/activate + python -m unittest + build_test_v3_7: + docker: + - image: cimg/python:3.7 + steps: + - checkout + - run: + name: 'Setup virtual env' + command: | + python3 -m venv stitch-client + source stitch-client/bin/activate + pip install 'pip<19.2' 'setuptools<51.0.0' + pip install . + - run: + name: 'run tests' + command: | + source stitch-client/bin/activate + python -m unittest + build_test_v3_8: + docker: + - image: cimg/python:3.8 + steps: + - checkout + - run: + name: 'Setup virtual env' + command: | + python3 -m venv stitch-client + source stitch-client/bin/activate + pip install 'pip<19.2' 'setuptools<51.0.0' + pip install . + - run: + name: 'run tests' + command: | + source stitch-client/bin/activate + python -m unittest + build_test_v3_9: + docker: + - image: cimg/python:3.9 + steps: + - checkout + - run: + name: 'Setup virtual env' + command: | + python3 -m venv stitch-client + source stitch-client/bin/activate + pip install 'pip<19.2' 'setuptools<51.0.0' + pip install . + - run: + name: 'run tests' + command: | + source stitch-client/bin/activate + python -m unittest + build: + docker: + - image: cimg/python:3.10 + steps: + - checkout + - run: + name: 'Setup virtual env' + command: | + python3 -m venv stitch-client + source stitch-client/bin/activate + pip install pip setuptools + pip install . + - run: + name: 'run tests' + command: | + source stitch-client/bin/activate + python -m unittest + build_test_v3_11: + docker: + - image: cimg/python:3.11 + steps: + - checkout + - run: + name: 'Setup virtual env' + command: | + python3 -m venv stitch-client + source stitch-client/bin/activate + pip install pip setuptools + pip install . + - run: + name: 'run tests' + command: | + source stitch-client/bin/activate + python -m unittest + build_test_v3_12: + docker: + - image: cimg/python:3.12 + steps: + - checkout + - run: + name: 'Setup virtual env' + command: | + python3 -m venv stitch-client + source stitch-client/bin/activate + pip install pip setuptools + pip install . + - run: + name: 'run tests' + command: | + source stitch-client/bin/activate + python -m unittest + +workflows: + version: 2 + commit: + jobs: + - build: + context: circleci-user + - build_test_v3_4: + context: circleci-user + - build_test_v3_5: + context: circleci-user + - build_test_v3_6: + context: circleci-user + - build_test_v3_7: + context: circleci-user + - build_test_v3_8: + context: circleci-user + - build_test_v3_9: + context: circleci-user + - build_test_v3_11: + context: circleci-user + - build_test_v3_12: + context: circleci-user + build_daily: + triggers: + - schedule: + cron: "0 13 * * *" + filters: + branches: + only: + - master + jobs: + - build: + context: circleci-user + - build_test_v3_4: + context: circleci-user + - build_test_v3_5: + context: circleci-user + - build_test_v3_6: + context: circleci-user + - build_test_v3_7: + context: circleci-user + - build_test_v3_8: + context: circleci-user + - build_test_v3_9: + context: circleci-user + - build_test_v3_11: + context: circleci-user + - build_test_v3_12: + context: circleci-user \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..f0aa7e7 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,11 @@ +# Changelog + +## 1.1.0 + * Removed deprecations failures for python 3.10+[#19](https://github.com/stitchdata/python-stitch-client/pull/19) + +## 1.0.1 + * Relaxed Requests dependency verison[#15](https://github.com/stitchdata/python-stitch-client/pull/15) + +## 1.0.0 + * Add region kwarg to Client, Update Readme [#12](https://github.com/stitchdata/python-stitch-client/pull/12) + diff --git a/circle.yml b/circle.yml deleted file mode 100644 index f4737a0..0000000 --- a/circle.yml +++ /dev/null @@ -1,19 +0,0 @@ -version: 2 -jobs: - build: - docker: - - image: circleci/python:3.5-jessie-browsers - steps: - - checkout - - run: - name: 'Setup virtual env' - command: | - python3 -m venv venv - source venv/bin/activate - pip install -U pip setuptools - pip install .[dev] - - run: - name: 'run tests' - command: | - source venv/bin/activate - python -m unittest diff --git a/setup.py b/setup.py index f82a270..0301c8c 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name="stitchclient", - version="1.0.1", + version="1.1.0", description="A Stitch API client for Python", author="Stitch", author_email="support@stitchdata.com", diff --git a/transit/class_hash.py b/transit/class_hash.py index 9f0b47b..af75359 100644 --- a/transit/class_hash.py +++ b/transit/class_hash.py @@ -13,10 +13,10 @@ ## limitations under the License. # Hash that looks up class keys with inheritance. -import collections +import collections.abc -class ClassDict(collections.MutableMapping): +class ClassDict(collections.abc.MutableMapping): """A dictionary that looks up class/type keys with inheritance.""" def __init__(self, *args, **kwargs): diff --git a/transit/transit_types.py b/transit/transit_types.py index 0bd52e6..40810ee 100644 --- a/transit/transit_types.py +++ b/transit/transit_types.py @@ -12,8 +12,8 @@ ## See the License for the specific language governing permissions and ## limitations under the License. -from collections import Mapping, Hashable -from transit.pyversion import string_types, unicode_f, unicode_type +from collections.abc import Mapping, Hashable +from transit.pyversion import string_types class Named(object):