redc 0.1.1.dev1__tar.gz → 0.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. {redc-0.1.1.dev1 → redc-0.1.2}/.github/workflows/before-all.sh +1 -1
  2. {redc-0.1.1.dev1 → redc-0.1.2}/CMakeLists.txt +1 -1
  3. {redc-0.1.1.dev1 → redc-0.1.2}/PKG-INFO +4 -3
  4. {redc-0.1.1.dev1 → redc-0.1.2}/README.md +3 -2
  5. {redc-0.1.1.dev1 → redc-0.1.2}/pyproject.toml +2 -2
  6. {redc-0.1.1.dev1 → redc-0.1.2}/redc/__init__.py +1 -1
  7. {redc-0.1.1.dev1 → redc-0.1.2}/redc/ext/redc.cpp +5 -12
  8. redc-0.1.1.dev1/wheelhouse/redc-0.1.1.dev1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl +0 -0
  9. redc-0.1.1.dev1/wheelhouse/redc-0.1.1.dev1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl +0 -0
  10. redc-0.1.1.dev1/wheelhouse/redc-0.1.1.dev1-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl +0 -0
  11. redc-0.1.1.dev1/wheelhouse/redc-0.1.1.dev1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl +0 -0
  12. redc-0.1.1.dev1/wheelhouse/redc-0.1.1.dev1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl +0 -0
  13. {redc-0.1.1.dev1 → redc-0.1.2}/.clang-format +0 -0
  14. {redc-0.1.1.dev1 → redc-0.1.2}/.github/workflows/build_wheels.yml +1 -1
  15. {redc-0.1.1.dev1 → redc-0.1.2}/.gitignore +0 -0
  16. {redc-0.1.1.dev1 → redc-0.1.2}/CMake/PreventInSourceBuild.cmake +0 -0
  17. {redc-0.1.1.dev1 → redc-0.1.2}/LICENSE +0 -0
  18. {redc-0.1.1.dev1 → redc-0.1.2}/assets/images/redc-logo.png +0 -0
  19. {redc-0.1.1.dev1 → redc-0.1.2}/redc/callback.py +0 -0
  20. {redc-0.1.1.dev1 → redc-0.1.2}/redc/callbacks.py +0 -0
  21. {redc-0.1.1.dev1 → redc-0.1.2}/redc/client.py +0 -0
  22. {redc-0.1.1.dev1 → redc-0.1.2}/redc/codes.py +0 -0
  23. {redc-0.1.1.dev1 → redc-0.1.2}/redc/exceptions/__init__.py +0 -0
  24. {redc-0.1.1.dev1 → redc-0.1.2}/redc/ext/redc.h +0 -0
  25. {redc-0.1.1.dev1 → redc-0.1.2}/redc/ext/utils/concurrentqueue.h +0 -0
  26. {redc-0.1.1.dev1 → redc-0.1.2}/redc/ext/utils/curl_utils.h +0 -0
  27. {redc-0.1.1.dev1 → redc-0.1.2}/redc/response.py +0 -0
  28. {redc-0.1.1.dev1 → redc-0.1.2}/redc/utils/__init__.py +0 -0
  29. {redc-0.1.1.dev1 → redc-0.1.2}/redc/utils/headers.py +0 -0
  30. {redc-0.1.1.dev1 → redc-0.1.2}/redc/utils/http.py +0 -0
  31. {redc-0.1.1.dev1 → redc-0.1.2}/redc/utils/json_encoder.py +0 -0
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- CURL_VERSION="8.11.1"
3
+ CURL_VERSION="8.12.0"
4
4
 
5
5
  # deps
6
6
  yum install wget gcc make libpsl-devel libidn-devel zlib-devel libnghttp2-devel perl-IPC-Cmd -y
@@ -43,7 +43,7 @@ if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
43
43
  set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
44
44
  endif()
45
45
 
46
- nanobind_add_module(redc_ext STABLE_ABI FREE_THREADED LTO redc/ext/redc.cpp)
46
+ nanobind_add_module(redc_ext STABLE_ABI FREE_THREADED NOMINSIZE LTO redc/ext/redc.cpp)
47
47
 
48
48
  target_link_libraries(redc_ext PRIVATE CURL::libcurl)
