Skip to content

Commit 9b9bcdf

Browse files
nateshim-indicoNathanael Shim
andauthored
[CAT-822] Update Python Version (#270)
* add python 3.10 to tox * add 3.11 * add 3.12 * loosen dep requirements --------- Co-authored-by: Nathanael Shim <[email protected]>
1 parent 2cfa956 commit 9b9bcdf

File tree

6 files changed

+10
-11
lines changed

6 files changed

+10
-11
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.9.15
1+
FROM python:3.10.4
22

33
ENV INDICO_HOST="dev-ci.us-east-2.indico-dev.indico.io"
44

indico/http/client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,12 @@ def _make_request(
138138
logger.debug(
139139
f"[{method}] {path}\n\t Headers: {headers}\n\tRequest Args:{request_kwargs}"
140140
)
141-
142141
with self._handle_files(request_kwargs) as new_kwargs:
143142
response = getattr(self.request_session, method)(
144143
f"{self.base_url}{path}",
145144
headers=headers,
146145
stream=True,
147-
verify=self.config.verify_ssl,
146+
verify=False if not self.config.verify_ssl or not self.request_session.verify else True,
148147
**new_kwargs,
149148
)
150149

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
url="https://github.com/IndicoDataSolutions/indico-client-python",
1616
author="indico",
1717
author_email="[email protected]",
18-
tests_require=["pytest>=5.2.1", "requests-mock==1.8.0"],
18+
tests_require=["pytest>=5.2.1", "requests-mock>=1.8.0"],
1919
install_requires=[
2020
"msgpack>=0.5.6",
2121
"msgpack-numpy==0.4.4.3",
2222
"numpy>=1.16.0",
2323
"Pillow>=6.2.0",
24-
"requests==2.22.0",
24+
"requests>=2.22.0",
2525
"setuptools>=41.4.0",
2626
"pandas>=1.0.3",
2727
'importlib-metadata ~= 1.0 ; python_version < "3.8"',

tests/unit/client/test_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import unittest.mock
22
import pytest
33

4+
45
from indico.client import IndicoClient, HTTPRequest, HTTPMethod, GraphQLRequest
56
from indico.config import IndicoConfig
67

@@ -96,7 +97,6 @@ def test_client_requests_params(indico_request, auth, indico_test_config):
9697
additional_matcher=lambda r: not r.verify,
9798
json={"data": {"datasets": []}},
9899
)
99-
100100
response = client.call(
101101
GraphQLRequest(
102102
query="query list_datasets($ids: List(Int)) { datasets(ids: $ids) { id } }",

tox.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -yqq apt-tr
66
#deadsnakes holds old versions of python for ubuntu
77
RUN DEBIAN_FRONTEND=noninteractive apt-get install -yqq software-properties-common && add-apt-repository ppa:deadsnakes/ppa
88

9-
RUN DEBIAN_FRONTEND=noninteractive apt-get -yqq install python3.7 python3.8 python3.9 python3-pip
9+
RUN DEBIAN_FRONTEND=noninteractive apt-get -yqq install python3.7 python3.8 python3.9 python3.10 python3.11 python3.12 python3-pip
1010

11-
RUN pip3 install tox==3.22.0
11+
RUN pip3 install tox==4.11.3
1212

1313
COPY . /indico-client
1414
WORKDIR /indico-client

tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# content of: tox.ini , put in same dir as setup.py
22
[tox]
3-
envlist = py38,py39
3+
envlist = py38,py39,py310,py311,py312
44

55
[testenv]
66
parallel_show_output = true
77
# install pytest in the virtualenv where commands will be executed
8-
deps =
8+
deps =
99
pytest
10-
requests-mock == 1.8.0
10+
requests-mock >= 1.8.0
1111
commands =
1212
# NOTE: you can run any command line tool here - not just testsg
1313
pytest -sv tests/unit

0 commit comments

Comments
 (0)