Skip to content

Comments

Unify zip and async_zip compression methods#13781

Merged
konstin merged 1 commit intoastral-sh:mainfrom
corentin-ant:main
Jun 2, 2025
Merged

Unify zip and async_zip compression methods#13781
konstin merged 1 commit intoastral-sh:mainfrom
corentin-ant:main

Conversation

@corentin-ant
Copy link
Contributor

Summary

#13285 added additional compression methods for async_zip, but they should also be added to zip to support local wheel installation, on top of the ones retrieved over network.

Test Plan

Installation of local wheels with alternative compression schemes now works (e.g. uv add test.whl)

@konstin
Copy link
Member

konstin commented Jun 2, 2025

Can you update the lockfile?

@konstin konstin added the enhancement New feature or improvement to existing functionality label Jun 2, 2025
astral-sh#13285 added additional compression methods for `async_zip`, but they should also be added to `zip` to support local wheel installation, on top of the ones retrieved over network.
corentin-ant added a commit to corentin-ant/maturin that referenced this pull request Jun 2, 2025
…evelop` modes

This is a follow-up to PyO3#2566 that adds the ability to
- Specify other compression methods
- Control compression in the `develop` mode, not only `build`. Solves PyO3#2622

```
--compression-method <COMPRESSION_METHOD>
    Zip compresson method. Only Stored and Deflated are currently compatible with all package managers

    [default: deflated]

    Possible values:
    - deflated: Deflate compression
    - stored:   No compression
    - bzip2:    BZIP2 compression
    - zstd:     Zstandard compression (supported from Python 3.14)

--compression-level <COMPRESSION_LEVEL>
    Zip compresson level

    [default: 6]
```

Note that additional compression methods were added in `uv` 0.7.3 in astral-sh/uv#13285 but adding local `whl` is broken until astral-sh/uv#13781 is merged.

I tested the change locally by setting
```
        compression: maturin::CompressionOptions {
            compression_method: maturin::CompressionMethod::Bzip2,
            compression_level: 6,
        },
```
in the tests, which is supported by `pip`. I can do a follow-up PR to update the tests after `uv` is updated, possibly with a version check.
@konstin konstin merged commit 5400434 into astral-sh:main Jun 2, 2025
108 of 109 checks passed
corentin-ant added a commit to corentin-ant/maturin that referenced this pull request Jun 2, 2025
…evelop` modes

This is a follow-up to PyO3#2566 that adds the ability to
- Specify other compression methods
- Control compression in the `develop` mode, not only `build`. Solves PyO3#2622

```
--compression-method <COMPRESSION_METHOD>
    Zip compression method. Only Stored and Deflated are currently compatible with all package managers

    [default: deflated]

    Possible values:
    - deflated: Deflate compression
    - stored:   No compression
    - bzip2:    BZIP2 compression
    - zstd:     Zstandard compression (supported from Python 3.14)

--compression-level <COMPRESSION_LEVEL>
    Zip compresson level

    [default: 6]
```

Note that additional compression methods were added in `uv` 0.7.3 in astral-sh/uv#13285 but adding local `whl` is broken until astral-sh/uv#13781 is merged.

I tested the change locally by setting
```
        compression: maturin::CompressionOptions {
            compression_method: maturin::CompressionMethod::Bzip2,
            compression_level: 6,
        },
```
in the tests, which is supported by `pip`. I can do a follow-up PR to update the tests after `uv` is updated, possibly with a version check.
messense pushed a commit to PyO3/maturin that referenced this pull request Jun 3, 2025
…evelop` modes. (#2625)

This is a follow-up to #2566 that
adds the ability to
- Specify other compression methods
- Control compression in the `develop` mode, not only `build`. Solves
#2622

```
--compression-method <COMPRESSION_METHOD>
    Zip compresson method. Only Stored and Deflated are currently compatible with all package managers

    [default: deflated]

    Possible values:
    - deflated: Deflate compression
    - stored:   No compression
    - bzip2:    BZIP2 compression
    - zstd:     Zstandard compression (supported from Python 3.14)

--compression-level <COMPRESSION_LEVEL>
    Zip compresson level

    [default: 6]
```

Note that additional compression methods were added in `uv` 0.7.3 in
astral-sh/uv#13285 but adding local `whl` is
broken until astral-sh/uv#13781 is merged.

I tested the change locally by setting
```
        compression: maturin::CompressionOptions {
            compression_method: maturin::CompressionMethod::Bzip2,
            compression_level: 6,
        },
```
in the tests, which is supported by `pip`. I can do a follow-up PR to
update the tests after `uv` is updated, possibly with a version check.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or improvement to existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants