Pip safe auto-upgrade
Project description
Pip-safe-upgrade
Pip-safe-upgrade automatically updates your pip requirements to the highest versions the tests pass.
Overview
This package can works only with docker-compose projects for now.
Installation
pip install safe-pip-upgrade
Work algorithm
After that you run the program with requirement parameters safe_pip_upgrade will do:
- starts the container in daemon mode (runs
docker-compose run project sleep 3590
). - read the next package in requirements.
- check comment. if the comment is
'# the latest working version'
go to p. 2. - check comment. if the comment is
'# error on the version x.x.x'
:- check if the is version between current and x.x.x
- if there is update requirements file to version in the middle between the current and x.x.x and go to p. 3
- if there is not, add comment
'# the latest working version'
and go to p. 2
- check if there is newer version
- if there is not go to p. 2
- if there is, update requirements file to the newest version
- starts the tests
- if tests fail set version back, add comment
'# error on the version x.x.x'
and go to p. 4. - otherwise, go to p. 2
Usage
Using safe-pip-upgrade is basically a two-step process.
- Define your app's parameters with a
pip_upgrade.ini
- Run
pip-upgrade.py UPGRADE
to start the upgrade of your requirements
A pip_upgrade.ini
looks like this:
[MAIN]
working_directory = ./ # change it if you want to start upgrade from other directory.
local_requirements_file = requirements.txt # path and name of the requirements file relative to the working directory
ignore_line_starts = ['#', '-r', 'https://', 'http://', 'git+'] # list of the line beginnings you want to ignore
[COMPOSE RUNNER]
compose_project_folder = . # path to your docker-compose file
compose_requirements_file = requirements.txt # path and name of the requirements file in docker container relative to CWD in your Dockerfile
compose_service_name = django # name of the docker-compose service
compose_work_dir = # set it if you want to change working directory in container
You can run pip_upgrade.py CREATE-INI
so that pip-upgrade automatically creates an ini-file for you
All ini-files option can also be defined with command keys. Type pip_upgrade.py
to see a detailed description.
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
safe-pip-upgrade-0.0.4.tar.gz
(9.9 kB
view hashes)
Built Distribution
Close
Hashes for safe_pip_upgrade-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f638820803eb4170285bc21b2a7d7d4f3caddebe0528e64685a35cfdc31d498 |
|
MD5 | 305fd1dd813444b24abb16dfb10dfe74 |
|
BLAKE2b-256 | bfedfb5df8ff955c29b4a737e67c2ae9a1ba4be114910f562a48c56ef1e33755 |