Skip to main content

MiPi Environment Manager


This project provides a standard way to configure and distribute python environments. It is intended to be a simpler solution than Docker, for when docker is not available or practical. This project creates a series of requirments.txt files and installer batch files for each. It automatically installs each environment as per the specs of a Yaml configuration file. This command can be scheduled, so that each requirements.txt file and environment area always up to date with the correct versions and environment variables.

My team uses this since we do not have docker. Every day this script is scheduled to run and update the environment installers. Then every developer's computer is scheduled to install the environments. Our production server does the same thing so that all environments match, and are up to date.

Quick Start

1. Setup the Yaml file

this file configures each environment's dependencies.

environments:
  {example-environment-name}:
    setup: (setup for this environment)
      py_version: { your-python-version }
      include_in_master: { boolean-value }
    packages:
      { package-name }:
        source: { where-to-get (github/pypi)}
        version: { semantic-version }
        version_policy: { policy (exact/no_major_increment) }
        path: {github/repo/url (github repos only)}

setup: (local setup for all environments)
  outpath: { path/to/root/folder (where environments management files will be created)}
  environment_variables:
    { environment-key }: { environment-value }

YAML Options

  • example-environment-name:
    • string name of the conda environment
    • you can create more than one environment. each will get its own requirements.txt and install.bat files
  • package-name
    • for pypi packages: name of the package to install
    • for github packages: name to install the github release as
  • source
    • where to download the package
    • options:
      • "github": install a release from a github repo
      • "pypi": install a pypi package
  • version
    • semantic version to install
    • github: strip the "v" from the release tag and downloads that version
    • pypi: version
  • version policy
    • options:
      • "exact": install the exact version of a package
      • "no_major_increment": get the version of the package but do not allow for a "major" update
      • (not specified): if this option is not specified. It will get the exact version option. If the exact version is not specified it will grab the latest
  • path
    • url to the github repo if applicable

2. Configure environment variables for the script

- GH_TOKEN: personal access token to github. This is used to query the tags for repo releases. This is required
          otherwise github would install the latest commit.
- MIPI_DEVOPS_PATH: path to where this file is saved locally on the computer

3. Run (schedule) the script mipi publish-envs #end point not yet implemented

4. install any or all environments using batch files

Installer file structure

/root_folder contains:

  • master_installer.bat: run this to install all environments which used "include_in_master" option. This also creates environment variables
  • one directory per environment

/root_folder/environment_folder contains:

  • requirments.txt
  • create_env.bat: run this to install the environment. overwrites it if it already exists
  • update_env.bat: run this to update the environment without overwriting it. This is much faster

5 Build the batch files

Command

mipi-publish-envs

Flags

--prod (flag) build production installers --test (flag) build test installers --envs (key word) only build one environment --master (flag) build “master” installers. must be used with test and/or prod, master installer file will always include all files set to "include in master" as per the setup file, even if you use --envs

Metadata

Release files for mipi_env_manager 0.3.2

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

Source distribution (sdist)

Source distribution for mipi_env_manager 0.3.2
File Size Uploaded
mipi_env_manager-0.3.2.tar.gz 9.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mipi_env_manager 0.3.2
File Interpreter ABI Platform
mipi_env_manager-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 21.2 kB

Release files / mipi_env_manager-0.3.2.tar.gz

Download URL mipi_env_manager-0.3.2.tar.gz
Size 9.8 kB
Tags Source
SHA-256 checksum
How to use checksums
80787c3c36a268f2da769470273bd2f921a53e28eaa18f49eed604ecb79c1eba
BLAKE2b-256 checksum
How to use checksums
d49715e7bb4cbd32b9495dd85550b1e08ed23b1ca74c4f85495a839f3672d2e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.5 Windows/10

Release files / mipi_env_manager-0.3.2-py3-none-any.whl

Download URL mipi_env_manager-0.3.2-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
30d559683dcef77a76e41acf2ef9c8b706c77e4f987fe103a6892698b7a150da
BLAKE2b-256 checksum
How to use checksums
cb49bc2f5788ecb74114e2373cfca93a239a09c9702152ad745878b335f3e2fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.5 Windows/10

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 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