11# ITK Python Package
22
33This project configures pyproject.toml files and manages environmental
4- variables needed to build ITK Python binary wheels on MacOS , Linux, and Windows platforms.
4+ variables needed to build ITK Python binary wheels on macOS , Linux, and Windows platforms.
55Scripts are available for both [ ITK infrastructure] ( https://github.com/insightSoftwareConsortium/ITK ) and
66ITK external module Python packages.
77
@@ -20,7 +20,7 @@ or at the [ITK GitHub homepage](https://github.com/insightSoftwareConsortium/ITK
2020## Building Remote Modules with ITKPythonPackage
2121
2222ITK reusable workflows are available to build and package Python wheels as
23- part of Continuous Integration (CI) via Github Actions runners.
23+ part of Continuous Integration (CI) via GitHub Actions runners.
2424Those workflows can handle the overhead of fetching, configuring, and
2525running ITKPythonPackage build scripts for most ITK external modules.
2626See [ ITKRemoteModuleBuildTestPackageAction] ( https://github.com/InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction )
@@ -31,7 +31,7 @@ for more information.
3131
3232For special cases where ITK reusable workflows are not a good fit,
3333ITKPythonPackage scripts can be directly used to build Python wheels
34- to target Windows, Linux, and MacOS platforms. See
34+ to target Windows, Linux, and macOS platforms. See
3535below or the [ ITKPythonPackage ReadTheDocs] ( https://itkpythonpackage.readthedocs.io/en/latest/Build_ITK_Module_Python_packages.html )
3636documentation for more information on building wheels by hand.
3737
@@ -273,8 +273,43 @@ On Windows systems
273273
274274To build caches for local use, you can run the ` build_wheels.py ` script with the ` --build-itk-tarball-cache `
275275
276+ #### Publish Tarball Caches
277+
278+ To publish the tarball caches to a GitHub Release, you can run:
279+
280+ > [ !NOTE]
281+ > This requires the ` GH_TOKEN ` environment variable to be set or ` gh auth login ` to have been run beforehand.
282+ > Tarballs are expected in the parent directory of ` --build-dir-root ` (POSIX ` .tar.zst ` ) or inside it (Windows ` .zip ` ).
283+
284+ ``` bash
285+ pixi run -e publish publish-tarball-cache --itk-package-version v6.0b02 --build-dir-root /path/to/build/root
286+ ```
287+
288+ Users can also specify the GitHub repository to publish to using ` --repo ` (defaults to ITKPythonBuilds) and
289+ ` --create-release ` to create the release if it does not already exist.
290+
276291</details >
277292
293+ To see how to publish wheels see this section:
294+
295+ <details >
296+ <summary ><strong >Publishing Wheels</strong ></summary >
297+ This repository contains a script for publishing wheels to PyPI and TestPyPI.
298+
299+ The script can be run with the pixi environment as such:
300+
301+ > [ !NOTE]
302+ > This script assumes you have the ` TWINE_USERNAME ` and ` TWINE_PASSWORD ` environment variables set or the
303+ > ` .pypirc ` file configured on your machine. An example ` .pypirc ` can be seen in the root of this repository
304+
305+ ``` bash
306+ pixi run -e publish publish-wheels --dist-directory /path/to/dist/
307+ ```
308+
309+ You can also optionally pass in ` --test ` to publish to TestPyPI for validation before uploading to production,
310+ ` --repository-url ` to specify a custom package index, or ` --skip-existing ` to skip already-uploaded wheels.
311+
312+ </details >
278313
279314---
280315## Frequently Asked Questions
0 commit comments