Metadata-Version: 2.4
Name: sshtunnel2
Version: 0.4.1
Summary: Maintained drop-in fork of sshtunnel for Paramiko 3, 4, and 5
Author: Pahaz White
Maintainer: andyxuanq110
License-Expression: MIT
Project-URL: Homepage, https://github.com/andyxuanq110/sshtunnel2
Project-URL: Source, https://github.com/andyxuanq110/sshtunnel2
Project-URL: Issues, https://github.com/andyxuanq110/sshtunnel2/issues
Project-URL: Upstream, https://github.com/pahaz/sshtunnel
Keywords: ssh,tunnel,paramiko,port-forwarding
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: Proxy Servers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Requires-Dist: paramiko<6,>=3
Provides-Extra: test
Requires-Dist: pytest>=8; extra == "test"
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: ruff>=0.6; extra == "dev"
Requires-Dist: tox>=4; extra == "dev"
Dynamic: license-file

# sshtunnel2

Maintained fork of `sshtunnel`.
Drop-in runtime module: keep `import sshtunnel`.
Fixes modern Paramiko crashes, including `DSSKey` removal.

## Migration

Replace the dependency name only:

```bash
python -m pip uninstall sshtunnel
python -m pip install sshtunnel2
```

Your Python code should not change:

```python
from sshtunnel import SSHTunnelForwarder, open_tunnel
```

`sshtunnel2` intentionally installs the same top-level module name,
`sshtunnel`, so it conflicts with the original PyPI package if both are
installed in one environment. Install one or the other, not both.

## Why This Fork

The original `sshtunnel` project is a useful MIT-licensed library by Pahaz
White and contributors. It has also been effectively unmaintained for several
years while Python, Paramiko, and OpenSSH have continued to change.

This fork keeps the original API and behavior, preserves the original
copyright and MIT license, and limits the first release to maintenance:
compatibility fixes, packaging, tests, and CI. New APIs and async support are
out of scope for the first release.

## Compatibility

| Component | Supported |
| --- | --- |
| Python | 3.9, 3.10, 3.11, 3.12, 3.13 |
| Paramiko | 3.x, 4.x, 5.x |
| Public API | Matches `sshtunnel==0.4.0` |
| Package name | `sshtunnel2` |
| Import name | `sshtunnel` |

## Fixed Upstream Issues

| Upstream issue | Status in sshtunnel2 |
| --- | --- |
| [#302](https://github.com/pahaz/sshtunnel/issues/302) | Fixed: no hard reference to removed `paramiko.DSSKey`. |
| [#299](https://github.com/pahaz/sshtunnel/issues/299) | Fixed: DSA/DSS key support is discovered only when Paramiko exposes it. |
| [#288](https://github.com/pahaz/sshtunnel/issues/288) | Fixed: `start()` cleans already-created local listeners when startup fails. |
| [#170](https://github.com/pahaz/sshtunnel/issues/170) | Covered: shutdown is attempted for every created server, even failed tunnel checks. |
| [#173](https://github.com/pahaz/sshtunnel/issues/173) | Covered: `stop(force=True)` avoids blocking on active handler threads during close. |
| [#127](https://github.com/pahaz/sshtunnel/issues/127) | Covered by daemon-thread defaults retained from 0.4.0 and force-close tests. |
| [#201](https://github.com/pahaz/sshtunnel/issues/201) | Covered by explicit close behavior and CI regression tests. |

## Development

Run the pure unit tests:

```bash
python -m pip install -e ".[test]"
pytest
```

Run lint:

```bash
python -m pip install -e ".[dev]"
ruff check .
```

Run a matrix locally with tox:

```bash
tox -e py312-paramiko3,py312-paramiko4,py312-paramiko5
```

Run the real OpenSSH integration test:

```bash
pytest -m integration
```

The integration test starts a local `sshd` subprocess when OpenSSH server tools
are available. The GitHub Actions workflow runs the same test after installing
`openssh-server`.
