Skip to main content

Flux Python Bindings

🐍️ You called me?

Hello! You've found the flux Python bindings to build and deploy Flux to Pypi without needing to store code alongside Flux. This was originally developed at vsoch/flux-python and has been ported here to automate more officially. The following guides might be useful to you:

Helper Install

If you need to install on a system without Flux, please target a wheel (.whl) file directly that matches the version of Flux you intend to use it with. A vanilla pip install will try to compile from source, which requires Flux. If you don't want to figure out your flux version and install with pip directory (per instructions in manual install) we provide a helper script install-flux-python.sh that will:

  1. Determine that Flux and Python are installed with pip
  2. Parse the version of Flux on your PATH
  3. Derive the version and run the command for you!

You'll first want to make sure that flux is on your path, as is a python3 executable with pip installed as a module alongside it. And you can run it as follows:

wget https://raw.githubusercontent.com/flux-framework/flux-python/main/script/install-flux-python.sh
chmod +x ./install-flux-python.sh
./install-flux-python.sh

If a version is missing on pypi or you otherwise have a bug, please open an issue here.

Manual Install

Since we need to link to Flux libraries, you are advised to install flux and flux-security in the same location that will be discovered via the executable "flux," so typically /usr or /usr/local. You will need wheel installed:

$ pip install wheel

You can do either:

# Find the flux version on your system
flux --version

# Install the bindings that match that version
pip install flux-python==0.48.0

And if you are having trouble with the WCI cache, you can also wget the file directly from pypi and install the .tar.gz directly.

wget https://files.pythonhosted.org/packages/25/fb/02951d80e44a19db291f0e7370d4e7d82c0c1b17709a37913881f958dff7/flux-python-0.48.0rc0.tar.gz
pip install flux-python-0.48.0rc0.tar.gz

If you install to a local (personal) location (e.g., $HOME/.local) you'll need to add this to your PYTHONPATH

# The directory "flux" is under the site-packages here
export PYTHONPATH=$HOME/.local/lib/python3.7/site-packages

You can then do some basic testing.

$ flux start --test-size=4

Ensure your PYTHONPATH is correct here And import flux.

$ ipython
import flux
flux.Flux()

Development

We provide a .devcontainer environment you can open in VSCode to have an environment ready to go with Flux (and Flux Security). You can follow the instructions in the DevContainer to build the Flux Python bindings. By default, this environment installs the latest flux-core. If you want to build a custom version with Flux core you can do:

rm -rf ~/flux-core
export FLUX_VERSION=0.49.0
wget https://github.com/flux-framework/flux-core/releases/download/v${FLUX_VERSION}/flux-core-${FLUX_VERSION}.tar.gz
tar -xzvf flux-core-${FLUX_VERSION}.tar.gz
sudo mv flux-core-${FLUX_VERSION} ~/flux-core
rm flux-core-${FLUX_VERSION}.tar.gz
cd ~/flux-core
./configure --prefix=/usr
make
sudo make install

And then copy over the Python source to "flux" and build your custom archives and/or wheels:

$ rm -rf /workspaces/flux-python/flux
$ cp -R src/bindings/python/flux /workspaces/flux-python/flux
$ cd /workspaces/flux-python
# Archive
$ python3 setup.py sdist

# Wheel (will build for the python version you've targeted)
# This isn't currently being done but is a future TODO!
$ python3 setup.py sdist bdist_wheel

You can build versions of the Python wheels across 3.6 to 3.10 like:

# only need to run this once in the container
/bin/bash ./docker/install-mamba.sh

# And this to install the current Flux + version in setup.py as a wheel
# The number is the build number
/bin/bash ./docker/build-wheels.sh 2

And if you want to upload:

