httpx 0.24.6 → 0.24.7

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 80234bd7d5ea31711a4cdc1c90733cc929bc84d591da8a7fbfad6be66c8a6bf5
4
- data.tar.gz: 411496737c758f76b0a9b09f1f67eae7cd548699ce6efdf7865f6b1a51dec79a
3
+ metadata.gz: 06e8fd5ae58c24b0e8d71267133209622fad2e16e2196403937f3d330330fc72
4
+ data.tar.gz: 2684eb339c078326609390667a8c9522225fdf56ff2fdece7571022c110d96fc
5
5
  SHA512:
6
- metadata.gz: e06a3995e597f253e29d78826930c6db6ec3a878e5e0bae96ec6c93e8e49c60f35ec1231218ef84d20350d73d4058bbe204e60111a66983a0e0b104bf61e6059
7
- data.tar.gz: 175e3a5d83932d4e3a431cf4e2a65d8aa550a3028585c1b3c65970ba736529128f93eba5dd02125753d6c6460769c827aa80ecb6e6f49f2af10c1797c97a03e2
6
+ metadata.gz: fc776c73232482381b6c8861cd6b743b16e2ccd03a8aa2764ccb30668c6e13ca3a560b51d66f0569cbf1f0d71c2ad101ad04e3b1c187336496b6424633b12e41
7
+ data.tar.gz: aaa3cbf6a87825896331a2cd0aa2604e82738510507cade210092fcbb060456765750ed3e13af1395fc1cc998abf0c6222eda776f27d152e9e46c406ed3cce4d
@@ -0,0 +1,10 @@
1
+ # 0.24.6
2
+
3
+ ## dependencies
4
+
5
+ `http-2-next` last supported version for the 0.x series is the last version before v1. This shoul ensure that older versions of `httpx` won't be affected by any of the recent breaking changes.
6
+
7
+ ## Bugfixes
8
+
9
+ * `grpc`: setup of rpc calls from camel-cased symbols has been fixed. As an improvement, the GRPC-enabled session will now support both snake-cased, as well as camel-cased calls.
10
+ * `datadog` adapter has now been patched to support the most recent breaking changes of `ddtrace` configuration DSL (`env_to_bool` is no longer supported).
@@ -188,19 +188,39 @@ module TRACING_MODULE # rubocop:disable Naming/ClassAndModuleCamelCase
188
188
  option :distributed_tracing, default: true
189
189
  option :split_by_domain, default: false
190
190
 
191
- option :enabled do |o|
192
- o.default { env_to_bool("DD_TRACE_HTTPX_ENABLED", true) }
193
- o.lazy
194
- end
191
+ if DDTrace::VERSION::STRING >= "1.13.0"
192
+ option :enabled do |o|
193
+ o.type :bool
194
+ o.env "DD_TRACE_HTTPX_ENABLED"
195
+ o.default true
196
+ end
195
197
 
196
- option :analytics_enabled do |o|
197
- o.default { env_to_bool(%w[DD_TRACE_HTTPX_ANALYTICS_ENABLED DD_HTTPX_ANALYTICS_ENABLED], false) }
198
- o.lazy
199
- end
198
+ option :analytics_enabled do |o|
199
+ o.type :bool
200
+ o.env "DD_TRACE_HTTPX_ANALYTICS_ENABLED"
201
+ o.default false
202
+ end
203
+
204
+ option :analytics_sample_rate do |o|
205
+ o.type :float
206
+ o.env "DD_TRACE_HTTPX_ANALYTICS_SAMPLE_RATE"
207
+ o.default 1.0
208
+ end
209
+ else
210
+ option :enabled do |o|
211
+ o.default { env_to_bool("DD_TRACE_HTTPX_ENABLED", true) }
212
+ o.lazy
213
+ end
200
214
 
201
- option :analytics_sample_rate do |o|
202
- o.default { env_to_float(%w[DD_TRACE_HTTPX_ANALYTICS_SAMPLE_RATE DD_HTTPX_ANALYTICS_SAMPLE_RATE], 1.0) }
203
- o.lazy
215
+ option :analytics_enabled do |o|
216
+ o.default { env_to_bool(%w[DD_TRACE_HTTPX_ANALYTICS_ENABLED DD_HTTPX_ANALYTICS_ENABLED], false) }
217
+ o.lazy
218
+ end
219
+
220
+ option :analytics_sample_rate do |o|
221
+ o.default { env_to_float(%w[DD_TRACE_HTTPX_ANALYTICS_SAMPLE_RATE DD_HTTPX_ANALYTICS_SAMPLE_RATE], 1.0) }
222
+ o.lazy
223
+ end
204
224
  end
