Skip to main content

Get the installed version of dependency within poetry.lock file

Project description

poverse: Gets the version of dependencies installed by Poetry

Poetry is a great tool for managing python projects. This small library retrieves the version of an installed package.

Supports python versions >=3.7, <=3.9

.github/workflows/ci.yaml PyPI version

Installation

$ pip install poverse

Usage

Cli

$ poverse --help
Usage: poverse [OPTIONS] [LOCK_FILE_PATH]

  Looks for package with name in LOCK_FILE_PATH.

  LOCK_FILE_PATH is the path to Poetry lock file defaults to
  `$PWD/poetry.lock` if not supplied

Options:
  -p, --package TEXT  Name of the package in lock file  [required]
  --help              Show this message and exit.

Example usage

$ poverse -p click
7.1.2

$ poverse -p click $PWD/tests/test_data/poetry.lock
7.1.2

API

get_installed_version

Gets the actual installed version for the supplied package with name from the poetry lock.

Params:

  • package_name (required, str): name of the package that could be in the lock file (required)
  • lock_file_path (str): path to poetry.lock file. Defaults to a poetry.lock in the current directory.

Returns: Optional[str] - Version of requested dependency, None if package does not exist.

Examples

from poverse import get_installed_version

get_installed_version("boto3") # Get the installed version of boto3 from project's poetry.lock

get_installed_version("boto3", "/home/user/projects/project/poetry.lock") # Get the installed version of boto3 from the poetry lock supplied

Motivation

The idea behind this project is for applications where you perhaps need to install specific versions of binaries (e.g. Spark or GDAL) that are dependent on your application dependencies.

Development

Found something that should not be happening? Do you have an idea that would make this library great? Raise an issue or PR, contributions welcome!

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

poverse-0.1.2.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

poverse-0.1.2-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: poverse-0.1.2.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.9.6 Linux/5.8.0-1039-azure

File hashes

Hashes for poverse-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5310bf82f0f21b7502d0eed229ccd874ab8ccc942e1276745946551befe7edf4
MD5 bb6b38b04d8d8f613b9fcd2258d10097
BLAKE2b-256 899aa67a7c24af1bb96947ef4feb6788fef68e5f8e9d3486e7e8c3b8260cd32f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: poverse-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.9.6 Linux/5.8.0-1039-azure

File hashes

Hashes for poverse-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 35b88f9d80d5157902aae502baba1bd6acee36eb0d3d7d141fcd8be7214ed6c0
MD5 2decaa8dc8e90fbd6d6d8fad50a1559d
BLAKE2b-256 11ec207a9c8281912ce8d401ab899484bece08deeed6d84954b1a1d173bee4ee

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