Skip to content

Commit

Permalink
[ci] Repack wheel to exclude 'extra_requires'
Browse files Browse the repository at this point in the history
fuzzing-decision (used by taskmanager) uses a direct url reference
(allowed by PEP 508). But PyPI cannot accept direct url references.

We don't need any of the extras anyways for the wheel (Collector/FTB only).

See pypa/twine#430
  • Loading branch information
jschwartzentruber committed Feb 23, 2022
1 parent 06edf9d commit 1feb303
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
15 changes: 15 additions & 0 deletions repack_wheel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -e -x

#
# Remove 'extra_requires' from the wheel
#
# The 'extras' are only useful with the full source distribution.
#

WORK="$(mktemp -d -t fm-twine-repack-XXXXXX)"
wheel unpack -d "$WORK" dist/FuzzManager-*.whl
grep -Ev "^(Provides-Extra: .*|Requires-Dist: .* ; extra == '.*')$" "$WORK"/FuzzManager-*/FuzzManager-*.dist-info/METADATA > "$WORK"/METADATA.new
mv "$WORK"/METADATA.new "$WORK"/FuzzManager-*/FuzzManager-*.dist-info/METADATA
wheel pack -d dist "$WORK"/FuzzManager-*
rm -rf "$WORK"
3 changes: 3 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@ commands =
skip_install = true
deps =
twine
wheel
commands =
python setup.py sdist bdist_wheel
bash repack_wheel.sh
twine upload --skip-existing dist/*
whitelist_externals = bash

[flake8]
# This ignore section is for running flake8 standalone vs through pytest
Expand Down

0 comments on commit 1feb303

Please sign in to comment.