Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d5dd9b0
deps: enable urllib3 2.x on Py>=3.9; keep Py<3.9 on urllib3<2
ahnv Aug 22, 2025
3dd09e1
ci: update Python and urllib3 version support across workflows and do…
ahnv Aug 22, 2025
75ec90b
build: update dependency requirements
ahnv Aug 22, 2025
cb1d6e9
fix: correct python version variable name in CI workflow exclusions
ahnv Aug 22, 2025
e97b846
ci: update GitHub Actions to use Ubuntu 22.04 runner
ahnv Aug 22, 2025
21bdf4f
ci: upgrade GitHub Actions checkout and setup-python from v1 to v5
ahnv Aug 22, 2025
3ab437c
ci: reorder pip install commands in test workflow for better dependen…
ahnv Aug 22, 2025
19a1dba
build: update test dependencies and Python version compatibility cons…
ahnv Aug 22, 2025
53e6aaf
chore: disable test cases for ge2
ahnv Aug 22, 2025
628cccf
ci: consolidate CI workflows and update test dependencies for Python …
ahnv Aug 25, 2025
2365f8f
ci: update Python version support
ahnv Aug 25, 2025
342d701
chore: removed 3.6 from test
ahnv Aug 26, 2025
3ed267f
test: fix
ahnv Aug 26, 2025
0733409
chore: updated version of coverage
ahnv Aug 26, 2025
4b82fa2
chore: updated dev dependencies
ahnv Aug 26, 2025
28d0ff7
chore: update tox version for 3.13
ahnv Aug 26, 2025
c3adacc
style: update Content-Type header to use only application/json in tes…
ahnv Aug 26, 2025
79a18ab
chore(ci): disable fail fast
ahnv Sep 1, 2025
bb1a41b
refactor: consolidate urllib3 version constraints into single global …
ahnv Sep 1, 2025
37d6117
tweak: add Content-Type header to test request headers
ahnv Sep 1, 2025
f71389c
Revert "tweak: add Content-Type header to test request headers"
ahnv Sep 1, 2025
a82ec0a
fix: add missing content_type="application/json" to API test responses
ahnv Sep 1, 2025
76fc1bc
fix: remove redundant Content-Type headers and standardize response c…
ahnv Sep 1, 2025
334fd8f
ci: split publish workflow into build and release jobs
ahnv Sep 1, 2025
a68a368
chore: reorganize Python version-specific dependencies and remove red…
ahnv Sep 1, 2025
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
37 changes: 30 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,46 @@ on:
types: [published]

jobs:
deploy:
runs-on: ubuntu-20.04
build:
runs-on: ubuntu-22.04
strategy:
matrix:
python: [3.7, 3.8, 3.9, '3.10']
matrix:
python: [3.7, 3.8, 3.9, '3.10', '3.11', '3.12']
urllib3-line: ["lt2", "ge2"]
exclude:
- python: "3.7"
urllib3-line: "ge2"
- python: "3.8"
urllib3-line: "ge2"
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
- uses: actions/checkout@v5
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install deps
run: |
pip install -r requirements/requirements.txt
if [ "${{ matrix.urllib3-line }}" = "lt2" ]; then
pip install "urllib3<2"
else
pip install "urllib3!=2.0.0,<3"
fi
pip install -e .
- name: Install Tox and any other packages
run: |
python -m pip install --upgrade pip
pip install -r requirements/test.txt
- name: Run Tox
run: tox -e py
release:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v5
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install build dependencies
run: |
pip install setuptools wheel twine
Expand Down
26 changes: 20 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,32 @@ on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
python: [3.7, 3.8, 3.9, '3.10']
python: [3.7, 3.8, 3.9, '3.10', '3.11', '3.12', '3.13']
urllib3-line: ["lt2", "ge2"]
exclude:
- python: "3.7"
urllib3-line: "ge2"
- python: "3.8"
urllib3-line: "ge2"
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v5
- name: Setup Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install Tox and any other packages
run: pip install -r requirements/test.txt
- name: Install deps
run: |
pip install -r requirements/test.txt
if [ "${{ matrix.urllib3-line }}" = "lt2" ]; then
pip install "urllib3<2"
else
pip install "urllib3!=2.0.0,<3"
fi
pip install -e .
- name: Run Tox
run: tox -e py
- name: Upload Coverage to codecov
Expand Down
11 changes: 8 additions & 3 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
requests>=2.22.0
requests_toolbelt==0.10.1
urllib3==1.26.*
requests_toolbelt>=1.0.0

urllib3<3; python_version >= "3.9"
urllib3!=2.0.0,<3; python_version < "3.9"

