micropipenv


Namemicropipenv JSON
Version 1.8.1 PyPI version JSON
download
home_pagehttps://github.com/thoth-station/micropipenv
SummaryA simple wrapper around pip to support requirements.txt, Pipenv and Poetry files for containerized applications
upload_time2024-10-29 16:24:10
maintainerFridolin Pokorny
docs_urlNone
authorFridolin Pokorny
requires_pythonNone
licenseLGPLv3+
keywords packaging pipenv poetry pip dependencies dependency-management utilities
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            µPipenv
-------

.. image:: https://img.shields.io/github/v/tag/thoth-station/micropipenv?style=plastic
  :target: https://github.com/thoth-station/micropipenv/releases
  :alt: GitHub tag (latest by date)

.. image:: https://travis-ci.com/thoth-station/micropipenv.svg?branch=master
  :target: https://travis-ci.com/thoth-station/micropipenv

.. image:: https://img.shields.io/pypi/pyversions/micropipenv?style=plastic
  :target: https://pypi.org/project/micropipenv
  :alt: PyPI - Python Version

.. image:: https://img.shields.io/pypi/l/micropipenv?style=plastic
  :target: https://pypi.org/project/micropipenv
  :alt: PyPI - License

.. image:: https://img.shields.io/pypi/dm/micropipenv?style=plastic
  :target: https://pypi.org/project/micropipenv
  :alt: PyPI - Downloads

A lightweight wrapper for pip to support requirements.txt, Pipenv and Poetry
lock files or converting them to `pip-tools
<https://pypi.org/project/pip-tools/>`_ compatible output. Designed for
containerized Python applications but not limited to them.

For a brief video preview, `check this demo
<https://www.youtube.com/watch?v=I-QC83BcLuo&t=8m58s>`_ (the micropipenv
part starts at 9:00).

See also `micropipenv: Installing Python dependencies in containerized
applications
<https://developers.redhat.com/articles/2021/05/19/micropipenv-installing-python-dependencies-containerized-applications>`__
for more info about this tool and a `blog post published about it
<https://dev.to/fridex/micropipenv-the-one-installation-tool-that-covers-pipenv-poetry-and-pip-tools-3ee7>`__.

What's the difference in comparision to pip when using requirements.txt?
=========================================================================

* if ``requirements.txt`` state all the packages in a pinned version with
  hashes (e.g. `pip-tools <https://pypi.org/project/pip-tools/>`_), micropipenv
  installs packages with a possible fallback if the installation order is
  relevant

  * you don't need to care about the installation and maintain correct order or
    requirements in ``requirements.txt``

  * best effort installation - try until there is a possibility to succeed

* if ``requirements.txt`` do not state all the packages in a pinned form

  * pip's resolver algorithm is used and it's left on pip to resolve
    requirements

  * the same behavior as micropipenv would not be used


What's the difference in comparision to Poetry?
===============================================

* a lightweight addition to Poetry, not a Poetry replacement

  * micropipenv does not substitute Poetry it rather complements it for
    containerized deployments where the size of the container image and
    software shipped with it matters

* no release management to Python package indexes

* micropipenv does not implement resolver, it uses already resolved stack that
  application is shipped with based on ``poetry.lock`` and ``pyproject.toml``

* no virtual environment management

  * virtual environment management is left on user, if needed

What's the difference in comparision to Pipenv?
===============================================

* a lightweight addition to Pipenv, not a Pipenv replacement

  * micropipenv does not substitute Pipenv it rather complements it for
    containerized deployments where the size of the container image and
    software shipped with it matters

* it does not `vendor all the dependencies as Pipenv
  <https://github.com/pypa/pipenv/tree/master/pipenv/vendor>`_

* micropipenv does not implement resolver, it uses already resolved stack that
  application is shipped with ``Pipfile.lock``

* no virtual environment management

  * virtual environment management is left on user, if needed

micropipenv use cases
=====================

Why should I use ``micropipenv`` instead of `Pipenv <https://github.com/pypa/pipenv>`_
or `Poetry <https://pypi.org/project/poetry>`_?

* I would like to have a tool that "rules them all" - one lightweight tool to
  support all Python dependency lock file managers (pip-tools, Poetry, Pipenv)
  and lets users decide what they want to use when deploying Python applications
  in containerized environments (e.g. Kubernetes, OpenShift, ...).

* I would like to have a fast and minimalistic tool to install software
  packages in CI.

* I would like to have containerized Python applications as small as possible
  with minimum software shipped and required to build and run the Python
  application in production.

* I would like to convert files produced by Pipenv/Poetry to a pip-tools
  compatible output.

* I don't want to install Pipenv/Poetry, but I would like to run a project that
  uses Pipenv/Poetry for dependency management (e.g. restricted environments).

