Metadata-Version: 2.4
Name: textwrap2
Version: 0.1.0
Summary: Rust port of Python's textwrap module
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM

# textwrap2

Python bindings (via [PyO3](https://pyo3.rs)/[maturin](https://www.maturin.rs)) for `textwrap_rs`,
a Rust port of Python's standard-library `textwrap` module.

## Install

```bash
pip install textwrap2
```

## Usage

```python
import textwrap2

textwrap2.wrap("hello world", width=5)
# ['hello', 'world']
```

### Install without PyPI

Straight from a tag or branch (builds from source locally, requires a Rust toolchain):

```bash
pip install git+https://github.com/akawd/textwrap.git@v0.1.0
```

Or grab a prebuilt wheel for your platform from the
[Releases page](https://github.com/akawd/textwrap/releases) and install it directly:

```bash
pip install https://github.com/akawd/textwrap/releases/download/v0.1.0/textwrap2-0.1.0-cp311-abi3-win_amd64.whl
```

## Releasing (maintainers)

Two manually-triggered (`workflow_dispatch`) GitHub Actions workflows build the same wheels
for Linux/Windows/macOS; nothing is published automatically on push or tag.

- **`.github/workflows/publish.yml`** — publishes to PyPI using
  [Trusted Publishing](https://docs.pypi.org/trusted-publishers/) (OIDC), no API token stored
  in the repo. The trusted publisher is registered on PyPI (`textwrap2` project → Publishing)
  with:
  - Owner: `akawd`
  - Repository name: `textwrap`
  - Workflow name: `publish.yml`
  - Environment name: `pypi`

  The `pypi` environment name must also exist under repo Settings → Environments — it's what
  GitHub uses to scope the `id-token: write` permission for the OIDC claim.

- **`.github/workflows/github-release.yml`** — skips PyPI entirely and instead attaches the
  built wheels + sdist to a GitHub Release, for installing straight from GitHub (see above).
  Takes a `version` input (e.g. `v0.1.0`) and creates that tag/release if it doesn't exist yet.

To release: bump the version in `pyproject.toml`, commit, then run the relevant workflow
manually from the Actions tab.

