AutoUpgrade
===========
.. image:: https://img.shields.io/pypi/v/autoupgrade-ng.svg
:target: https://pypi.python.org/pypi/autoupgrade-ng
.. image:: https://img.shields.io/github/issues/vuolter/autoupgrade.svg
:target: https://github.com/vuolter/autoupgrade/issues
.. image:: https://img.shields.io/pypi/dm/autoupgrade-ng.svg
:target: https://pypi.python.org/pypi/autoupgrade-ng
.. image:: https://img.shields.io/pypi/l/autoupgrade-ng.svg
:target: https://pypi.python.org/pypi/autoupgrade-ng
.. image:: https://img.shields.io/pypi/format/autoupgrade-ng.svg
:target: https://pypi.python.org/pypi/autoupgrade-ng
.. image:: https://img.shields.io/pypi/pyversions/autoupgrade-ng.svg
:target: https://pypi.python.org/pypi/autoupgrade-ng
.. image:: https://img.shields.io/pypi/status/autoupgrade-ng.svg
:target: https://pypi.python.org/pypi/autoupgrade-ng
.. image:: https://img.shields.io/twitter/url/https/twitter.com/WalterPurcaro.svg?style=social
:target: https://twitter.com/intent/tweet?text=Wow:&url=%5Bobject%20Object%5D
.. image:: https://img.shields.io/github/stars/vuolter/autoupgrade.svg
:target: https://github.com/vuolter/autoupgrade/stargazers
Quick Start
-----------
::
from autoupgrade import Package
Package(<packagename>).smartupgrade()
Example:
::
from autoupgrade import Package
Package('pip').smartupgrade()
The above will upgrade the Python package ``pip`` only if there is a new version
available on the PyPI.
The upgrade will be unattended and the python script will be restarted.
Old methods are still supported; you can accomplish the same task calling:
::
from autoupgrade import AutoUpgrade
AutoUpgrade('pip').upgrade_if_needed()
Installation
------------
::
pip install autoupgrade-ng
All the modules will be installed under the *autoupgrade* package, so **make
sure you have already removed the old AutoUpgrade package
(https://pypi.python.org/pypi/autoupgrade) before install this** to avoid an
installation conflict.
Usage
-----
Classes
~~~~~~~
::
class Package(__builtin__.object)
**Decription**: Basic package class, holds one package.
::
class AutoUpgrade(__builtin__.object)
**Decription**: Legacy class refering to ``Package`` one.
Methods
~~~~~~~
::
__init__(self, pkg, index=None, verbose=False)
**Decription**: None.
**Arguments**:
- ``pkg`` (str) name of package.
- | ``index`` (str) alternative index, if not given default from *pip*
will be used.
| Include full index url \_(e.g. \ https://example.com/simple)_.
| **Return**: None.
::
check(self)
**Decription**: Check if ``pkg`` has a later version.
**Arguments**: None.
**Return**: True if later version exists, else False.
::
restart(self)
**Decription**: Restart application with same args as it was started.
**Arguments**: None.
**Return**: None.
::
upgrade(self, dependencies=False, prerelease=False, force=False)
**Decription**: Upgrade the package unconditionaly.
**Arguments**:
- ``dependencies`` update dependencies if True *(see
``pip --no-deps``)*.
- ``prerelease`` update to pre-release and development versions.
- | ``force`` reinstall all packages even if they are already
up-to-date.
**Return**: None.
::
smartupgrade(self, restart=True, dependencies=False,
prerelease=False)
**Decription**: Upgrade the package if there is a later version available.
**Arguments**:
- ``restart`` restart app if True.
- ``dependencies`` update dependencies if True *(see
``pip --no-deps``)*.
- | ``prerelease`` update to pre-release and development versions.
**Return**: None.
::
upgrade\_if\_needed(self, restart=True, dependencies=False,
prerelease=False)
**Decription**: Legacy method refering to ``smartupgrade`` one.
**Arguments**: Same as ``smartupgrade``.
**Return**: Same as ``smartupgrade``.
Release notes
-------------
**0.3.0**:
- Fork of autoupgrade (https://pypi.python.org/pypi/autoupgrade).
- Python 3 support.
- Removed unnecessary dependencies.
- Pre-release and force-reinstall support.
- Massive code refactoring and cleaning.
- Updated README and LICENSE.
- New exception ``PIPError`` to handle pip errors.
- Main class renamed to ``Package``.
- More verbose messages.
- Small code optimizations and improvements.
**0.2.0**:
- Issue #2, Index did not work when specified.
- Issue #3, Autoupgrade should not print to console (added verbose flag
to
keep backward compatibility.
- Issue #4, Support for pip > v0.6 .
**0.1.5**:
- Issue #1, Extra index did not work for all servers.
**0.1.4**:
- Fixed bug when version contains characters.
**0.1.3**:
- Fixed vital fault in v0.1.2 .
**0.1.2**:
- Setup file fixes
- Removed verbose output as default.
- Return value fixed of method ``upgrade``.
**0.1.1**:
- Dependencies updated.
**0.1.0**:
- Initial release.
Raw data
{
"_id": null,
"home_page": "https://github.com/primait/autoupgrade",
"name": "autoupgrade-prima",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "autoupgrade,pip-upgrade,pip",
"author": "Walter Purcaro",
"author_email": "vuolter@gmail.com",
"download_url": "https://github.com/primait/autoupgrade/releases",
"platform": null,
"description": "AutoUpgrade\n===========\n\n.. image:: https://img.shields.io/pypi/v/autoupgrade-ng.svg\n :target: https://pypi.python.org/pypi/autoupgrade-ng\n\n.. image:: https://img.shields.io/github/issues/vuolter/autoupgrade.svg\n :target: https://github.com/vuolter/autoupgrade/issues\n\n.. image:: https://img.shields.io/pypi/dm/autoupgrade-ng.svg\n :target: https://pypi.python.org/pypi/autoupgrade-ng\n\n.. image:: https://img.shields.io/pypi/l/autoupgrade-ng.svg\n :target: https://pypi.python.org/pypi/autoupgrade-ng\n\n.. image:: https://img.shields.io/pypi/format/autoupgrade-ng.svg\n :target: https://pypi.python.org/pypi/autoupgrade-ng\n\n.. image:: https://img.shields.io/pypi/pyversions/autoupgrade-ng.svg\n :target: https://pypi.python.org/pypi/autoupgrade-ng\n\n.. image:: https://img.shields.io/pypi/status/autoupgrade-ng.svg\n :target: https://pypi.python.org/pypi/autoupgrade-ng\n\n.. image:: https://img.shields.io/twitter/url/https/twitter.com/WalterPurcaro.svg?style=social\n :target: https://twitter.com/intent/tweet?text=Wow:&url=%5Bobject%20Object%5D\n\n.. image:: https://img.shields.io/github/stars/vuolter/autoupgrade.svg\n :target: https://github.com/vuolter/autoupgrade/stargazers\n\n\nQuick Start\n-----------\n\n::\n\n from autoupgrade import Package\n Package(<packagename>).smartupgrade()\n\nExample:\n\n::\n\n from autoupgrade import Package\n Package('pip').smartupgrade()\n\nThe above will upgrade the Python package ``pip`` only if there is a new version\navailable on the PyPI.\nThe upgrade will be unattended and the python script will be restarted.\n\nOld methods are still supported; you can accomplish the same task calling:\n\n::\n\n from autoupgrade import AutoUpgrade\n AutoUpgrade('pip').upgrade_if_needed()\n\n\nInstallation\n------------\n\n::\n\n pip install autoupgrade-ng\n\nAll the modules will be installed under the *autoupgrade* package, so **make\nsure you have already removed the old AutoUpgrade package\n(https://pypi.python.org/pypi/autoupgrade) before install this** to avoid an\ninstallation conflict.\n\n\nUsage\n-----\n\nClasses\n~~~~~~~\n\n::\n\n class Package(__builtin__.object)\n\n**Decription**: Basic package class, holds one package.\n\n::\n\n class AutoUpgrade(__builtin__.object)\n\n**Decription**: Legacy class refering to ``Package`` one.\n\nMethods\n~~~~~~~\n\n::\n\n __init__(self, pkg, index=None, verbose=False)\n\n**Decription**: None.\n\n**Arguments**:\n\n- ``pkg`` (str) name of package.\n- | ``index`` (str) alternative index, if not given default from *pip*\n will be used.\n | Include full index url \\_(e.g. \\ https://example.com/simple)_.\n | **Return**: None.\n\n::\n\n check(self)\n\n**Decription**: Check if ``pkg`` has a later version.\n\n**Arguments**: None.\n\n**Return**: True if later version exists, else False.\n\n::\n\n restart(self)\n\n**Decription**: Restart application with same args as it was started.\n\n**Arguments**: None.\n\n**Return**: None.\n\n::\n\n upgrade(self, dependencies=False, prerelease=False, force=False)\n\n**Decription**: Upgrade the package unconditionaly.\n\n**Arguments**:\n\n- ``dependencies`` update dependencies if True *(see\n ``pip --no-deps``)*.\n- ``prerelease`` update to pre-release and development versions.\n- | ``force`` reinstall all packages even if they are already\n up-to-date.\n\n**Return**: None.\n\n::\n\n smartupgrade(self, restart=True, dependencies=False,\n prerelease=False)\n\n**Decription**: Upgrade the package if there is a later version available.\n\n**Arguments**:\n\n- ``restart`` restart app if True.\n- ``dependencies`` update dependencies if True *(see\n ``pip --no-deps``)*.\n- | ``prerelease`` update to pre-release and development versions.\n\n**Return**: None.\n\n::\n\n upgrade\\_if\\_needed(self, restart=True, dependencies=False,\n prerelease=False)\n\n**Decription**: Legacy method refering to ``smartupgrade`` one.\n\n**Arguments**: Same as ``smartupgrade``.\n\n**Return**: Same as ``smartupgrade``.\n\n\nRelease notes\n-------------\n\n**0.3.0**:\n\n- Fork of autoupgrade (https://pypi.python.org/pypi/autoupgrade).\n- Python 3 support.\n- Removed unnecessary dependencies.\n- Pre-release and force-reinstall support.\n- Massive code refactoring and cleaning.\n- Updated README and LICENSE.\n- New exception ``PIPError`` to handle pip errors.\n- Main class renamed to ``Package``.\n- More verbose messages.\n- Small code optimizations and improvements.\n\n**0.2.0**:\n\n- Issue #2, Index did not work when specified.\n- Issue #3, Autoupgrade should not print to console (added verbose flag\n to\n keep backward compatibility.\n- Issue #4, Support for pip > v0.6 .\n\n**0.1.5**:\n\n- Issue #1, Extra index did not work for all servers.\n\n**0.1.4**:\n\n- Fixed bug when version contains characters.\n\n**0.1.3**:\n\n- Fixed vital fault in v0.1.2 .\n\n**0.1.2**:\n\n- Setup file fixes\n- Removed verbose output as default.\n- Return value fixed of method ``upgrade``.\n\n**0.1.1**:\n\n- Dependencies updated.\n\n**0.1.0**:\n\n- Initial release.\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Automatic upgrade of PyPI packages",
"version": "0.6.4",
"split_keywords": [
"autoupgrade",
"pip-upgrade",
"pip"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "23a0e5586169ff55c6a2b689f58ae3e002eb3bfcf3b71f57012961b1c69c735b",
"md5": "17fc2dbebb71220272f0ca9d5317c05a",
"sha256": "678ed231b5a6149b8f2a9922762b3aa090d20f8bde2afc0a8c6514fae2d0e4f7"
},
"downloads": -1,
"filename": "autoupgrade_prima-0.6.4-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "17fc2dbebb71220272f0ca9d5317c05a",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 5482,
"upload_time": "2023-03-22T07:50:55",
"upload_time_iso_8601": "2023-03-22T07:50:55.571246Z",
"url": "https://files.pythonhosted.org/packages/23/a0/e5586169ff55c6a2b689f58ae3e002eb3bfcf3b71f57012961b1c69c735b/autoupgrade_prima-0.6.4-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-22 07:50:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "primait",
"github_project": "autoupgrade",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "autoupgrade-prima"
}