* My Pipenv installation is broken and `Pipenv upstream did not issue any new
  Pipenv release <https://github.com/pypa/pipenv/issues/4058>`_.

* I would like to deploy my application into a production environment and my
  application dependencies are managed by Pipenv/Poetry (dependencies are
  already resolved), but I don't want to run Pipenv/Poetry in production (e.g.
  OpenShift's s2i build process).


``micropipenv install``
=======================

The tool supports installing dependencies of the following formats:

* ``Pipenv`` style lock format - files ``Pipfile`` and ``Pipfile.lock``
* ``Poetry`` style lock format - files ``pyproject.toml`` and ``poetry.lock``
* ``pip-tools`` style lock format - file ``requirements.txt``
* raw ``requirements.txt`` as used by ``pip`` (not a lock file)

In case of Pipenv, Poetry and pip-tools style format, the tool performs
automatic recovery if the installation order of dependencies is relevant (one
dependency fails to install as it depends on an another one).

To enforce the installation method used, specify ``--method`` option to the
``install`` subcommand. By default, ``micropipenv`` traverses the filesystem up
from the current working directory and looks for the relevant files in the
following order:

1. ``Pipfile.lock`` and optionally ``Pipfile`` (if ``--deploy`` set)
2. ``poetry.lock`` and ``pyproject.toml``
3. ``requirements.txt`` for ``pip-tools`` and raw ``pip`` requirements

To install dependencies issue the following command:

.. code-block:: console

  micropipenv install --dev  # --dev is optional

You can supply additional positional arguments that will be passed to ``pip``.
Use double dashes to distinguish ``pip`` options from ``micropipenv`` options.

.. code-block::

  # issue `pip install --user'
  micropipenv install -- --user


Virtual environment management
==============================

``micropipenv`` does not create any virtual environment as in the case of
Pipenv/Poetry.  It simply executes ``pip``, and constructs arguments out of the
lock file used. ``pip``'s default behaviour is to install its arguments into
the same Python environment where ``pip`` is installed (i.e., the system Python
environment).

To rather install its arguments into a virtual environment, run ``micropipenv``
from a shell where that virtual environment has been activated. This causes
``micropipenv`` to run the ``pip`` command already installed in the virtual
environment:

.. code-block:: console

  python3 -m venv venv/ && (. venv/bin/activate && micropipenv install)

Alternatively, ``micropipenv`` can run the ``pip`` command from the system
Python environment, which can in turn be told to install its arguments into an
explicitly specified virtual environment by using the ``PIP_PYTHON``
environment variable.

This allows for the installation of dependencies into a minimal virtual
environment that does not itself have ``pip`` and its dependencies installed
into it:

.. code-block:: console

  python3 -m venv venv/ --without-pip && PIP_PYTHON=venv/bin/python micropipenv install


Using another package index
===========================

To set the default Python Package Index to something other than ``https://pypi.org/simple``, set the ``MICROPIPENV_DEFAULT_INDEX_URLS`` to one or more comma-separated URLs.

  Note: if the package manager file contains a package index URL, it will be used over this value.

.. code-block:: console

  export MICROPIPENV_DEFAULT_INDEX_URLS=https://pypi.example.com/simple,https://pypi.org/simple
  micropipenv install


``micropipenv install --deploy``
================================

If you wish to mimic ``pipenv --deploy`` functionality, you can do so:

.. code-block:: console

  micropipenv install --deploy

Note however, there is a need to parse ``Pipfile`` and verify its content
corresponds to Pipefile.lock used (digest computed on ``Pipfile`` content).
``micropipenv`` requires toml extras for this functionality, so you will need
to install ``micropipenv[toml]`` (see installation instructions bellow).

The ``--deploy`` option takes no effect for Poetry and requirements
installation methods.


``micropipenv install --dev``
================================

Installation of "development" dependencies can be acomplished using the
``--dev`` flag. This flag has no effect when ``requirements.txt`` file is used.


``micropipenv requirements`` / ``micropipenv req``
==================================================

To generate output compatible with `pip-tools
<https://pypi.org/project/pip-tools/>`_, you can issue the following command:

.. code-block:: console

  micropipenv requirements

This applies to conversion from Poetry and Pipenv specific lock files.

Additional configuration options can limit what is present in the output (e.g.
``--no-dev`` to remove development dependencies).

A special option ``--only-direct`` makes ``micropipenv`` work on ``Pipfile``
instead of ``Pipfile.lock``. This requires toml extras, so install
``micropipenv[toml]`` for this functionality (see installation instructions
bellow). To get direct dependencies of an application and store them in
requirements.txt file:

.. code-block:: console

  micropipenv requirements --only-direct > requirements.txt