requests>=2.32.2; python_version >= "3.9"
requests>=2.22.0,<2.32; python_version >= "3.7" and python_version < "3.9"
requests>=2.22.0,<2.28; python_version < "3.7"
30 changes: 23 additions & 7 deletions requirements/test.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
requests>=2.22.0
black==19.10b0
coverage==4.5.4
tox==3.14.2
responses==0.17.0
requests_toolbelt==0.10.1
urllib3==1.26.*
requests_toolbelt>=1.0.0
urllib3<3; python_version >= "3.9"
urllib3!=2.0.0,<3; python_version < "3.9"

requests>=2.32.2; python_version >= "3.9"
requests>=2.22.0,<2.32; python_version >= "3.7" and python_version < "3.9"
requests>=2.22.0,<2.28; python_version < "3.7"

coverage>=7.6.0; python_version >= "3.13"
coverage>=7.5.0; python_version >= "3.9" and python_version < "3.13"
coverage>=5.0,<7.0; python_version >= "3.7" and python_version < "3.9"
coverage==4.5.4; python_version < "3.7"

responses>=0.25.0; python_version >= "3.8"
responses>=0.18.0,<0.25; python_version >= "3.7" and python_version < "3.8"
responses<0.18.0; python_version < "3.7"

black>=24.8.0; python_version >= "3.8"
black==19.10b0; python_version < "3.8"

tox>=4; python_version >= "3.13"
tox==3.14.2; python_version < "3.13"

