Commit a18ae49
authored
fix: Fix incorrectly generated
Currently, if extra requirements are provided via a file, it is allowed
to contain markers, but if it is passed via extra_requires field, it
will run into error since the extra in this case is blindly added in the
following line in `py_wheel.bzl`
```
metadata_contents.append(
"Requires-Dist: %s; extra == '%s'" % (requirement, option),
)
```
Thus, this PR adds a post-process for this case, to make it possible to
pass something like
```
extra_requires = {"example": [
"pyyaml>=6.0.0,!=6.0.1",
'toml; (python_version == "3.11" or python_version == "3.12") and python_version != "3.8"',
'wheel; python_version == "3.11" or python_version == "3.12" ',
]},
```
to `py_wheel`Required-Dist when specifying requirements with markers in extra_requires in py_wheel rule (bazel-contrib#2200)1 parent 148122a commit a18ae49
4 files changed
Lines changed: 81 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
336 | 357 | | |
337 | 358 | | |
338 | 359 | | |
| |||
341 | 362 | | |
342 | 363 | | |
343 | 364 | | |
| 365 | + | |
344 | 366 | | |
345 | 367 | | |
346 | 368 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
489 | 489 | | |
490 | 490 | | |
491 | 491 | | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
492 | 522 | | |
493 | 523 | | |
494 | 524 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
537 | 537 | | |
538 | 538 | | |
539 | 539 | | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
540 | 551 | | |
541 | | - | |
| 552 | + | |
542 | 553 | | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
543 | 568 | | |
544 | 569 | | |
545 | 570 | | |
| |||
552 | 577 | | |
553 | 578 | | |
554 | 579 | | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
| 580 | + | |
569 | 581 | | |
570 | 582 | | |
571 | 583 | | |
| |||
0 commit comments