49
49
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: redc
3
- Version: 0.1.1.dev1
3
+ Version: 0.1.2
4
4
  Summary: RedC is a high-performance, asynchronous HTTP client library for Python, built on top of the powerful curl library
5
5
  Keywords: asyncio,http,client,http-client,curl,libcurl
6
6
  Author-Email: AYMEN Mohammed <let.me.code.safe@gmail.com>
@@ -14,14 +14,15 @@ Description-Content-Type: text/markdown
14
14
  <img src="https://raw.githubusercontent.com/AYMENJD/redc/refs/heads/main/assets/images/redc-logo.png">
15
15
  </div>
16
16
 
17
- [![Version](https://img.shields.io/pypi/v/redc?style=flat&logo=curl&logoColor=red&color=red)](https://pypi.org/project/RedC) [![CURL version](https://img.shields.io/badge/Curl-v8.11.1-red?logo=curl)](https://curl.se/ch/8.11.1.html) [![Downloads](https://static.pepy.tech/personalized-badge/redc?period=month&units=none&left_color=grey&right_color=brightgreen&left_text=Downloads)](https://pepy.tech/project/redc)
17
+ [![Version](https://img.shields.io/pypi/v/redc?style=flat&logo=curl&logoColor=red&color=red)](https://pypi.org/project/RedC) [![CURL version](https://img.shields.io/badge/Curl-v8.12.0-red?logo=curl)](https://curl.se/ch/8.12.0.html) [![Downloads](https://static.pepy.tech/personalized-badge/redc?period=month&units=none&left_color=grey&right_color=brightgreen&left_text=Downloads)](https://pepy.tech/project/redc)
18
18
 
19
19
  **RedC** is a **high-performance**, asynchronous **HTTP** client library for **Python**, built on top of the powerful **curl** library. It provides a simple and intuitive interface for making HTTP requests and handling responses
20
20
 
21
21
  ## Features
22
22
 
23
23
  - **Asynchronous by Design**: Built with `asyncio` for non-blocking HTTP requests
24
- - **curl Backend**: Leverages the speed and reliability of libcurl for HTTP operations
24
+ - **HTTP/2 Support**: Fully compatible with `HTTP/2` for faster and more efficient communication
25
+ - **curl Backend**: Leverages the speed and reliability of curl for HTTP operations
25
26
  - **Streaming Support**: Stream large responses with ease using callback functions
26
27
  - **Proxy Support**: Easily configure proxies for your requests
27
28
 
@@ -2,14 +2,15 @@
2
2
  <img src="https://raw.githubusercontent.com/AYMENJD/redc/refs/heads/main/assets/images/redc-logo.png">
3
3
  </div>
4
4
 
5
- [![Version](https://img.shields.io/pypi/v/redc?style=flat&logo=curl&logoColor=red&color=red)](https://pypi.org/project/RedC) [![CURL version](https://img.shields.io/badge/Curl-v8.11.1-red?logo=curl)](https://curl.se/ch/8.11.1.html) [![Downloads](https://static.pepy.tech/personalized-badge/redc?period=month&units=none&left_color=grey&right_color=brightgreen&left_text=Downloads)](https://pepy.tech/project/redc)
5
+ [![Version](https://img.shields.io/pypi/v/redc?style=flat&logo=curl&logoColor=red&color=red)](https://pypi.org/project/RedC) [![CURL version](https://img.shields.io/badge/Curl-v8.12.0-red?logo=curl)](https://curl.se/ch/8.12.0.html) [![Downloads](https://static.pepy.tech/personalized-badge/redc?period=month&units=none&left_color=grey&right_color=brightgreen&left_text=Downloads)](https://pepy.tech/project/redc)
6
6
 
7
7
  **RedC** is a **high-performance**, asynchronous **HTTP** client library for **Python**, built on top of the powerful **curl** library. It provides a simple and intuitive interface for making HTTP requests and handling responses
8
8
 
9
9
  ## Features
10
10
 
11
11
  - **Asynchronous by Design**: Built with `asyncio` for non-blocking HTTP requests
12
- - **curl Backend**: Leverages the speed and reliability of libcurl for HTTP operations
12
+ - **HTTP/2 Support**: Fully compatible with `HTTP/2` for faster and more efficient communication
13
+ - **curl Backend**: Leverages the speed and reliability of curl for HTTP operations
13
14
  - **Streaming Support**: Stream large responses with ease using callback functions
14
15
  - **Proxy Support**: Easily configure proxies for your requests
15
16
 
@@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build"
4
4
 
5
5
  [project]
6
6
  name = "redc"
7
- version = "0.1.1.dev1"
7
+ version = "0.1.2"
8
8
  description = "RedC is a high-performance, asynchronous HTTP client library for Python, built on top of the powerful curl library"
9
9
  readme = "README.md"
10
10
  authors = [{ name = "AYMEN Mohammed", email = "let.me.code.safe@gmail.com" }]
@@ -23,7 +23,7 @@ wheel.py-api = "cp312"
23
23
  [tool.cibuildwheel]
24
24
  build-verbosity = 1
25
25
  build = "cp39* cp310* cp311* cp312* cp313*"
26
- free-threaded-support = true
26
+ enable = ["cpython-freethreading"]
27
27
  skip = "*musllinux*"
28
28
  archs = ["x86_64"]
29
29
 
@@ -15,7 +15,7 @@ __all__ = [
15
15
  "utils",
16
16
  ]
17
17
 
18
- __version__ = "0.1.1.dev1"
18
+ __version__ = "0.1.2"
19
19
  __copyright__ = "Copyright (c) 2025 RedC, AYMENJD"
20
20
  __license__ = "MIT License"
21
21
 
@@ -157,11 +157,7 @@ py_object RedC::request(const char *method, const char *url, const char *raw_dat
157
157
  curl_easy_setopt(easy, CURLOPT_HTTPHEADER, slist_headers.slist);
158
158
  }
159
159
 
160
- py_object future;
161
- {
162
- acq_gil gil;
163
- future = loop_.attr("create_future")();
164
- }
160
+ py_object future{loop_.attr("create_future")()};
165
161
 
166
162
  {
167
163
  std::unique_lock<std::mutex> lock(mutex_);
@@ -292,11 +288,9 @@ void RedC::worker_loop() {
292
288
 
293
289
  void RedC::cleanup() {
294
290
  std::unique_lock<std::mutex> lock(mutex_);
291
+ acq_gil gil;
295
292
  for (auto &[easy, data] : transfers_) {
296
- {
297
- acq_gil gil;
298
- call_soon_threadsafe_(data.future.attr("cancel"));
299
- }
293
+ call_soon_threadsafe_(data.future.attr("cancel"));
300
294
 
301
295
  curl_multi_remove_handle(multi_handle_, easy);
302
296
  curl_easy_cleanup(easy);
@@ -321,8 +315,7 @@ size_t RedC::progress_callback(Data *clientp, curl_off_t dltotal, curl_off_t dln
321
315
  curl_off_t ulnow) {
322
316
  if (clientp->has_progress_callback) {
323
317
  try {
324
- acq_gil
325
- gil; //TODO: this sometimes hangs on exit, which lead to other functions to block such as curl_multi_perform and worker_loop never exit
318
+ acq_gil gil;
326
319
  clientp->progress_callback(dltotal, dlnow, ultotal, ulnow);
327
320
  } catch (const std::exception &e) {
328
321
  std::cerr << "Error in progress_callback: " << e.what() << std::endl;
@@ -358,5 +351,5 @@ NB_MODULE(redc_ext, m) {
358
351
  arg("connect_timeout_ms") = 0, arg("allow_redirect") = true, arg("proxy_url") = "", arg("verify") = true,
359
352
  arg("ca_cert_path") = "", arg("stream_callback") = nb::none(), arg("progress_callback") = nb::none(),
360
353
  arg("verbose") = false)
361
- .def("close", &RedC::close);
354
+ .def("close", &RedC::close, nb::call_guard<nb::gil_scoped_release>());
362
355
  }
File without changes
@@ -30,8 +30,8 @@ jobs:
30
30
 
31
31
  - name: Build wheels
32
32
  run: |
33
- python -m cibuildwheel .
34
33
  python -m build --sdist
34
+ python -m cibuildwheel .
35
35
  mv ./wheelhouse/*.whl dist/
36
36
  ls dist/
37
37
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes