Commit 13459b7
committed
Enhance GlobalOverrides: add dist_name and env_reader property
- Add dist_name parameter to GlobalOverrides.from_env() for distribution-specific overrides
- Add env_reader property that provides pre-configured EnvReader instance
- Store EnvReader created during initialization to reuse throughout context
- __enter__ returns self enabling clean 'with ... as overrides:' pattern
- Add comprehensive tests for env_reader property with and without dist_name
Benefits:
- Convenient access to custom environment variables via overrides.env_reader
- Automatic configuration with correct tool prefix and dist_name
- Single EnvReader instance per context (efficient and consistent)
- Enables dist-specific TOML reading: overrides.env_reader.read_toml()
Tests: 44/44 passing1 parent f5d1473 commit 13459b7
File tree
2 files changed
+86
-3
lines changed- vcs-versioning
- src/vcs_versioning
- testing_vcs
2 files changed
+86
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| 215 | + | |
215 | 216 | | |
216 | 217 | | |
217 | | - | |
| 218 | + | |
218 | 219 | | |
219 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
220 | 225 | | |
221 | 226 | | |
222 | 227 | | |
| |||
225 | 230 | | |
226 | 231 | | |
227 | 232 | | |
| 233 | + | |
| 234 | + | |
228 | 235 | | |
229 | 236 | | |
230 | 237 | | |
231 | 238 | | |
232 | 239 | | |
233 | 240 | | |
| 241 | + | |
234 | 242 | | |
235 | 243 | | |
236 | 244 | | |
| |||
239 | 247 | | |
240 | 248 | | |
241 | 249 | | |
| 250 | + | |
242 | 251 | | |
243 | 252 | | |
244 | 253 | | |
245 | 254 | | |
246 | 255 | | |
247 | | - | |
248 | | - | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
249 | 260 | | |
250 | 261 | | |
251 | 262 | | |
| |||
306 | 317 | | |
307 | 318 | | |
308 | 319 | | |
| 320 | + | |
| 321 | + | |
309 | 322 | | |
310 | 323 | | |
311 | 324 | | |
| |||
351 | 364 | | |
352 | 365 | | |
353 | 366 | | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
354 | 392 | | |
355 | 393 | | |
356 | 394 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
294 | 339 | | |
295 | 340 | | |
296 | 341 | | |
| |||
0 commit comments