Skip to main content

Multi Use PipelineS: reproducible job templates for Python projects

Project description

███╗   ███╗    ██╗   ██╗    ██████╗     ███████╗
████╗ ████║    ██║   ██║    ██╔══██╗    ██╔════╝
██╔████╔██║    ██║   ██║    ██████╔╝    ███████╗
██║╚██╔╝██║    ██║   ██║    ██╔═══╝     ╚════██║
██║ ╚═╝ ██║    ╚██████╔╝    ██║         ███████║
╚═╝     ╚═╝     ╚═════╝     ╚═╝         ╚══════╝
            [ Multi Use PipelineS ]

mups (Multi Use PipelineS) is a small utility that turns any ordinary project folder into a reproducible job template.

What is this about?

Maybe you’re a scientist or an engineer with a handful of Python scripts you keep tweaking.
You want to run experiments, try variations, or prototype ideas without turning your project folder into a pile of half-finished runs and scripts scripts like final.py, final2.py, and final_revised.py.

That’s where mups comes in. It sits in the gap between an idea and a commit.

One command turns your project into a small, clean pipeline: every time you launch it, mups creates a fresh timestamped job folder, copies your code into it, captures your settings, sets up (or links) the environment, and executes the run inside that isolated snapshot.
Each job is reproducible, self-contained, and safe to archive or share.

You can even choose how tightly a job depends on the template:
some jobs use lightweight links to save space, some copy only what’s needed, and others bundle everything to remain fully portable across machines.

It’s made for people who want to stay close to the code—no container gymnastics, no heavyweight tooling—and who don’t want boilerplate or setup work getting in the way of their ideas.

Have a look at this relevant discussion: https://news.ycombinator.com/item?id=45790061

Explaining visually

myproject/
├── main.py
├── ...
├── data/
│   └── raw.csv
└── anything_else.py

        │ python -m mups (a.k.a "mupsification")
        ▼

myproject/
├── main.py
├── ...
├── data/               <- try out a new function parameter
│   └── raw.csv
├── anything_else.py
├── conf.py     (NEW!)  <- tweak settings before each run
├── reqs.txt    (NEW!)
├── boot.py     (NEW!)
├── README.md   (NEW!)
├── venv.sh     (NEW!/OPTIONAL)
└──  ...

        │ run boot.py
        ▼

myproject/
├── ...
└── jobs/
    └── 2025-01-20-14-38-21-desc/
        ├── main.py      (COPIED)
        ├── ...          (COPIED/LINKED)
        ├── data/        (COPIED/LINKED)
        │   └── ...      (COPIED/LINKED)
        ├── conf.py      (COPIED)
        ├── reqs.txt     (COPIED)
        ├── README.md    (NEW!)
        ├── venv.sh      (COPIED/OPTIONAL)
        └── .venv/       (COPIED/LINKED/RECREATED/etc)

        │ Commit, Repeat, Send, Discard, etc 
        ▼ (or run boot again with different settings!)

Once a folder is “mups-ified”, every execution of boot.py creates a new, timestamped job directory containing:

  • a full snapshot of your code
  • a copy of conf.py
  • a copy of reqs.txt
  • an optional .venv depending on configuration
  • a job-specific README
  • and then runs main.py inside that job

Each job folder is self-contained, portable, and reproducible.

This is useful when:

  • You want reproducible runs without needing Docker.
  • You want each job run isolated from future edits.
  • You want to ship computations to another machine.
  • You want clean provenance for papers, pipelines, or reports.

Docker can still wrap the whole thing if you need it, but it’s optional.

Another advantage: You don't need the mups package after mupsifying the template dir! That's right. No extra packages, no extra dependencies. Run once then rely on boot.py.


Installation

mups is on PyPI:

pip install mups

...or SSH install directly from GitLab:

pip install git+ssh://git@gitlab.com/mhnv/mups.git
pip install -e .

After installation, the command:

python -m mups

runs the generator. Importing mups in Python scripts does nothing currently.


What the generator does

When you run python -m mups inside any project folder, it creates:

  • boot.py – the launcher that creates job directories and runs main.py
  • conf.py – configuration (ENV_MODE, JOB_DESCRIPTION, INCLUDE/EXCLUDE)
  • reqs.txt – pinned Python version + your dependencies
  • venv.sh – helper script for environment recreation on another machine
  • README.md – instructions for using that folder as a job template

If these files already exist, they are left untouched (with warnings), except boot.py, which refuses to overwrite to keep you from nuking your project.

This turns your folder into a template.

From then on, you run:

python boot.py

to produce jobs.


How jobs work

Each call to boot.py:

  1. Creates a timestamped folder under jobs/
  2. Copies your project into it (with INCLUDE/EXCLUDE filters applied)
  3. Always copies main.py
  4. Never copies boot.py
  5. Copies conf.py, reqs.txt, and venv.sh
  6. Handles .venv according to ENV_MODE
  7. Writes a job-specific README
  8. Runs main.py inside the job

Jobs are isolated snapshots. Editing your template folder afterwards does not affect previous jobs.


ENV_MODE options

new_venv
Creates a fresh .venv inside each job and installs packages from reqs.txt.

copy_parent
Copies the template folder’s .venv into the job.

link_parent
Symlinks the template .venv into the job.

deferred_venv
Does not create .venv. Ships venv.sh so another machine can recreate it later.

All modes validate Python versions if specified in reqs.txt.


INCLUDE / EXCLUDE rules

Only one may be used at a time.

INCLUDE
Only listed names are copied, plus: main.py, conf.py, reqs.txt, venv.sh.

EXCLUDE
Everything except listed names is copied, plus the same mandatory set.

Rules that cannot be overridden:

  • main.py is always copied
  • boot.py is never copied
  • parent README is never copied (jobs get their own)

Minimum project structure

Your project folder must contain:

  • main.py (entry point)
  • whatever supporting modules you need

Everything else is optional.


Typical workflow

  1. Create a new project folder

  2. Add main.py and your code

  3. Run:

     python -m mups
    
  4. Adjust conf.py

  5. Run:

     python boot.py
    
  6. A new job appears under jobs/ and immediately runs main.py.


More features in the pipeline

  • The ability to specify not only files but specific sub-modules to copy (so you don't have to ship your entire code-base)

Why this exists

Some people want reproducibility but refuse to touch Docker. Others need snapshot-per-run behavior for research, pipelines, HPC clusters, or publication supplements. mups is a tiny, boring solution that does exactly that without teaching you a container ecosystem.

If it saves one person from “but it worked on my machine”, it has done its job.

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

mups-0.1.2.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mups-0.1.2-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

Details for the file mups-0.1.2.tar.gz.

File metadata

  • Download URL: mups-0.1.2.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for mups-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9a4db58825d6a3d0594cc901b144af5b991659d5dfc3847ef299b46b12365565
MD5 3edffdb46a66cb7331b3c5de05f5b4fc
BLAKE2b-256 04f722a6f8ea97598ce190434e230aa4df0b4039d40373c1ef4f4cdb504f9445

See more details on using hashes here.

File details

Details for the file mups-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: mups-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 19.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for mups-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ed38d1cb2bd1d461069d0461b095e5b9777d7f55ef320b8f00110cc093c943b5
MD5 22450e3a98bac7e6c729d03a0066f06f
BLAKE2b-256 56e17b28232c5400cd028bf094f73a517d2b11c5954a8201ca04a5b75764d4e5

See more details on using hashes here.

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