For a setup that follows ``pip-tools`` convention with ``requirements.in`` and
``requirements.txt``

.. code-block:: console

  micropipenv requirements --no-dev > requirements.txt
  micropipenv requirements --no-dev --only-direct > requirements.in
  micropipenv requirements --no-default > dev-requirements.txt
  micropipenv requirements --no-default --only-direct > dev-requirements.in


See ``micropipenv requirements --help`` for more info.


``micropipenv`` as a library
============================

``micropipenv`` exposes some core functionality on top of
``Pipfile``/``Pipfile.lock``.  You can import its functions and use
``micropipenv`` as a lightweight library for ``Pipfile``/``Pipfile.lock`` and
``pyproject.toml``/``poetry.lock`` manipulation.


Adjusting options using environment variables
=============================================

All options can be triggered using environment variables - the name of an
environment variable is always prefixed with ``MICROPIPENV_`` and consists of
the name of the option converted to uppercase, dashes are replaced with
underscores (example ``--no-dev`` is mapped to ``MICROPIPENV_NO_DEV``). All
environment variables corresponding to flags are parsed as integers and
subsequently casted to a boolean. For example, to turn ``--no-dev`` flag on,
set ``MICROPIPENV_NO_DEV=1`` (0 disables the flag). Parameters supplied to CLI
take precedence over environment variables.

A special environment variable ``MICROPIPENV_PIP_BIN`` can point to an
alternate ``pip`` binary.

To run this tool in a verbose mode, you can set the ``MICROPIPENV_DEBUG=1`` (the
same behavior can be achieved with multiple ``--verbose`` supplied).

The tool prints software stack information to the standard error output. This was
designed for Thoth to capture information about installed dependencies as a
useful source of information for Thoth's build analyzers. This behaviour can be
suppressed by setting ``MICROPIPENV_NO_LOCKFILE_PRINT=1`` environment variable.

Besides printing, the tool also writes the content of Pipfile.lock (if a locked
software stack is used) to the directory where lock files are present (for Pipenv
files, the Pipfile.lock is kept untouched). This behaviour can be suppressed by
providing ``MICROPIPENV_NO_LOCKFILE_WRITE=1`` environment variable.

Example usage
=============

Install dependencies managed by Poetry as ``pip install --user`` would do
(option ``--method`` is optional, auto-discovery is performed if omitted):

.. code-block:: console

  $ ls
  poetry.lock pyproject.toml project.py
  $ micropipenv install --method poetry -- --user

Install dependencies (both main and develop) managed by Poetry into a virtual
environment:

.. code-block:: console

  $ ls
  poetry.lock pyproject.toml project.py
  $ python3 -m venv venv/
  $ . venv/bin/activate
  (venv) $ micropipenv install --dev

Install dependencies managed by Pipenv (both main and develop) into a virtual
environment  (option ``--method`` is optional, auto-discovery is performed if
omitted):

.. code-block:: console

  $ ls
  Pipfile Pipfile.lock src/
  $ python3 -m venv venv/
  $ . venv/bin/activate
  (venv) $ micropipenv install --dev

Perform deployment of an application as Pipenv would do with Python interpreter
version check and Pipfile file hash check (you can create virtual environment
only if necessary):

.. code-block:: console

  $ ls
  Pipfile Pipfile.lock src/
  $ python3 -m venv venv/
  $ . venv/bin/activate
  (venv) $ micropipenv install --deploy

Generate `pip-tools <https://pypi.org/project/pip-tools/>`_ compliant
``requirements.in``, ``dev-requirements.in``, ``requirements.txt`` and
``dev-requirements.txt`` out of ``Pipfile`` and ``Pipfile.lock`` - project
dependencies managed by Pipenv:

.. code-block:: console

  $ ls
  Pipfile Pipfile.lock src/
  $ micropipenv requirements --no-dev > requirements.txt
  $ micropipenv requirements --no-dev --only-direct > requirements.in
  $ micropipenv requirements --no-default > dev-requirements.txt
  $ micropipenv requirements --no-default --only-direct > dev-requirements.in

Generate `pip-tools <https://pypi.org/project/pip-tools/>`_ complaint
``requirements.in``, ``dev-requirements.in``, ``requirements.txt`` and
``dev-requirements.txt`` out of ``pyproject.toml`` and ``poetry.lock`` - project
dependencies managed by Poetry:

.. code-block:: console

  $ ls
  poetry.lock pyproject.toml src/
  $ micropipenv requirements --no-dev > requirements.txt
  $ micropipenv requirements --no-dev --only-direct > requirements.in
  $ micropipenv requirements --no-default > dev-requirements.txt
  $ micropipenv requirements --no-default --only-direct > dev-requirements.in