40 changes: 24 additions & 16 deletions tests/test_custom_metadata_fields_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def test_get_custom_metadata_fields_succeeds(self):
responses.add(
responses.GET,
url,
content_type="application/json",
body="""[{
"id": "62a9d5f6db485107347bb7f2",
"name": "test10",
Expand Down Expand Up @@ -115,7 +116,7 @@ def test_get_custom_metadata_fields_succeeds(self):
],
"httpStatusCode": 200,
"headers": {
"Content-Type": "text/plain",
"Content-Type": "application/json",
"Accept-Encoding": "gzip, deflate",
"Authorization": "Basic ZmFrZTEyMjo=",
},
Expand Down Expand Up @@ -303,7 +304,7 @@ def test_delete_custom_metadata_fields_succeeds(self):
URL.API_BASE_URL = "http://test.com"
url = "{}/v1/customMetadataFields/{}".format(URL.API_BASE_URL, self.field_id)
headers = create_headers_for_test()
responses.add(responses.DELETE, url, status=204, headers=headers, body="{}")
responses.add(responses.DELETE, url, status=204, headers=headers)
resp = self.client.delete_custom_metadata_field(self.field_id)

mock_response_metadata = {
Expand Down Expand Up @@ -385,13 +386,14 @@ def test_create_custom_metadata_fields_succeeds_with_type_number(self):
"""
URL.API_BASE_URL = "http://test.com"
url = "{}/v1/customMetadataFields".format(URL.API_BASE_URL)
headers = {"Content-Type": "application/json"}
headers = {}
headers.update(create_headers_for_test())
responses.add(
responses.POST,
url,
status=201,
headers=headers,
content_type="application/json",
body="""{
"id": "62dfc03b1b02a58936efca37",
"name": "test",
Expand Down Expand Up @@ -422,7 +424,7 @@ def test_create_custom_metadata_fields_succeeds_with_type_number(self):
},
"httpStatusCode": 201,
"headers": {
"Content-Type": "text/plain, application/json",
"Content-Type": "application/json",
"Accept-Encoding": "gzip, deflate",
"Authorization": "Basic ZmFrZTEyMjo=",
},
Expand Down Expand Up @@ -457,13 +459,14 @@ def test_create_custom_metadata_fields_succeeds_with_type_textarea(self):
"""
URL.API_BASE_URL = "http://test.com"
url = "{}/v1/customMetadataFields".format(URL.API_BASE_URL)
headers = {"Content-Type": "application/json"}
headers = {}
headers.update(create_headers_for_test())
responses.add(
responses.POST,
url,
status=201,
headers=headers,
content_type="application/json",
body="""{
"id": "62e0d7ae1b02a589360dc1fd",
"name": "test",
Expand Down Expand Up @@ -493,7 +496,7 @@ def test_create_custom_metadata_fields_succeeds_with_type_textarea(self):

mock_response_metadata = {
"headers": {
"Content-Type": "text/plain, application/json",
"Content-Type": "application/json",
"Accept-Encoding": "gzip, deflate",
"Authorization": "Basic ZmFrZTEyMjo=",
},
Expand Down Expand Up @@ -543,13 +546,14 @@ def test_create_custom_metadata_fields_succeeds_with_type_date(self):
"""
URL.API_BASE_URL = "http://test.com"
url = "{}/v1/customMetadataFields".format(URL.API_BASE_URL)
headers = {"Content-Type": "application/json"}
headers = {}
headers.update(create_headers_for_test())
responses.add(
responses.POST,
url,
status=201,
headers=headers,
content_type="application/json",
body="""{
"id": "62dfc9f41b02a58936f0d284",
"name": "test-date",
Expand All @@ -575,7 +579,7 @@ def test_create_custom_metadata_fields_succeeds_with_type_date(self):

mock_response_metadata = {
"headers": {
"Content-Type": "text/plain, application/json",
"Content-Type": "application/json",
"Accept-Encoding": "gzip, deflate",
"Authorization": "Basic ZmFrZTEyMjo=",
},
Expand Down Expand Up @@ -621,13 +625,14 @@ def test_create_custom_metadata_fields_succeeds_with_type_boolean(self):
"""
URL.API_BASE_URL = "http://test.com"
url = "{}/v1/customMetadataFields".format(URL.API_BASE_URL)
headers = {"Content-Type": "application/json"}
headers = {}
headers.update(create_headers_for_test())
responses.add(
responses.POST,
url,
status=201,
headers=headers,
content_type="application/json",
body="""{
"id": "62dfcb801b02a58936f0fc39",
"name": "test-boolean",
Expand All @@ -653,7 +658,7 @@ def test_create_custom_metadata_fields_succeeds_with_type_boolean(self):

mock_response_metadata = {
"headers": {
"Content-Type": "text/plain, application/json",
"Content-Type": "application/json",
"Accept-Encoding": "gzip, deflate",
"Authorization": "Basic ZmFrZTEyMjo=",
},
Expand Down Expand Up @@ -699,13 +704,14 @@ def test_create_custom_metadata_fields_succeeds_with_type_single_select(self):
"""
URL.API_BASE_URL = "http://test.com"
url = "{}/v1/customMetadataFields".format(URL.API_BASE_URL)
headers = {"Content-Type": "application/json"}
headers = {}
headers.update(create_headers_for_test())
responses.add(
responses.POST,
url,
status=201,
headers=headers,
content_type="application/json",
body="""{
"id": "62dfcdb21b02a58936f14c97",
"name": "test",
Expand All @@ -729,7 +735,7 @@ def test_create_custom_metadata_fields_succeeds_with_type_single_select(self):

mock_response_metadata = {
"headers": {
"Content-Type": "text/plain, application/json",
"Content-Type": "application/json",
"Accept-Encoding": "gzip, deflate",
"Authorization": "Basic ZmFrZTEyMjo=",
},
Expand Down Expand Up @@ -775,13 +781,14 @@ def test_create_custom_metadata_fields_succeeds_with_type_multi_select(self):
"""
URL.API_BASE_URL = "http://test.com"
url = "{}/v1/customMetadataFields".format(URL.API_BASE_URL)
headers = {"Content-Type": "application/json"}
headers = {}
headers.update(create_headers_for_test())
responses.add(
responses.POST,
url,
status=201,
headers=headers,
content_type="application/json",
body="""{
"id": "62dfcf001b02a58936f17808",
"name": "test",
Expand Down Expand Up @@ -809,7 +816,7 @@ def test_create_custom_metadata_fields_succeeds_with_type_multi_select(self):

mock_response_metadata = {
"headers": {
"Content-Type": "text/plain, application/json",
"Content-Type": "application/json",
"Accept-Encoding": "gzip, deflate",
"Authorization": "Basic ZmFrZTEyMjo=",
},
Expand Down Expand Up @@ -857,12 +864,13 @@ def test_update_custom_metadata_fields_succeeds(self):
"""
URL.API_BASE_URL = "http://test.com"
url = "{}/v1/customMetadataFields/{}".format(URL.API_BASE_URL, self.field_id)
headers = {"Content-Type": "application/json"}
headers = {}
headers.update(create_headers_for_test())
responses.add(
responses.PATCH,
url,
headers=headers,
content_type="application/json",
body="""{
"id": "62a9d5f6db485107347bb7f2",
"name": "test",
Expand Down Expand Up @@ -892,7 +900,7 @@ def test_update_custom_metadata_fields_succeeds(self):
},
"httpStatusCode": 200,
"headers": {
"Content-Type": "text/plain, application/json",
"Content-Type": "application/json",
"Accept-Encoding": "gzip, deflate",
"Authorization": "Basic ZmFrZTEyMjo=",
},
Expand Down
Loading