Metadata-Version: 2.1
Name: python_pmpm
Version: 0.2.0
Summary: a package manager written in Python for manually installing a compiled stack
Home-page: https://github.com/ickc/python-pmpm
License: BSD-3-Clause
Keywords: package manager
Author: Kolen Cheung
Author-email: christian.kolen@gmail.com
Requires-Python: >=3.10
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: POSIX
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Utilities
Provides-Extra: docs
Provides-Extra: extras
Provides-Extra: mpi
Provides-Extra: tests
Requires-Dist: coloredlogs (>=14,<16) ; extra == "extras"
Requires-Dist: coverage ; extra == "tests"
Requires-Dist: coveralls ; extra == "tests"
Requires-Dist: custom-inherit (>=2.3,<3.0)
Requires-Dist: defopt (>=6,<7)
Requires-Dist: flake8 ; extra == "tests"
Requires-Dist: furo ; extra == "docs"
Requires-Dist: linkify-it-py ; extra == "docs"
Requires-Dist: mpi4py (>=3,<4) ; extra == "mpi"
Requires-Dist: myst-parser ; extra == "docs"
Requires-Dist: psutil (>=5,<6)
Requires-Dist: pytest ; extra == "tests"
Requires-Dist: pytest-cov ; extra == "tests"
Requires-Dist: pytest-mpi ; extra == "tests"
Requires-Dist: pytest-parallel ; extra == "tests"
Requires-Dist: pyyaml (>=6,<7)
Requires-Dist: sphinx ; extra == "docs"
Requires-Dist: sphinx-autobuild ; extra == "docs"
Requires-Dist: sphinx-last-updated-by-git ; extra == "docs"
Requires-Dist: sphinxcontrib-apidoc ; extra == "docs"
Requires-Dist: yamlloader (>=1,<2)
Project-URL: Documentation, https://ickc.github.io/python-pmpm
Project-URL: Repository, https://github.com/ickc/python-pmpm
Description-Content-Type: text/markdown

# Python manual package manager—a package manager written in Python for manually installing a compiled stack

```{toctree}
:maxdepth: 2
:numbered:
:hidden:

api/modules
CHANGELOG
```

<!-- [![Documentation Status](https://readthedocs.org/projects/souk-data-centre/badge/?version=latest)](https://souk-data-centre.readthedocs.io/en/latest/?badge=latest&style=plastic)
[![Documentation Status](https://github.com/ickc/python-pmpm/workflows/GitHub%20Pages/badge.svg)](https://ickc.github.io/souk-data-centre)

![GitHub Actions](https://github.com/ickc/python-pmpm/workflows/Python%20package/badge.svg)

[![Supported versions](https://img.shields.io/pypi/pyversions/souk-data-centre.svg)](https://pypi.org/project/souk-data-centre)
[![Supported implementations](https://img.shields.io/pypi/implementation/souk-data-centre.svg)](https://pypi.org/project/souk-data-centre)
[![PyPI Wheel](https://img.shields.io/pypi/wheel/souk-data-centre.svg)](https://pypi.org/project/souk-data-centre)
[![PyPI Package latest release](https://img.shields.io/pypi/v/souk-data-centre.svg)](https://pypi.org/project/souk-data-centre)
[![GitHub Releases](https://img.shields.io/github/tag/ickc/python-pmpm.svg?label=github+release)](https://github.com/ickc/python-pmpm/releases)
[![Development Status](https://img.shields.io/pypi/status/souk-data-centre.svg)](https://pypi.python.org/pypi/souk-data-centre/)
[![Downloads](https://img.shields.io/pypi/dm/souk-data-centre.svg)](https://pypi.python.org/pypi/souk-data-centre/)
![License](https://img.shields.io/pypi/l/souk-data-centre.svg) -->

## Introduction

Python manual package manager is a package manager written in Python for manually installing a compiled stack.
Before you proceed, you should know that for typical usage, `conda` (and its friends `mamba`/`micromamba`) should be enough for the purpose.
`pmpm` built on top of `conda` which also compile some Python packages locally.

Goal:

- Custom compilation of some packages, possibly for optimization such as `-march` and `-mtune` which is beyond what `conda` offers.
- Provide fast re-compile after some small local changes, suitable for development.

Approaches:

- `conda_install`: Both the conda provided stack and the compiled stack from `pmpm` are in the same prefix, this makes activating an environment seamless. It is achieved by cleanly compile an environment using the conda provided stack only, including compilers.
- `system_install`: The conda provided stack and the compiled stack from `pmpm` has a different prefix. This makes the 2 completely separate, where the compiled stack can uses the host compilers. This is useful for example when the vendor provided MPI compilers are needed. This also has more points of failure, as we can't completely control what is in the host environment. `pmpm` only serves as automation for reproducibility. But you probably need to modify how `pmpm` behaves on different host, and you probably need to install packages from the OS package manager.

Alternative approach:

- You can create a conda recipe and use `conda-build` and tweak from there for customization. The only downside probably is the time it takes to re-compile after modifications.

## Installation

```sh
pip install pmpm
```

## Development

```sh
git clone https://github.com/ickc/python-pmpm.git
cd python-pmpm
conda activate
mamba env create -f environment.yml
conda activate pmpm
pip install -e .
```

## Usage

Use one of the example config in this repository:

```sh
pmpm conda_install "$HOME/pmpm-test" --file examples/....yml
```

## Design

When installing from a YAML file such as those given in the `examples/` directory,
`pmpm` behaves as a superset of conda/mamba with an extra `_pmpm` key in the YAML configuration.
`pmpm` will compile packages available in `pmpm.packages` after the conda environment is created,
as defined in the YAML file.