For OpenShift's s2i integration,
`check this repo with a demo <https://github.com/fridex/s2i-example-micropipenv>`_.

Installation
============

The project is `hosted on PyPI <https://pypi.org/project/micropipenv>`_ so
installing it using ``pip`` works as expected:

.. code-block:: console

  pip install micropipenv

The default installation does not bring any dependencies so its just
``micropipenv`` that gets installed. However, the default installation supports
only ``Pipfile.lock`` management. If you would like to manipulate also with
``Pipfile`` or Poetry specific lock files, you will need to install
``micropipenv`` with TOML support (TOML is not in the standard Python library):

.. code-block:: console

  pip install micropipenv[toml]

Once the project gets installed, you can browse the help message by invoking
the ``micropipenv`` CLI:

.. code-block:: console

  micropipenv --help

If you wish to install ``micropipenv`` on your Fedora system:

.. code-block:: console

  dnf install -y micropipenv

See available `RPM packages <https://src.fedoraproject.org/rpms/micropipenv>`_.

No installation
===============

You can run ``micropipenv`` without actually installing it - simply download
the file and execute it. If you do not wish to save ``micropipenv.py`` file to
disk, you can issue:

.. code-block:: console

  curl https://raw.githubusercontent.com/thoth-station/micropipenv/master/micropipenv.py | python3 - --help

Anything after ``python3 -`` will be passed as an argument to
``micropipenv.py`` so installing packages can be simply performed using:

.. code-block:: console

  curl https://raw.githubusercontent.com/thoth-station/micropipenv/master/micropipenv.py | python3 - install -- --user

All arguments after -- will be passed to ``pip`` as options.

OpenShift s2i (Source-To-Image)
===============================

micropipenv is available in UBI, Fedora and RHEL based container images. To
enable micropipenv and benefit from its features, you need to export
``ENABLE_MICROPIPENV=1`` environment variable in more recent Python 3 container
images. See `sclorg/s2i-python-container
<https://github.com/sclorg/s2i-python-container/tree/master/3.8>`__ repo for
more information.

License and copying
===================

This project is licensed under the terms of the GNU Lesser General Public
License v3 or later. See ``LICENSE-LGPL`` and ``LICENSE-GPL`` files for the
license terms.

Copyright (C) 2020-2022 `Project Thoth <http://thoth-station.ninja/>`__; Red Hat Inc.

Original author:
 * Fridolín 'fridex' Pokorný <fridolin@redhat.com>

