Install apbs with pip
Project description
pip install apbs-binary (Unofficial binary distribution of APBS)
Install and use APBS with ease in Python.
pip install apbs-binary
from apbs_binary import run_apbs, popen_apbs, run_multivalue, popen_multivalue
run_apbs("--help") # like subprocess.run(["apbs", "-h"])
popen_apbs("--help") # like subprocess.Popen(["apbs", "-h"])
# For no-argument case, pass an empty string
run_apbs("") # like subprocess.run(["apbs"])
# Pass a list of arguments
run_apbs(["-Trim", "input.pdb"])
# Run multivalue
run_multivalue(...)
popen_multivalue(...)
The other tools are also available. Use as apbs_binary.run_analysis("--help")
for example.
Supported platforms:
- Linux x86_64 (Ubuntu 20.04 +)
- MacOS x86_64 (11.6+), arm64 (12.0+)
[!NOTE] Installing the package does NOT put the binary in $PATH.
If you need to directly execute the binary, you can executeapbs_binary.APBS_BIN_PATH
on Linux. For macOS, the environment variableDYLD_LIBRARY_PATH
must be set toapbs_binary.LIB_DIR
.
👨💻️ Maintenance Notes
Releasing a new version with CI (recommended)
Go to Github Actions and run the Build and Release
workflow.
Version rule:
3.4.1.2:
- 3.4.1 is the APBS version
- the last digit (.2) is the patch/build number. It increases as we rebuild the wheels with different configurations or update the python API.
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
uv tool install huggingface_hub
# Mac
brew install gnu-sed
Download the built binaries into data/
:
huggingface-cli download --repo-type dataset --local-dir data Deargen/py-apbs-binary
Build four wheels on all platforms. Basically it will put the binaries in the src/apbs_binary/bin/
folder and then build the wheels in a temp directory, outputting the wheels to dist/
.
# first arg: APBS version to find in `data/` (i.e. data/apbs-3.4.1/APBS-3.4.1.Linux)
# second arg: wheel version
bash build_python.sh 3.4.1 3.4.1.2
Test the wheel
uv venv
source .venv/bin/activate
uv pip install -r requirements_test.txt
uv pip install build_python/dist/*.whl # choose the wheel for your platform only.
pytest
Notes
- The official 3.4.1 binary is not static and depends on python39.dll, libpython3.9.so.1.0, etc. on Windows and Mac (Linux seems fine)
brew install brewsci/bio/apbs
is not static either and depends on libmetis.dylib.- In this repository, we use the brew-created binary for macOS and the official binary for Linux. We don't support Windows yet.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file apbs_binary-3.4.1.1-py3-none-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: apbs_binary-3.4.1.1-py3-none-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 9.7 MB
- Tags: Python 3, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7250244ab299eb6de4bcb6a2e90c5c6321a568ca4f6a69e6a5a1b6f18345ac1e |
|
MD5 | 8a1c8f508a3b6facc56af485d3d86c0d |
|
BLAKE2b-256 | 26da8ca1ee9cd8cd97c9910e9b0e93c8aa4a3ad05f84d28069c9693f8d300a58 |
File details
Details for the file apbs_binary-3.4.1.1-py3-none-macosx_12_0_arm64.whl
.
File metadata
- Download URL: apbs_binary-3.4.1.1-py3-none-macosx_12_0_arm64.whl
- Upload date:
- Size: 813.6 kB
- Tags: Python 3, macOS 12.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3e22d314e5ef15909f320f8f0dbb6b35d7d85e5a356d891fddb1259a282408f |
|
MD5 | aff2665d3505843e44e1dde082498aec |
|
BLAKE2b-256 | c9c80270565c86f0b76bc5544fbf092b2bfd485f821eec22dab6b464b6bc24f4 |
File details
Details for the file apbs_binary-3.4.1.1-py3-none-macosx_10_15_x86_64.whl
.
File metadata
- Download URL: apbs_binary-3.4.1.1-py3-none-macosx_10_15_x86_64.whl
- Upload date:
- Size: 944.5 kB
- Tags: Python 3, macOS 10.15+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd87156bdc54edd2e8cb4440a20120610bf5d15c45fca3932e908c369a3b27c7 |
|
MD5 | 22e57f5609982d123f545d9fdea6c2b7 |
|
BLAKE2b-256 | 57ee380b357c5558e37090857ccdee6ca823a3d88f18b613db2d378483a4339a |