205
225
 
206
226
  if defined?(TRACING_MODULE::Contrib::SpanAttributeSchema)
@@ -224,7 +244,19 @@ module TRACING_MODULE # rubocop:disable Naming/ClassAndModuleCamelCase
224
244
 
225
245
  option :distributed_tracing, default: true
226
246
 
227
- option :error_handler, default: DEFAULT_ERROR_HANDLER
247
+ if DDTrace::VERSION::STRING >= "1.15.0"
248
+ option :error_handler do |o|
249
+ o.type :proc
250
+ o.default_proc(&DEFAULT_ERROR_HANDLER)
251
+ end
252
+ elsif DDTrace::VERSION::STRING >= "1.13.0"
253
+ option :error_handler do |o|
254
+ o.type :proc
255
+ o.experimental_default_proc(&DEFAULT_ERROR_HANDLER)
256
+ end
257
+ else
258
+ option :error_handler, default: DEFAULT_ERROR_HANDLER
259
+ end
228
260
  end
229
261
  end
230
262
 
@@ -141,17 +141,29 @@ module HTTPX
141
141
  deadline: @options.grpc_deadline,
142
142
  }.merge(opts)
143
143
 
144
+ local_rpc_name = rpc_name.underscore
145
+
144
146
  session_class = Class.new(self.class) do
147
+ # define rpc method with ruby style name
145
148
  class_eval(<<-OUT, __FILE__, __LINE__ + 1)
146
- def #{rpc_name}(input, **opts) # def grpc_action(input, **opts)
147
- rpc_execute("#{rpc_name}", input, **opts) # rpc_execute("grpc_action", input, **opts)
148
- end # end
149
+ def #{local_rpc_name}(input, **opts) # def grpc_action(input, **opts)
150
+ rpc_execute("#{local_rpc_name}", input, **opts) # rpc_execute("grpc_action", input, **opts)
151
+ end # end
149
152
  OUT
153
+
154
+ # define rpc method with original name
155
+ unless local_rpc_name == rpc_name
156
+ class_eval(<<-OUT, __FILE__, __LINE__ + 1)
157
+ def #{rpc_name}(input, **opts) # def grpcAction(input, **opts)
158
+ rpc_execute("#{local_rpc_name}", input, **opts) # rpc_execute("grpc_action", input, **opts)
159
+ end # end
160
+ OUT
161
+ end
150
162
  end
151
163
 
152
164
  session_class.new(@options.merge(
153
165
  grpc_rpcs: @options.grpc_rpcs.merge(
154
- rpc_name.underscore => [rpc_name, input, output, rpc_opts]
166
+ local_rpc_name => [rpc_name, input, output, rpc_opts]
155
167
  ).freeze
156
168
  ))
157
169
  end
data/lib/httpx/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HTTPX
4
- VERSION = "0.24.6"
4
+ VERSION = "0.24.7"
5
5
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httpx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.24.6
4
+ version: 0.24.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tiago Cardoso
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-28 00:00:00.000000000 Z
11
+ date: 2023-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http-2-next
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "<"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.4.1
19
+ version: 1.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "<"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.4.1
26
+ version: 1.0.0
27
27
  description: A client library for making HTTP requests from Ruby.
28
28
  email:
29
29
  - cardoso_tiago@hotmail.com
@@ -106,6 +106,7 @@ extra_rdoc_files:
106
106
  - doc/release_notes/0_24_4.md
107
107
  - doc/release_notes/0_24_5.md
108
108
  - doc/release_notes/0_24_6.md
109
+ - doc/release_notes/0_24_7.md
109
110
  - doc/release_notes/0_2_0.md
110
111
  - doc/release_notes/0_2_1.md
111
112
  - doc/release_notes/0_3_0.md
@@ -204,6 +205,7 @@ files:
204
205
  - doc/release_notes/0_24_4.md
205
206
  - doc/release_notes/0_24_5.md
206
207
  - doc/release_notes/0_24_6.md
208
+ - doc/release_notes/0_24_7.md
207
209
  - doc/release_notes/0_2_0.md
208
210
  - doc/release_notes/0_2_1.md
209
211
  - doc/release_notes/0_3_0.md