From 6ee65ef9f80d570d33e8130e3e4ab4802d60839c Mon Sep 17 00:00:00 2001 From: Ryan Linnit Date: Wed, 21 Feb 2024 14:24:26 +0000 Subject: [PATCH 1/6] step1 --- LICENSE | 2 +- acurl/pyproject.toml | 2 +- acurl/setup.cfg | 4 ++-- acurl/src/acurl.pyx | 4 ++-- acurl/src/session.pyx | 4 ++-- pyproject.toml | 2 +- setup.cfg | 5 +++-- tox.ini | 2 +- 8 files changed, 13 insertions(+), 12 deletions(-) diff --git a/LICENSE b/LICENSE index be71a4b4..03b2793e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016-2019 Sky UK. https://www.sky.com/ +Copyright (c) 2016-2024 Sky UK. https://www.sky.com/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/acurl/pyproject.toml b/acurl/pyproject.toml index 861e864e..db647aff 100644 --- a/acurl/pyproject.toml +++ b/acurl/pyproject.toml @@ -1,2 +1,2 @@ [build-system] -requires = ["setuptools", "wheel", "Cython<3.0"] +requires = ["setuptools", "wheel", "Cython==3.0.8"] diff --git a/acurl/setup.cfg b/acurl/setup.cfg index 185cb931..532fda91 100644 --- a/acurl/setup.cfg +++ b/acurl/setup.cfg @@ -8,16 +8,16 @@ classifiers = Intended Audience :: Developers Programming Language :: Python Programming Language :: Python :: 3 - Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 author = Aaron Ecay author_email = aaron.ecay@sky.uk maintainer = Sky Identity NFT team maintainer_email = matthew.ellis@sky.uk license = MIT url = https://github.com/sky-uk/mite/tree/master/acurl -version = 1.0.7 +version = 1.0.8 [options] install_requires = diff --git a/acurl/src/acurl.pyx b/acurl/src/acurl.pyx index d06db8e5..49b087e4 100644 --- a/acurl/src/acurl.pyx +++ b/acurl/src/acurl.pyx @@ -21,7 +21,7 @@ class AcurlError(Exception): # with the python asyncio library we need to call back into python. So these # functions do take the GIL, as indicated by `with gil` in their signatures. # The performance impact of this is yet tbd. -cdef int handle_socket(CURL *easy, curl_socket_t sock, int action, void *userp, void *socketp) with gil: +cdef int handle_socket(CURL *easy, curl_socket_t sock, int action, void *userp, void *socketp) noexcept with gil: cdef CurlWrapper wrapper = userp if action == CURL_POLL_IN or action == CURL_POLL_INOUT: wrapper.loop.add_reader(sock, wrapper.curl_perform_read, wrapper, sock) @@ -33,7 +33,7 @@ cdef int handle_socket(CURL *easy, curl_socket_t sock, int action, void *userp, if action != CURL_POLL_IN and action != CURL_POLL_OUT and action != CURL_POLL_INOUT and action != CURL_POLL_REMOVE: raise Exception("oops") -cdef int start_timeout(CURLM *multi, long timeout_ms, void *userp) with gil: +cdef int start_timeout(CURLM *multi, long timeout_ms, void *userp) noexcept with gil: cdef CurlWrapper wrapper = userp cdef int _running cdef double secs diff --git a/acurl/src/session.pyx b/acurl/src/session.pyx index 19a3553e..c3098c44 100644 --- a/acurl/src/session.pyx +++ b/acurl/src/session.pyx @@ -32,7 +32,7 @@ cdef BufferNode* alloc_buffer_node(size_t size, char *data): node.next = NULL return node -cdef size_t header_callback(char *ptr, size_t size, size_t nmemb, void *userdata): +cdef size_t header_callback(char *ptr, size_t size, size_t nmemb, void *userdata) noexcept: cdef _Response response = <_Response>userdata cdef BufferNode* node = alloc_buffer_node(size * nmemb, ptr) if response.header_buffer == NULL: # FIXME: unlikely @@ -42,7 +42,7 @@ cdef size_t header_callback(char *ptr, size_t size, size_t nmemb, void *userdata response.header_buffer_tail = node return node.len -cdef size_t body_callback(char *ptr, size_t size, size_t nmemb, void *userdata): +cdef size_t body_callback(char *ptr, size_t size, size_t nmemb, void *userdata) noexcept: cdef _Response response = <_Response>userdata cdef BufferNode* node = alloc_buffer_node(size * nmemb, ptr) if response.body_buffer == NULL: # FIXME: unlikely diff --git a/pyproject.toml b/pyproject.toml index de00ad56..b8df1bae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,5 +10,5 @@ exclude = ''' | .eggs )/ ''' -target-version = ['py311'] +target-version = ['py312'] line-length = 90 diff --git a/setup.cfg b/setup.cfg index 479e6d60..ead7c3f2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -4,14 +4,14 @@ description = A Python Performance Testing Framework long_description = file: README.md long_description_content_type = text/markdown url = https://github.com/sky-uk/mite/ -python_requires = >=3.9 +python_requires = >=3.10 classifiers = License :: OSI Approved :: MIT License Programming Language :: Python Programming Language :: Python :: 3 - Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 Operating System :: POSIX :: Linux # TODO - Update (or remove) the Selenium version when migrating to v4. The version is explicitly defined @@ -28,6 +28,7 @@ install_requires = selenium<4 uvloop websockets + setuptools setup_requires = pytest-runner packages = find: diff --git a/tox.ini b/tox.ini index c32cf55f..b2d499bc 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py39, py310, py311 +envlist = py310, py311, py312 skipsdist = true [testenv] From c82883a53fac4bb445ecd62809c2b5a4a3473d7e Mon Sep 17 00:00:00 2001 From: Ryan Linnit Date: Fri, 30 Aug 2024 13:49:31 +0100 Subject: [PATCH 2/6] tidy and use version range for Cython --- acurl/pyproject.toml | 2 +- setup.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/acurl/pyproject.toml b/acurl/pyproject.toml index db647aff..085d2cec 100644 --- a/acurl/pyproject.toml +++ b/acurl/pyproject.toml @@ -1,2 +1,2 @@ [build-system] -requires = ["setuptools", "wheel", "Cython==3.0.8"] +requires = ["setuptools", "wheel", "Cython>=3.0.8,<4.0.0"] diff --git a/setup.cfg b/setup.cfg index 7f011557..8d160df1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -26,9 +26,9 @@ install_requires = nanomsg pyzmq selenium<4 + setuptools uvloop websockets - setuptools setup_requires = pytest-runner packages = find: From 590e4a2cd8ecdc54ad6cafa4577ce098f5e38a4b Mon Sep 17 00:00:00 2001 From: Ryan Linnit Date: Mon, 2 Sep 2024 11:21:05 +0100 Subject: [PATCH 3/6] update maintainer --- acurl/setup.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/acurl/setup.cfg b/acurl/setup.cfg index 532fda91..780d95ca 100644 --- a/acurl/setup.cfg +++ b/acurl/setup.cfg @@ -13,8 +13,8 @@ classifiers = Programming Language :: Python :: 3.12 author = Aaron Ecay author_email = aaron.ecay@sky.uk -maintainer = Sky Identity NFT team -maintainer_email = matthew.ellis@sky.uk +maintainer = Sky Digital Identity NFT team +maintainer_email = jordan.brennan@sky.uk license = MIT url = https://github.com/sky-uk/mite/tree/master/acurl version = 1.0.8 From 4393c9aca5a8a33495ae0fe562637e6c61c9f65a Mon Sep 17 00:00:00 2001 From: Ryan Linnit Date: Thu, 5 Sep 2024 13:41:05 +0100 Subject: [PATCH 4/6] added comment --- acurl/src/acurl.pyx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/acurl/src/acurl.pyx b/acurl/src/acurl.pyx index 49b087e4..9e415b89 100644 --- a/acurl/src/acurl.pyx +++ b/acurl/src/acurl.pyx @@ -30,6 +30,8 @@ cdef int handle_socket(CURL *easy, curl_socket_t sock, int action, void *userp, if action == CURL_POLL_REMOVE: wrapper.loop.remove_reader(sock) wrapper.loop.remove_writer(sock) + # The following exception is never expected to be hit. Further conversation + # regarding this can be found in the PR: https://github.com/sky-uk/mite/pull/280#discussion_r1723665976 if action != CURL_POLL_IN and action != CURL_POLL_OUT and action != CURL_POLL_INOUT and action != CURL_POLL_REMOVE: raise Exception("oops") From e6367af11f49a30897d65fd2cc24cda724a28ec3 Mon Sep 17 00:00:00 2001 From: Ryan Linnit Date: Thu, 5 Sep 2024 14:03:39 +0100 Subject: [PATCH 5/6] remove py312 tox stuff --- pyproject.toml | 2 +- tox.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b8df1bae..de00ad56 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,5 +10,5 @@ exclude = ''' | .eggs )/ ''' -target-version = ['py312'] +target-version = ['py311'] line-length = 90 diff --git a/tox.ini b/tox.ini index 21eb2f3b..b2430c8d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py310, py311, py312 +envlist = py310, py311 skipsdist = true [testenv] From dfbafce7d63ede352c17d6c632a5f15bbec97ac9 Mon Sep 17 00:00:00 2001 From: Ryan Linnit Date: Thu, 5 Sep 2024 15:29:31 +0100 Subject: [PATCH 6/6] testing uvloop version --- acurl/setup.cfg | 2 +- setup.cfg | 2 +- test-requirements.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/acurl/setup.cfg b/acurl/setup.cfg index 780d95ca..1a59bf8e 100644 --- a/acurl/setup.cfg +++ b/acurl/setup.cfg @@ -22,7 +22,7 @@ version = 1.0.8 [options] install_requires = ujson>=4.1.0 - uvloop + uvloop==0.21.0b1 tests_require = pytest [aliases] diff --git a/setup.cfg b/setup.cfg index 8d160df1..38826998 100644 --- a/setup.cfg +++ b/setup.cfg @@ -27,7 +27,7 @@ install_requires = pyzmq selenium<4 setuptools - uvloop + uvloop==0.21.0b1 websockets setup_requires = pytest-runner packages = find: diff --git a/test-requirements.txt b/test-requirements.txt index 2ede43b4..19999e78 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -14,4 +14,4 @@ pytest-httpbin pytest-httpserver sanic werkzeug==3.0.3 -uvloop==0.19.0 +uvloop==0.21.0b1