Skip to main content

Stow-Python - Python reimplementation of GNU Stow symlink farm manager

Project description

Stow-Python

This is a pedantically faithful, singe-file, dependency-free Python reimplementation of all of GNU Stow, the symlink farm manager, that runs on any Python version from 2.7 to 3.14 and beyond.

The reason for making this is that GNU Stow is very useful but it's written in Perl. This can cause some headaches on some HPC clusters or other systems that you don't control yourself regarding the Perl toolchain. This reimplementation lets you use Stow on systems where Perl isn't available (or isn't the correct version, or misses some packages etc.) but some version of Python is there (2.7 or 3.0–3.14+), which is basically always.

The goal here is identical behavior to GNU Stow, to achieve true, worry-free drop-in substitution. This is tested both with ports of the original Perl tests and with oracle tests against the Perl executable verifying identical output, return codes and filesystem state. The code itself is not very pythonic, following the logic of the original Perl code is of higher priority to ensure correctness.

Install

Stow-Python is a single self-contained executable Python script that you can simply drop directly into any directory in your PATH, such as ~/.local/bin:

wget -O ~/.local/bin/stow https://raw.githubusercontent.com/isarandi/stow-python/main/bin/stow
chmod +x ~/.local/bin/stow

But if you prefer, pip installation is also available:

pip install stow-python

After this, you can simply run the stow command since the executable will be in your PATH.

Use

Stow-Python is an exact reimplementation of GNU Stow, so refer to the GNU Stow manual for all options and usage details, or see stow --help for all options, or refer to the GNU Stow manual.

To use the chkstow diagnostic tool for common stow directory problems, you can either download it directly like the stow executable, or use pip, it is automatically installed with stow-python. The stow and chkstow executables do not depend on each other, both are standalone with Python as the sole dependency.

Run the tests

pip install stow-python[tests]
pytest tests/

# For oracle tests (comparing against the Perl-based GNU Stow), install GNU Stow first:
cd tests && ./get_gnu_stow_for_testing_identical_behavior.sh && cd ..
pytest tests/

The test suite includes both ported unit tests from the original Perl codebase and tests that run both implementations and verify identical behavior.

License

GPL-3.0-or-later

Acknowledgements

This project constitutes derivative work of GNU Stow, whose authors are Bob Glickstein, Guillaume Morin, Kahlil Hodgson, Adam Spiers, and others. This code could not exist without them.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stow_python-2.4.1.tar.gz (53.7 kB view details)

Uploaded Source

File details

Details for the file stow_python-2.4.1.tar.gz.

File metadata

  • Download URL: stow_python-2.4.1.tar.gz
  • Upload date:
  • Size: 53.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for stow_python-2.4.1.tar.gz
Algorithm Hash digest
SHA256 0777e04a999105f68130f2da9db8db7848d1589ed3369a98404f667969c12160
MD5 d4cadeea16bce4e26a5af846ed62c189
BLAKE2b-256 3332b8893310e8b55dc5a0f546bfe3c830f4d5cdd787520157f0be91a12f4e65

See more details on using hashes here.

Provenance

The following attestation bundles were made for stow_python-2.4.1.tar.gz:

Publisher: python-publish.yml on isarandi/stow-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page