Skip to main content

Check and update versions of pypi packages and docker-images in your project.

Project description

Version updater for components in your codebase

Problem to solve

In the project where there are many components to track new versions (docker images and pypi packages) this tool automates finding new versions, running tests and commit changes to git.

TL;DR

Create YAML file with definition of your components (see example in tests/test_files/components.yaml ). Place components.yaml in the root of your project directory and run:

>>> python -m updater check
10 components to check
1 components to update
>>> python -m updater check --verbose
10 components to check
1 components to update
pymongo - current: 3.12.1 next: 3.12.2

This will check versions for all components defined in components2.yaml:

>>> python -m updater --file=/path/to/your/components2.yaml check
10 components to check
1 components to update

Here is an example of update script which will do checking and print out update config file without making any changes in your files:

>>> python -m updater --dry-run --print update

Here is full example of using update command:

>>> python -m updater update --git-commit --test-command="make test"

It will, for each defined component in components.yaml from local directory:

  1. Check if there are new versions of your components available

  2. Replace in all files version numbers to the newest one

  3. Run tests

  4. Add and commit changes to git

Installation

Install via pypi packages repository:

>>> python -m pip install updater

Usage

updater

updater [OPTIONS] COMMAND [ARGS]...

Options

--version

Show the version and exit.

--file

YAML file with components configuration. If not present other options for ‘check’ command are required.

--destination-file <destination_file>

If this option is given components configuration with new versions will be written here.

--dry-run

If set no changes to any files are written.

--print

Config is printed to stdout at the end.

check

Check if new versions of ddefined components are available.

updater check [OPTIONS]

Options

--type <component_type>

Component type: docker-image or pypi package.

  • Options

    docker-image|pypi

--component

A component name for which the version should be verified.

--repo_name <repo_name>

A repository name if component is a docker image.

--version_tag <version_tag>

Version tag eg. v2.3.0 against which new version check will be run.

--verbose

Print detailed info for each component about new version avaialble.

--clear-cache

Clear all the cached responses about versions in rpositories.

--ignore-default-file

Ignore components.yaml file in local directory if exists.

import-req

Imports python packages from requirements.txt file.

updater import-req [OPTIONS]

Options

--source

Source of the requirement.txt file. [required]

  • Options

    requirements|pipfile

--requirements-file <requirements_file>

Requirements.txt file from which packages and versions will be added to components.yaml file. [required]

update

Update files, run test and commit changes.

updater update [OPTIONS]

Options

--test-command <test_command>

Command that should be run after updating each component.

--test-dir <test_dir>

If test-command param is given, this will be the context dir to run it.

--git-commit

When set after each components update, git commit is performed in active branch.

--project-dir <project_dir>

If given, then it will be treated as a root dir for paths in config file.

-v(, --verbose

Print at the end detailed info for each component about update process.

-vv(, --very-verbose

Print at the end detailed info for each component about update process.

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

updater-0.2.5.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

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

updater-0.2.5-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file updater-0.2.5.tar.gz.

File metadata

  • Download URL: updater-0.2.5.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for updater-0.2.5.tar.gz
Algorithm Hash digest
SHA256 39145be90b353f56334df42f2e4780aa3bc0ad979fd1b040e815add6d7c3a718
MD5 1de9a25a30a0e2bad9af56a62ee1cfef
BLAKE2b-256 25555f6816ed49337a72e6561dd30dbb1c826a4cd7fe9a4d5fbd183a919de161

See more details on using hashes here.

File details

Details for the file updater-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: updater-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for updater-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 56575a31ff20a167881d8dbbb682255045434f8ad2784cf4f82f59035a9c0b6d
MD5 741487a5b8d1127390ce35885bd58fec
BLAKE2b-256 005a9c9af901010153fa375e14e78fef2cd363f5157a9287ecb10e0283a0eb53

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