Maintainers:
 * Lumír 'Frenzy' Balhar <lbalhar@redhat.com>
 * Max Gautier <max.gautier@redhat.com>

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/thoth-station/micropipenv",
    "name": "micropipenv",
    "maintainer": "Fridolin Pokorny",
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": "fridex.devel@gmail.com",
    "keywords": "packaging, pipenv, poetry, pip, dependencies, dependency-management, utilities",
    "author": "Fridolin Pokorny",
    "author_email": "fridex.devel@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/20/0c/25a0e4a29ef6dd52bdebe19fbf2ab2aaa500437dd76615d2076673368b7c/micropipenv-1.8.1.tar.gz",
    "platform": null,
    "description": "\u00b5Pipenv\n-------\n\n.. image:: https://img.shields.io/github/v/tag/thoth-station/micropipenv?style=plastic\n  :target: https://github.com/thoth-station/micropipenv/releases\n  :alt: GitHub tag (latest by date)\n\n.. image:: https://travis-ci.com/thoth-station/micropipenv.svg?branch=master\n  :target: https://travis-ci.com/thoth-station/micropipenv\n\n.. image:: https://img.shields.io/pypi/pyversions/micropipenv?style=plastic\n  :target: https://pypi.org/project/micropipenv\n  :alt: PyPI - Python Version\n\n.. image:: https://img.shields.io/pypi/l/micropipenv?style=plastic\n  :target: https://pypi.org/project/micropipenv\n  :alt: PyPI - License\n\n.. image:: https://img.shields.io/pypi/dm/micropipenv?style=plastic\n  :target: https://pypi.org/project/micropipenv\n  :alt: PyPI - Downloads\n\nA lightweight wrapper for pip to support requirements.txt, Pipenv and Poetry\nlock files or converting them to `pip-tools\n<https://pypi.org/project/pip-tools/>`_ compatible output. Designed for\ncontainerized Python applications but not limited to them.\n\nFor a brief video preview, `check this demo\n<https://www.youtube.com/watch?v=I-QC83BcLuo&t=8m58s>`_ (the micropipenv\npart starts at 9:00).\n\nSee also `micropipenv: Installing Python dependencies in containerized\napplications\n<https://developers.redhat.com/articles/2021/05/19/micropipenv-installing-python-dependencies-containerized-applications>`__\nfor more info about this tool and a `blog post published about it\n<https://dev.to/fridex/micropipenv-the-one-installation-tool-that-covers-pipenv-poetry-and-pip-tools-3ee7>`__.\n\nWhat's the difference in comparision to pip when using requirements.txt?\n=========================================================================\n\n* if ``requirements.txt`` state all the packages in a pinned version with\n  hashes (e.g. `pip-tools <https://pypi.org/project/pip-tools/>`_), micropipenv\n  installs packages with a possible fallback if the installation order is\n  relevant\n\n  * you don't need to care about the installation and maintain correct order or\n    requirements in ``requirements.txt``\n\n  * best effort installation - try until there is a possibility to succeed\n\n* if ``requirements.txt`` do not state all the packages in a pinned form\n\n  * pip's resolver algorithm is used and it's left on pip to resolve\n    requirements\n\n  * the same behavior as micropipenv would not be used\n\n\nWhat's the difference in comparision to Poetry?\n===============================================\n\n* a lightweight addition to Poetry, not a Poetry replacement\n\n  * micropipenv does not substitute Poetry it rather complements it for\n    containerized deployments where the size of the container image and\n    software shipped with it matters\n\n* no release management to Python package indexes\n\n* micropipenv does not implement resolver, it uses already resolved stack that\n  application is shipped with based on ``poetry.lock`` and ``pyproject.toml``\n\n* no virtual environment management\n\n  * virtual environment management is left on user, if needed\n\nWhat's the difference in comparision to Pipenv?\n===============================================\n\n* a lightweight addition to Pipenv, not a Pipenv replacement\n\n  * micropipenv does not substitute Pipenv it rather complements it for\n    containerized deployments where the size of the container image and\n    software shipped with it matters\n\n* it does not `vendor all the dependencies as Pipenv\n  <https://github.com/pypa/pipenv/tree/master/pipenv/vendor>`_\n\n* micropipenv does not implement resolver, it uses already resolved stack that\n  application is shipped with ``Pipfile.lock``\n\n* no virtual environment management\n\n  * virtual environment management is left on user, if needed\n\nmicropipenv use cases\n=====================\n\nWhy should I use ``micropipenv`` instead of `Pipenv <https://github.com/pypa/pipenv>`_\nor `Poetry <https://pypi.org/project/poetry>`_?\n\n* I would like to have a tool that \"rules them all\" - one lightweight tool to\n  support all Python dependency lock file managers (pip-tools, Poetry, Pipenv)\n  and lets users decide what they want to use when deploying Python applications\n  in containerized environments (e.g. Kubernetes, OpenShift, ...).\n\n* I would like to have a fast and minimalistic tool to install software\n  packages in CI.\n\n* I would like to have containerized Python applications as small as possible\n  with minimum software shipped and required to build and run the Python\n  application in production.\n\n* I would like to convert files produced by Pipenv/Poetry to a pip-tools\n  compatible output.\n\n* I don't want to install Pipenv/Poetry, but I would like to run a project that\n  uses Pipenv/Poetry for dependency management (e.g. restricted environments).\n\n* My Pipenv installation is broken and `Pipenv upstream did not issue any new\n  Pipenv release <https://github.com/pypa/pipenv/issues/4058>`_.\n\n* I would like to deploy my application into a production environment and my\n  application dependencies are managed by Pipenv/Poetry (dependencies are\n  already resolved), but I don't want to run Pipenv/Poetry in production (e.g.\n  OpenShift's s2i build process).\n\n\n``micropipenv install``\n=======================\n\nThe tool supports installing dependencies of the following formats:\n\n* ``Pipenv`` style lock format - files ``Pipfile`` and ``Pipfile.lock``\n* ``Poetry`` style lock format - files ``pyproject.toml`` and ``poetry.lock``\n* ``pip-tools`` style lock format - file ``requirements.txt``\n* raw ``requirements.txt`` as used by ``pip`` (not a lock file)\n\nIn case of Pipenv, Poetry and pip-tools style format, the tool performs\nautomatic recovery if the installation order of dependencies is relevant (one\ndependency fails to install as it depends on an another one).\n\nTo enforce the installation method used, specify ``--method`` option to the\n``install`` subcommand. By default, ``micropipenv`` traverses the filesystem up\nfrom the current working directory and looks for the relevant files in the\nfollowing order:\n\n1. ``Pipfile.lock`` and optionally ``Pipfile`` (if ``--deploy`` set)\n2. ``poetry.lock`` and ``pyproject.toml``\n3. ``requirements.txt`` for ``pip-tools`` and raw ``pip`` requirements\n\nTo install dependencies issue the following command:\n\n.. code-block:: console\n\n  micropipenv install --dev  # --dev is optional\n\nYou can supply additional positional arguments that will be passed to ``pip``.\nUse double dashes to distinguish ``pip`` options from ``micropipenv`` options.\n\n.. code-block::\n\n  # issue `pip install --user'\n  micropipenv install -- --user\n\n\nVirtual environment management\n==============================\n\n``micropipenv`` does not create any virtual environment as in the case of\nPipenv/Poetry.  It simply executes ``pip``, and constructs arguments out of the\nlock file used. ``pip``'s default behaviour is to install its arguments into\nthe same Python environment where ``pip`` is installed (i.e., the system Python\nenvironment).\n\nTo rather install its arguments into a virtual environment, run ``micropipenv``\nfrom a shell where that virtual environment has been activated. This causes\n``micropipenv`` to run the ``pip`` command already installed in the virtual\nenvironment:\n\n.. code-block:: console\n\n  python3 -m venv venv/ && (. venv/bin/activate && micropipenv install)\n\nAlternatively, ``micropipenv`` can run the ``pip`` command from the system\nPython environment, which can in turn be told to install its arguments into an\nexplicitly specified virtual environment by using the ``PIP_PYTHON``\nenvironment variable.\n\nThis allows for the installation of dependencies into a minimal virtual\nenvironment that does not itself have ``pip`` and its dependencies installed\ninto it:\n\n.. code-block:: console\n\n  python3 -m venv venv/ --without-pip && PIP_PYTHON=venv/bin/python micropipenv install\n\n\nUsing another package index\n===========================\n\nTo set the default Python Package Index to something other than ``https://pypi.org/simple``, set the ``MICROPIPENV_DEFAULT_INDEX_URLS`` to one or more comma-separated URLs.\n\n  Note: if the package manager file contains a package index URL, it will be used over this value.\n\n.. code-block:: console\n\n  export MICROPIPENV_DEFAULT_INDEX_URLS=https://pypi.example.com/simple,https://pypi.org/simple\n  micropipenv install\n\n\n``micropipenv install --deploy``\n================================\n\nIf you wish to mimic ``pipenv --deploy`` functionality, you can do so:\n\n.. code-block:: console\n\n  micropipenv install --deploy\n\nNote however, there is a need to parse ``Pipfile`` and verify its content\ncorresponds to Pipefile.lock used (digest computed on ``Pipfile`` content).\n``micropipenv`` requires toml extras for this functionality, so you will need\nto install ``micropipenv[toml]`` (see installation instructions bellow).\n\nThe ``--deploy`` option takes no effect for Poetry and requirements\ninstallation methods.\n\n\n``micropipenv install --dev``\n================================\n\nInstallation of \"development\" dependencies can be acomplished using the\n``--dev`` flag. This flag has no effect when ``requirements.txt`` file is used.\n\n\n``micropipenv requirements`` / ``micropipenv req``\n==================================================\n\nTo generate output compatible with `pip-tools\n<https://pypi.org/project/pip-tools/>`_, you can issue the following command:\n\n.. code-block:: console\n\n  micropipenv requirements\n\nThis applies to conversion from Poetry and Pipenv specific lock files.\n\nAdditional configuration options can limit what is present in the output (e.g.\n``--no-dev`` to remove development dependencies).\n\nA special option ``--only-direct`` makes ``micropipenv`` work on ``Pipfile``\ninstead of ``Pipfile.lock``. This requires toml extras, so install\n``micropipenv[toml]`` for this functionality (see installation instructions\nbellow). To get direct dependencies of an application and store them in\nrequirements.txt file:\n\n.. code-block:: console\n\n  micropipenv requirements --only-direct > requirements.txt\n\n\nFor a setup that follows ``pip-tools`` convention with ``requirements.in`` and\n``requirements.txt``\n\n.. code-block:: console\n\n  micropipenv requirements --no-dev > requirements.txt\n  micropipenv requirements --no-dev --only-direct > requirements.in\n  micropipenv requirements --no-default > dev-requirements.txt\n  micropipenv requirements --no-default --only-direct > dev-requirements.in\n\n\nSee ``micropipenv requirements --help`` for more info.\n\n\n``micropipenv`` as a library\n============================\n\n``micropipenv`` exposes some core functionality on top of\n``Pipfile``/``Pipfile.lock``.  You can import its functions and use\n``micropipenv`` as a lightweight library for ``Pipfile``/``Pipfile.lock`` and\n``pyproject.toml``/``poetry.lock`` manipulation.\n\n\nAdjusting options using environment variables\n=============================================\n\nAll options can be triggered using environment variables - the name of an\nenvironment variable is always prefixed with ``MICROPIPENV_`` and consists of\nthe name of the option converted to uppercase, dashes are replaced with\nunderscores (example ``--no-dev`` is mapped to ``MICROPIPENV_NO_DEV``). All\nenvironment variables corresponding to flags are parsed as integers and\nsubsequently casted to a boolean. For example, to turn ``--no-dev`` flag on,\nset ``MICROPIPENV_NO_DEV=1`` (0 disables the flag). Parameters supplied to CLI\ntake precedence over environment variables.\n\nA special environment variable ``MICROPIPENV_PIP_BIN`` can point to an\nalternate ``pip`` binary.\n\nTo run this tool in a verbose mode, you can set the ``MICROPIPENV_DEBUG=1`` (the\nsame behavior can be achieved with multiple ``--verbose`` supplied).\n\nThe tool prints software stack information to the standard error output. This was\ndesigned for Thoth to capture information about installed dependencies as a\nuseful source of information for Thoth's build analyzers. This behaviour can be\nsuppressed by setting ``MICROPIPENV_NO_LOCKFILE_PRINT=1`` environment variable.\n\nBesides printing, the tool also writes the content of Pipfile.lock (if a locked\nsoftware stack is used) to the directory where lock files are present (for Pipenv\nfiles, the Pipfile.lock is kept untouched). This behaviour can be suppressed by\nproviding ``MICROPIPENV_NO_LOCKFILE_WRITE=1`` environment variable.\n\nExample usage\n=============\n\nInstall dependencies managed by Poetry as ``pip install --user`` would do\n(option ``--method`` is optional, auto-discovery is performed if omitted):\n\n.. code-block:: console\n\n  $ ls\n  poetry.lock pyproject.toml project.py\n  $ micropipenv install --method poetry -- --user\n\nInstall dependencies (both main and develop) managed by Poetry into a virtual\nenvironment:\n\n.. code-block:: console\n\n  $ ls\n  poetry.lock pyproject.toml project.py\n  $ python3 -m venv venv/\n  $ . venv/bin/activate\n  (venv) $ micropipenv install --dev\n\nInstall dependencies managed by Pipenv (both main and develop) into a virtual\nenvironment  (option ``--method`` is optional, auto-discovery is performed if\nomitted):\n\n.. code-block:: console\n\n  $ ls\n  Pipfile Pipfile.lock src/\n  $ python3 -m venv venv/\n  $ . venv/bin/activate\n  (venv) $ micropipenv install --dev\n\nPerform deployment of an application as Pipenv would do with Python interpreter\nversion check and Pipfile file hash check (you can create virtual environment\nonly if necessary):\n\n.. code-block:: console\n\n  $ ls\n  Pipfile Pipfile.lock src/\n  $ python3 -m venv venv/\n  $ . venv/bin/activate\n  (venv) $ micropipenv install --deploy\n\nGenerate `pip-tools <https://pypi.org/project/pip-tools/>`_ compliant\n``requirements.in``, ``dev-requirements.in``, ``requirements.txt`` and\n``dev-requirements.txt`` out of ``Pipfile`` and ``Pipfile.lock`` - project\ndependencies managed by Pipenv:\n\n.. code-block:: console\n\n  $ ls\n  Pipfile Pipfile.lock src/\n  $ micropipenv requirements --no-dev > requirements.txt\n  $ micropipenv requirements --no-dev --only-direct > requirements.in\n  $ micropipenv requirements --no-default > dev-requirements.txt\n  $ micropipenv requirements --no-default --only-direct > dev-requirements.in\n\nGenerate `pip-tools <https://pypi.org/project/pip-tools/>`_ complaint\n``requirements.in``, ``dev-requirements.in``, ``requirements.txt`` and\n``dev-requirements.txt`` out of ``pyproject.toml`` and ``poetry.lock`` - project\ndependencies managed by Poetry:\n\n.. code-block:: console\n\n  $ ls\n  poetry.lock pyproject.toml src/\n  $ micropipenv requirements --no-dev > requirements.txt\n  $ micropipenv requirements --no-dev --only-direct > requirements.in\n  $ micropipenv requirements --no-default > dev-requirements.txt\n  $ micropipenv requirements --no-default --only-direct > dev-requirements.in\n\nFor OpenShift's s2i integration,\n`check this repo with a demo <https://github.com/fridex/s2i-example-micropipenv>`_.\n\nInstallation\n============\n\nThe project is `hosted on PyPI <https://pypi.org/project/micropipenv>`_ so\ninstalling it using ``pip`` works as expected:\n\n.. code-block:: console\n\n  pip install micropipenv\n\nThe default installation does not bring any dependencies so its just\n``micropipenv`` that gets installed. However, the default installation supports\nonly ``Pipfile.lock`` management. If you would like to manipulate also with\n``Pipfile`` or Poetry specific lock files, you will need to install\n``micropipenv`` with TOML support (TOML is not in the standard Python library):\n\n.. code-block:: console\n\n  pip install micropipenv[toml]\n\nOnce the project gets installed, you can browse the help message by invoking\nthe ``micropipenv`` CLI:\n\n.. code-block:: console\n\n  micropipenv --help\n\nIf you wish to install ``micropipenv`` on your Fedora system:\n\n.. code-block:: console\n\n  dnf install -y micropipenv\n\nSee available `RPM packages <https://src.fedoraproject.org/rpms/micropipenv>`_.\n\nNo installation\n===============\n\nYou can run ``micropipenv`` without actually installing it - simply download\nthe file and execute it. If you do not wish to save ``micropipenv.py`` file to\ndisk, you can issue:\n\n.. code-block:: console\n\n  curl https://raw.githubusercontent.com/thoth-station/micropipenv/master/micropipenv.py | python3 - --help\n\nAnything after ``python3 -`` will be passed as an argument to\n``micropipenv.py`` so installing packages can be simply performed using:\n\n.. code-block:: console\n\n  curl https://raw.githubusercontent.com/thoth-station/micropipenv/master/micropipenv.py | python3 - install -- --user\n\nAll arguments after -- will be passed to ``pip`` as options.\n\nOpenShift s2i (Source-To-Image)\n===============================\n\nmicropipenv is available in UBI, Fedora and RHEL based container images. To\nenable micropipenv and benefit from its features, you need to export\n``ENABLE_MICROPIPENV=1`` environment variable in more recent Python 3 container\nimages. See `sclorg/s2i-python-container\n<https://github.com/sclorg/s2i-python-container/tree/master/3.8>`__ repo for\nmore information.\n\nLicense and copying\n===================\n\nThis project is licensed under the terms of the GNU Lesser General Public\nLicense v3 or later. See ``LICENSE-LGPL`` and ``LICENSE-GPL`` files for the\nlicense terms.\n\nCopyright (C) 2020-2022 `Project Thoth <http://thoth-station.ninja/>`__; Red Hat Inc.\n\nOriginal author:\n * Fridol\u00edn 'fridex' Pokorn\u00fd <fridolin@redhat.com>\n\nMaintainers:\n * Lum\u00edr 'Frenzy' Balhar <lbalhar@redhat.com>\n * Max Gautier <max.gautier@redhat.com>\n",
    "bugtrack_url": null,
    "license": "LGPLv3+",
    "summary": "A simple wrapper around pip to support requirements.txt, Pipenv and Poetry files for containerized applications",
    "version": "1.8.1",
    "project_urls": {
        "Download": "https://pypi.org/project/micropipenv",
        "Homepage": "https://github.com/thoth-station/micropipenv"
    },
    "split_keywords": [
        "packaging",
        " pipenv",
        " poetry",
        " pip",
        " dependencies",
        " dependency-management",
        " utilities"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "37e63238fa4712baa8cc52070e8e6ff9aa9e3c5be92e553daad1bc2fc99ebd9d",
                "md5": "4d6e89f09aa0e407e9dd5a4bcc667cf1",
                "sha256": "5b9082b170e83598724f28d8908259cec8b82494520305b02cc11e294cfb0f31"
            },
            "downloads": -1,
            "filename": "micropipenv-1.8.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4d6e89f09aa0e407e9dd5a4bcc667cf1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 24824,
            "upload_time": "2024-10-29T16:24:08",
            "upload_time_iso_8601": "2024-10-29T16:24:08.380431Z",
            "url": "https://files.pythonhosted.org/packages/37/e6/3238fa4712baa8cc52070e8e6ff9aa9e3c5be92e553daad1bc2fc99ebd9d/micropipenv-1.8.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "200c25a0e4a29ef6dd52bdebe19fbf2ab2aaa500437dd76615d2076673368b7c",
                "md5": "4bea3ceccae06f68950f81ac05793fd0",
                "sha256": "396e9263a16979911dd78825dab03d0320d2617607bf17a5a8541151524f9427"
            },
            "downloads": -1,
            "filename": "micropipenv-1.8.1.tar.gz",
            "has_sig": false,
            "md5_digest": "4bea3ceccae06f68950f81ac05793fd0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 34269,
            "upload_time": "2024-10-29T16:24:10",
            "upload_time_iso_8601": "2024-10-29T16:24:10.696833Z",
            "url": "https://files.pythonhosted.org/packages/20/0c/25a0e4a29ef6dd52bdebe19fbf2ab2aaa500437dd76615d2076673368b7c/micropipenv-1.8.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-29 16:24:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "thoth-station",
    "github_project": "micropipenv",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "micropipenv"
}
        
Elapsed time: 0.37694s