$ twine upload dist/*.tar.gz

Automation

In order to (eventually) support a workflow to check for a release, get the release's flux assets and build, we have a workflow script that will:

  • Get the latest flux releases
  • Compare to the latest pypi releases
  • If there is a new release (from Flux on GitHub) not in pypi, build and release

And the script also can take an optional version string that will find and build a version explicitly. You might (to test) do:

$ export GITHUB_TOKEN=xxxxxxxxxxxxx
$ python .github/scripts/check_releases.py flux-framework --version 0.46.0

That basically checks if there should be a build. It will use the container provided here to install a custom version of flux core that builds the release.

Release

SPDX-License-Identifier: LGPL-3.0

LLNL-CODE-764420

Release files for flux-python 0.82.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flux-python 0.82.0
File Size Uploaded
flux_python-0.82.0.tar.gz 374.3 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for flux-python 0.82.0
File
flux_python-0.82.0-0-cp314-cp314-manylinux_2_17_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.17+ x86-64 Details
flux_python-0.82.0-0-cp313-cp313-manylinux_2_17_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details
flux_python-0.82.0-0-cp312-cp312-manylinux_2_17_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
flux_python-0.82.0-0-cp311-cp311-manylinux_2_17_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
flux_python-0.82.0-0-cp310-cp310-manylinux_2_17_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
flux_python-0.82.0-0-cp39-cp39-manylinux_2_17_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
flux_python-0.82.0-0-cp38-cp38-manylinux_2_17_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details

Total release size: 4.7 MB

Release files / flux_python-0.82.0.tar.gz

Download URL flux_python-0.82.0.tar.gz
Size 374.3 kB
Tags Source
SHA-256 checksum
How to use checksums
65cd008447f470b3f219b951e0aeaf09dc63c13b562f2d9337dea155c2fc2ce0
BLAKE2b-256 checksum
How to use checksums
e45da3e34b3bf96a908730e66c74bd8078a50ce2ddc8fcd3dd03dc9a7563d48c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / flux_python-0.82.0-0-cp314-cp314-manylinux_2_17_x86_64.whl

Download URL flux_python-0.82.0-0-cp314-cp314-manylinux_2_17_x86_64.whl
Size 617.8 kB
Tags CPython 3.14 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
a9e8b7cffcddda6f1b9341903471ad41aaa8b1819ac5a89defaa43276cdeb398
BLAKE2b-256 checksum
How to use checksums
0db1836cae93ac827ca6584f33c53383b6c98ce04d6ba8c9c72b90273b496272
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / flux_python-0.82.0-0-cp313-cp313-manylinux_2_17_x86_64.whl

Download URL flux_python-0.82.0-0-cp313-cp313-manylinux_2_17_x86_64.whl
Size 617.3 kB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
00448b1d5229c90ce3be49052b3cebee98342884a4355980f1e725dcb198b4ba
BLAKE2b-256 checksum
How to use checksums
cee82e74b404bb1d86d0f0ce6447b09cb4d831f4614dfc15078ba917d5c1bf86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / flux_python-0.82.0-0-cp312-cp312-manylinux_2_17_x86_64.whl

Download URL flux_python-0.82.0-0-cp312-cp312-manylinux_2_17_x86_64.whl
Size 617.3 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
b80b305951797dc49fcc19d2c7accf2e673910ec88bdf27b636e568851e40d2e
BLAKE2b-256 checksum
How to use checksums
bb86c9bfab1441467d7e01ce6742fe357bd577742ce0bdfc7164fc3b32900aaa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / flux_python-0.82.0-0-cp311-cp311-manylinux_2_17_x86_64.whl

Download URL flux_python-0.82.0-0-cp311-cp311-manylinux_2_17_x86_64.whl
Size 617.2 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
9220b5b21fcf35e7ae6c8fb50918f84b6d21bfb8e40f048bce40951d4977df1a
BLAKE2b-256 checksum
How to use checksums
417fc71d8d00d42ff53a5ebc9108c70b791c178e48b96d14a55f49bc72562ccc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / flux_python-0.82.0-0-cp310-cp310-manylinux_2_17_x86_64.whl

Download URL flux_python-0.82.0-0-cp310-cp310-manylinux_2_17_x86_64.whl
Size 617.2 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
9f934584c562fe330bbea6535551764298875ef099b874da525ec03f0d8bbb3b
BLAKE2b-256 checksum
How to use checksums
bdcb3fbb641a4a27c5013dcc8152aea59a889f66bf718656ead16f66ced31537
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / flux_python-0.82.0-0-cp39-cp39-manylinux_2_17_x86_64.whl

Download URL flux_python-0.82.0-0-cp39-cp39-manylinux_2_17_x86_64.whl
Size 617.3 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
e714d3e9f7424e5784a0b345a309659ceabf0e7ca1d022898508a3761044a7a6
BLAKE2b-256 checksum
How to use checksums
e1a664fb7eed26db1a2e1e7c9265a7b4f1de7c05e15daa15ad96fbee0e9c37b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / flux_python-0.82.0-0-cp38-cp38-manylinux_2_17_x86_64.whl

Download URL flux_python-0.82.0-0-cp38-cp38-manylinux_2_17_x86_64.whl
Size 617.2 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
ed65ce2c4f9cb1a8bfd48b92cc29766e34a3cd5f77ba1f5f34e5d41076ce3cd7
BLAKE2b-256 checksum
How to use checksums
de78ae2d313f3a06f9e9848f7232a63d28a31e0d6b22b77dfc7d838aaa9c4c3e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

0.88.0

8 release files

0.87.0

8 release files

0.86.0

8 release files

0.85.0

8 release files

0.84.0

8 release files

0.83.0

8 release files

This release

0.82.0 This release

8 release files

0.81.0

7 release files

0.78.0

5 release files

0.77.0

5 release files

0.75.0

5 release files

0.73.0

5 release files

0.70.0

5 release files

0.68.0

6 release files

0.65.0

6 release files

0.62.0

6 release files

0.61.2

6 release files

0.61.0

6 release files

0.59.0

1 release file

0.58.1

1 release file

0.58.0

1 release file

0.57.0

1 release file

0.56.0

1 release file

0.55.0

1 release file

0.54.0

1 release file

0.53.0

1 release file

0.52.0

1 release file

0.51.0

1 release file

0.50.0

1 release file

0.49.0

5 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page