Metadata-Version: 2.1
Name: pip-preserve
Version: 0.0.1
Summary: Output installed Python packages in requirements format, including also hashes of Python packages.
Keywords: packaging,pip,dependencies,requirements
Author-email: Fridolin Pokorny <fridolin.pokorny@gmail.com>
Maintainer-email: Fridolin Pokorny <fridolin.pokorny@gmail.com>
Requires-Python: >3.6
Description-Content-Type: text/x-rst
Classifier: License :: OSI Approved :: MIT License
Requires-Dist: click
Requires-Dist: daiquiri
Requires-Dist: packaging
Requires-Dist: pytest ; extra == "test"
Project-URL: Documentation, https://github.com/fridex/pip-preserve
Project-URL: Home, https://pypi.org/project/pip-preserve/
Project-URL: Issue, https://github.com/fridex/pip-preserve/issues
Project-URL: Source, https://github.com/fridex/pip-preserve
Provides-Extra: test

pip-preserve
------------

Output installed Python packages in requirements format, including also hashes of Python packages

.. note::

  Note this tool requires pip with PEP-710 support which is a draft PEP as of today. See FAQ bellow.

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

The tool can be `installed from GitHub <https://github.com/fridex/pip-preserve>`__:

.. code-block::

  pip install git+https://github.com/fridex/pip-preserve.git

You can also consume the `published package on PyPI (recommended) <https://pypi.org/project/pip-preserve/>`__:

.. code-block::

  pip install pip-preserve

Usage
=====

After the installation process is successfully done, ``pip-preserve`` CLI
is available:

.. code-block::

  pip-preserve --help

By default, the tool uses the current environment to find installed packages
and reconstruct a ``requirements.txt`` file:

.. code-block::

  pip-preserve
  #
  # This file is autogenerated by pip-preserve version 0.0.0 with Python 3.9.9.
  #
  packaging==23.0 \
    --hash=sha256:714ac14496c3e68c99c29b00845f7a2b85f3bb6f1078fd9f72fd20f0570002b2

If you wish to obtain direct URLs of packages installed, you can pass
``--direct-url`` flag:

.. code-block::

  #
  # This file is autogenerated by pip-preserve version 0.0.0 with Python 3.9.9.
  #
  https://files.pythonhosted.org/packages/ed/35/a31aed2993e398f6b09a790a181a7927eb14610ee8bbf02dc14d31677f1c/packaging-23.0-py3-none-any.whl \
    --hash=sha256:714ac14496c3e68c99c29b00845f7a2b85f3bb6f1078fd9f72fd20f0570002b2

If the tool cannot determine from where a package was installed, it will fail.
This error can be ignored by supplying ``--ignore-errors`` flag. Any errors are
turned into warnings that can be reviewed once the tool prints results.

To explicitly point to a ``site-packages`` directory, use the ``--site-packages``
option.

To get more information about this tool, issue ``--help``.

FAQ
===

Q: The tool fails or I'm getting warnings similar to the one below and my
output is missing some packages:

.. code-block:: test

  No provenance_url.json or direct_url.json found

A: You most probably don't have pip with PEP-710 support. Please install pip
with PEP-710 support, for example using `this patch
<https://github.com/pypa/pip/pull/11865>`__).

License
=======

See the LICENSE file.

