Skip to main content

Install reduce with pip

Project description

pip install reduce-binary (unofficial)

build

image PyPI - Downloads image image

Install and use reduce with ease in Python.

pip install reduce-binary
import reduce_binary

print(reduce_binary.REDUCE_BIN_PATH)
reduce_binary.run_reduce("-h")  # like subprocess.run(["reduce", "-h"])
reduce_binary.popen_reduce("-h")  # like subprocess.Popen(["reduce", "-h"])

# For no-argument case, pass an empty string
reduce_binary.run_reduce("")  # like subprocess.run(["reduce"])

# Pass a list of arguments
reduce_binary.run_reduce(["-Trim", "input.pdb"])

There exists a wrapper function.

from reduce_binary.helpers import protonate

protonate(
    "input.pdb",
    "output.pdb",
    remove_hydrogen_first=True,
    print_stderr=False,
)

Supported platforms:

  • Linux x86_64
  • MacOS x86_64, arm64 (Intel and Apple Silicon)

[!NOTE] Installing the package does NOT put the binary in $PATH.
Instead, the API will tell you where it is located.

👨‍💻️ Maintenance Notes

Releasing a new version with CI (recommended)

Go to Github Actions and run the Build and Release workflow.

Version rule:

e.g.: 4.14.0.2

  • 4.14 is the reduce version
  • the last digit is the build/API version number

Running locally

This section describes how it works.

To run it locally, first install the dependencies:

pip install uv --user --break-system-packages
uv tool install wheel
uv tool install build

# Mac
brew install gnu-sed

Build the app at buiid/ (reduce):

# Linux
bash build_reduce_linux.sh v4.14
# Mac (Intel)
MACOSX_DEPLOYMENT_TARGET=10.12 bash build_reduce_mac.sh v4.14
# Mac (Apple Silicon)
MACOSX_DEPLOYMENT_TARGET=11.0 bash build_reduce_mac.sh v4.14

[!NOTE] Linux build uses an old version of ubuntu docker to be compatible with old systems.
It also checks if the glibc dependency is lower than 2.17.
In the future you may need to increase this version in the script.

[!NOTE] The MACOSX_DEPLOYMENT_TARGET is the cmake flag.
https://cmake.org/cmake/help/latest/envvar/MACOSX_DEPLOYMENT_TARGET.html

Build the wheel. It copies the python to build_python/, built binary into it, modifies the version number and builds the wheel in build_python/dist/.:

# One of the following
bash build_python.sh 4.14 manylinux_2_17_x86_64.manylinux2014_x86_64
bash build_python.sh 4.14 macosx_10_12_x86_64
bash build_python.sh 4.14 macosx_11_0_arm64

Test the wheel

uv venv
source .venv/bin/activate
uv pip install -r requirements_test.txt
uv pip install build_python/dist/*.whl
pytest

✅ TODO

  • Cross-compile for Linux
  • Windows build
  • CHANGELOG and publish to releases

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

reduce_binary-4.14.0.1-py310-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (13.6 MB view details)

Uploaded Python 3.10 manylinux: glibc 2.17+ x86-64

reduce_binary-4.14.0.1-py310-none-macosx_11_0_arm64.whl (13.6 MB view details)

Uploaded Python 3.10 macOS 11.0+ ARM64

reduce_binary-4.14.0.1-py310-none-macosx_10_12_x86_64.whl (13.6 MB view details)

Uploaded Python 3.10 macOS 10.12+ x86-64

File details

Details for the file reduce_binary-4.14.0.1-py310-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for reduce_binary-4.14.0.1-py310-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 e56a3e55c22fc681c33130cdecf5466882375308d3d83ac42b9269f7a609b9b8
MD5 73ddbce0233c34283860b66b612139aa
BLAKE2b-256 63f0f685ccac25a5e7eef1163553f95dc9523171de2556c479abdee2a84bc0b5

See more details on using hashes here.

File details

Details for the file reduce_binary-4.14.0.1-py310-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for reduce_binary-4.14.0.1-py310-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a7447403db1dc44d88229a3ab93478abda92b8ad0b4125d0524b8cb960421e09
MD5 1d7db6b9f3466c758cc85261e283312a
BLAKE2b-256 071219ebfc435af8f62e078be334ff9b46cba771ce0c8a674bed57794245822c

See more details on using hashes here.

File details

Details for the file reduce_binary-4.14.0.1-py310-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for reduce_binary-4.14.0.1-py310-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 76144dc6f528d850e1e6be6d6aef9d14877bfd66477fb8d4fbe8194f941650ee
MD5 d029df5339406792fb495c888705a732
BLAKE2b-256 f6c7cd69e3fe1e9a3a51f3a214eaadb29160dce83a0ca77c562f05218c0a68c2

See more details on using hashes here.

Supported by

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