feat: Add GitHub Actions workflow to test distributions on TestPyPI (#3798)#3806
Closed
abishop1990 wants to merge 3 commits intozarr-developers:mainfrom
Closed
feat: Add GitHub Actions workflow to test distributions on TestPyPI (#3798)#3806abishop1990 wants to merge 3 commits intozarr-developers:mainfrom
abishop1990 wants to merge 3 commits intozarr-developers:mainfrom
Conversation
Add __len__ method to both AsyncArray and Array classes to restore numpy compatibility. - AsyncArray.__len__: Returns shape[0] for dimensioned arrays, raises TypeError for 0-d arrays - Array.__len__: Delegates to async_array.__len__() - Matches numpy behavior exactly with error message 'len() of unsized object' - Added comprehensive tests covering: - 1-D, 2-D, 3-D, 4-D arrays returning shape[0] - 0-dimensional arrays raising TypeError - Both synchronous and asynchronous versions This restores the zarr v2 behavior that was removed in the v3 rewrite, essential for ecosystem compatibility with code that uses hasattr(obj, '__len__') to distinguish arrays from scalars.
- Create new workflow to test package publishing to TestPyPI - Trigger on workflow_dispatch (manual trigger) for pre-release validation - Builds distribution files using hatch (same as production pipeline) - Uploads to TestPyPI with separate credentials - Tests installation in multiple Python versions (3.9, 3.11) - Runs basic smoke tests to validate package functionality - Fails gracefully with clear error messages if any step fails Addresses issue zarr-developers#3798
- Creates .github/workflows/test-pypi-release.yml - Automatically triggered by: manual dispatch (workflow_dispatch) or tagged releases (v* and test-release-*) - Build stage: Creates wheel and sdist distributions using hatch - Upload stage: Publishes distributions to TestPyPI (not production PyPI) - Test stage: Validates installation from TestPyPI across Python 3.9 and 3.11 - Includes smoke tests to verify basic zarr operations work after installation - Properly configured with GitHub environment secrets and fail-fast strategy This workflow catches packaging issues early and validates the release process before pushing to production PyPI. Fixes zarr-developers#3798
Contributor
Author
|
Closing: Replaced by PR #3808 with clean implementation and no collateral changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements a GitHub Actions workflow to validate distributions on TestPyPI before release to production PyPI.
Problem
The current release process doesn't validate that packages build and install correctly before pushing to production PyPI. This can result in broken releases making it to the public package index.
Solution
Created
.github/workflows/test-pypi-release.ymlwhich:Triggers on:
Build Stage (build_artifacts job)
Upload Stage (test_testpypi_upload job)
Installation Test Stage (test_testpypi_install job)
Benefits
Code Review Checklist
Files Changed
.github/workflows/test-pypi-release.yml- New workflowchanges/3798.feature.md- Changelog entryTesting
Tested YAML syntax with yamllint ✓