10. piw-remove

The piw-remove script is used to manually remove a package (or a version of a package) from the system. All builds for the specified package (or version) will be forgotten, and all files generated by such builds will be deleted.

By default, the package (or version) removed will be deleted entirely (not marked to skip). Optionally, you can provide a skip reason; in this case the version will not be deleted (though its builds and files will), but will be left marked to skip to prevent future rebuilds.

10.1. Synopsis

piw-remove [-h] [--version] [-c FILE] [-q] [-v] [-l FILE] [-y]
           [-b | --soft-delete] [-s REASON] [--yank]
           [--import-queue ADDR]
           package [version]

10.2. Description

package

The name of the package to remove

version

The version of the package to remove. If omitted, removes the entire package

-h, --help

Show this help message and exit

--version

Show program’s version number and exit

-c FILE, --configuration FILE

Specify a configuration file to load

-q, --quiet

Produce less console output

-v, --verbose

Produce more console output

-l FILE, --log-file FILE

Log messages to the specified file

-y, --yes

Run non-interactively; never prompt during operation

-b, --builds

Remove builds and files for this package / version, but don’t delete from the database (the version will be requeued for building unless -s is also given). Mutually exclusive with --soft-delete.

--soft-delete

Mark files for this package / version as deleted, and rewrite the affected page(s), without removing any database rows. Use this after removing a file from disk (e.g. to reclaim space for old, never-downloaded files) to keep the site’s pages and the build queue consistent. Unlike -b, this carries no risk of the version being re-queued for building, since the underlying build record is preserved. Mutually exclusive with -b; combine with -s to also prevent future build attempts.

Note

This option does not remove the file from disk itself; it only updates the database and website to reflect a file that has already been removed. Run piw-audit-packages --delete-extras (passing --archive-dir if the file lives on the archive server) to actually delete files that are no longer referenced by the index.

-s REASON, --skip REASON

Leave the version in place, but marked with a reason to prevent future build attempts

--yank

Mark a version as yanked (see PEP 592)

--import-queue ADDR

The address of the queue used by piw-remove (default: (ipc:///tmp/piw-import); this should always be an ipc address

10.3. Usage

This utility is typically used in response to a request from a package maintainer to remove a specific build from the system. Usually because the presence of a piwheels build is causing issues in and of itself.

Note

Older versions of piwheels didn’t heed PyPI deletion messages. This is no longer the case and this utility is no longer required to manually remove deleted packages.

The utility can be run in a batch mode with --yes but still requires invoking once per deletion required (you cannot remove multiple versions in a single invocation).

The return code will be 0 if the package (or version) was successfully removed. If anything fails, the return code will be non-zero and no files should be deleted (but this cannot be guaranteed in all circumstances).

The utility should only ever be run directly on the master node (opening the import queue to other machines is a potential security risk).