Hello community, here is the log from the commit of package python-keyring for openSUSE:Factory checked in at 2019-03-01 20:28:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-keyring (Old) and /work/SRC/openSUSE:Factory/.python-keyring.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-keyring" Fri Mar 1 20:28:57 2019 rev:33 rq:679266 version:18.0.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-keyring/python-keyring.changes 2018-10-18 15:29:04.870803426 +0200 +++ /work/SRC/openSUSE:Factory/.python-keyring.new.28833/python-keyring.changes 2019-03-01 20:29:00.150017397 +0100 @@ -1,0 +2,43 @@ +Tue Feb 26 13:10:57 UTC 2019 - John Vandenberg <[email protected]> + +- Add LICENSE +- Remove tests from runtime package +- Fix test failure occurring in test_packaging.py +- Use pytest --ignore to avoid removing build directories in %check +- Remove unnecessary build dependency pytest-sugar +- Update to v18.0.0 + * On macOS, the backend now raises a ``KeyringLocked`` + when access to the keyring is denied (on get or set) instead + of ``PasswordSetError`` or ``KeyringError``. Any API users + may need to account for this change, probably by catching + the parent ``KeyringError``. + Additionally, the error message from the underying error is + now included in any errors that occur. +- from 17.1.1 + * Update packaging technique to avoid 0.0.0 releases. +- from 17.1.0 + * When calling ``keyring.core.init_backend``, if any limit function is + supplied, it is saved and later honored by the ``ChainerBackend`` as well. +- from 17.0.0 + * Remove application attribute from stored passwords + using SecretService, addressing regression introduced in + 10.5.0 (#292). Impacted Linux keyrings will once again + prompt for a password for "Python program". +- from 16.1.1 + * Fix error on import due to circular imports on Python 3.4. +- from 16.1.0 + * Refactor ChainerBackend, introduced in 16.0 to function + as any other backend, activating when relevant. +- 16.0.2 + * In Windows backend, trap all exceptions when attempting to import pywin32. +- from 16.0.1 + * Once again allow all positive, non-zero priority keyrings to participate. +- from 16.0.0 + * Fix race condition in delete_password on Windows. + * All suitable backends (priority 1 and greater) are + allowed to participate. +- from 15.2.0 + * Added new API for ``get_credentials``, for backends + that can resolve both a username and password for a service. + +------------------------------------------------------------------- Old: ---- keyring-15.1.0.tar.gz New: ---- keyring-18.0.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-keyring.spec ++++++ --- /var/tmp/diff_new_pack.exk6T1/_old 2019-03-01 20:29:00.614017285 +0100 +++ /var/tmp/diff_new_pack.exk6T1/_new 2019-03-01 20:29:00.614017285 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-keyring # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-keyring -Version: 15.1.0 +Version: 18.0.0 Release: 0 Summary: Store and access your passwords safely License: Python-2.0 AND MIT @@ -29,7 +29,6 @@ BuildRequires: %{python_module entrypoints} BuildRequires: %{python_module mock} BuildRequires: %{python_module pytest >= 3.5} -BuildRequires: %{python_module pytest-sugar >= 0.9.1} BuildRequires: %{python_module setuptools >= 17.1} BuildRequires: %{python_module setuptools_scm >= 1.15.0} BuildRequires: fdupes @@ -48,25 +47,26 @@ %setup -q -n keyring-%{version} # For rpmlint warning: remove shebang from python library: sed -i '/^#!/d' keyring/cli.py +sed -i -e 's,--flake8,,' pytest.ini %build %python_build %install %python_install -%python_expand %fdupes %{buildroot}%{$python_sitelib} +%{python_expand rm -r %{buildroot}%{$python_sitelib}/keyring/tests +%fdupes %{buildroot}%{$python_sitelib} +} %check -# remove flake8 -sed -i -e 's,--flake8,,' pytest.ini -# remove test expecting the /usr/bin -rm -rf tests/test_packaging.py # sadly most tests need running dbus to communicate with secretstorage/etc -%{python_expand rm -rf _build* -py.test-%{$python_bin_suffix}} +%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitelib} +py.test-%{$python_bin_suffix} --ignore=_build.python2 --ignore=_build.python3 +} %files %{python_files} %doc README.rst CHANGES.rst +%license LICENSE %python3_only %{_bindir}/keyring %{python_sitelib}/keyring-%{version}-py*.egg-info %{python_sitelib}/keyring/ ++++++ keyring-15.1.0.tar.gz -> keyring-18.0.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-15.1.0/.flake8 new/keyring-18.0.0/.flake8 --- old/keyring-15.1.0/.flake8 2018-09-14 17:48:03.000000000 +0200 +++ new/keyring-18.0.0/.flake8 2019-02-13 22:45:11.000000000 +0100 @@ -2,3 +2,5 @@ ignore = # W503 violates spec https://github.com/PyCQA/pycodestyle/issues/513 W503 + # W504 has issues https://github.com/OCA/maintainer-quality-tools/issues/545 + W504 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-15.1.0/.travis.yml new/keyring-18.0.0/.travis.yml --- old/keyring-15.1.0/.travis.yml 2018-09-14 17:48:03.000000000 +0200 +++ new/keyring-18.0.0/.travis.yml 2019-02-13 22:45:11.000000000 +0100 @@ -1,28 +1,28 @@ +dist: xenial +sudo: false language: python +python: +- 2.7 +- 3.6 +- &latest_py3 3.7 + jobs: fast_finish: true include: - - python: 2.7 - - python: &latest_py3 3.6 - os: osx language: generic python: *latest_py3 - stage: deploy if: tag IS present python: *latest_py3 - install: skip - script: skip - deploy: - provider: pypi - on: - tags: true - all_branches: true - user: jaraco - password: - secure: aDqlVdm6FZ8pqLkoDRR2LH3TEz7pBvKH2HhOlSy7OEmopN/36ncql/KvfE0ccpaOES9Xm31a51bUfNjcwb1HVKjfW544C+IoSHctkG1rI5bp3q4rW+4RbQcBZVHUUKR9yQf9ZyikEmoYXi3g+JKcOf9rj+v/32PAfUDzSpFbWik= - distributions: dists - skip_cleanup: true + before_script: skip + env: + - TWINE_USERNAME=jaraco + # TWINE_PASSWORD + - secure: VXM9F3HLDPprEY3JRlX6eH+yngucMHrqpUMeo4zgnFOc5yJUs7RP3uJ87O9IHllOUc7VR+nu/ye7HJk9y8Ux8X53S5UiH/s3/7rHPWP5IyCZBuDMZ3ouSxYKCWyMd6h/tkmVjNJIkV/0ZUhTJlwaODKwqegZ0twEIoRQnVIDTcs= + - TOX_TESTENV_PASSENV="TWINE_USERNAME TWINE_PASSWORD" + script: tox -e release cache: pip diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-15.1.0/CHANGES.rst new/keyring-18.0.0/CHANGES.rst --- old/keyring-15.1.0/CHANGES.rst 2018-09-14 17:48:03.000000000 +0200 +++ new/keyring-18.0.0/CHANGES.rst 2019-02-13 22:45:11.000000000 +0100 @@ -1,3 +1,71 @@ +18.0.0 +------ + +* #375: On macOS, the backend now raises a ``KeyringLocked`` + when access to the keyring is denied (on get or set) instead + of ``PasswordSetError`` or ``KeyringError``. Any API users + may need to account for this change, probably by catching + the parent ``KeyringError``. + Additionally, the error message from the underying error is + now included in any errors that occur. + +17.1.1 +------ + +* #368: Update packaging technique to avoid 0.0.0 releases. + +17.1.0 +------ + +* #366: When calling ``keyring.core.init_backend``, if any + limit function is supplied, it is saved and later honored by + the ``ChainerBackend`` as well. + +17.0.0 +------ + +* #345: Remove application attribute from stored passwords + using SecretService, addressing regression introduced in + 10.5.0 (#292). Impacted Linux keyrings will once again + prompt for a password for "Python program". + +16.1.1 +------ + +* #362: Fix error on import due to circular imports + on Python 3.4. + +16.1.0 +------ + +* Refactor ChainerBackend, introduced in 16.0 to function + as any other backend, activating when relevant. + +16.0.2 +------ + +* #319: In Windows backend, trap all exceptions when + attempting to import pywin32. + +16.0.1 +------ + +* #357: Once again allow all positive, non-zero priority + keyrings to participate. + +16.0.0 +------ + +* #323: Fix race condition in delete_password on Windows. +* #352: All suitable backends (priority 1 and greater) are + allowed to participate. + +15.2.0 +------ + +* #350: Added new API for ``get_credentials``, for backends + that can resolve both a username and password for a service. + 15.1.0 ------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-15.1.0/PKG-INFO new/keyring-18.0.0/PKG-INFO --- old/keyring-15.1.0/PKG-INFO 2018-09-14 17:48:29.000000000 +0200 +++ new/keyring-18.0.0/PKG-INFO 2019-02-13 22:45:30.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: keyring -Version: 15.1.0 +Version: 18.0.0 Summary: Store and access your passwords safely. Home-page: https://github.com/jaraco/keyring Author: Kang Zhang @@ -16,12 +16,15 @@ .. image:: https://img.shields.io/travis/jaraco/keyring/master.svg :target: https://travis-ci.org/jaraco/keyring - .. .. image:: https://img.shields.io/appveyor/ci/jaraco/keyring/master.svg - .. :target: https://ci.appveyor.com/project/jaraco/keyring/branch/master + .. image:: https://img.shields.io/appveyor/ci/jaraco/keyring/master.svg + :target: https://ci.appveyor.com/project/jaraco/keyring/branch/master .. image:: https://readthedocs.org/projects/keyring/badge/?version=latest :target: https://keyring.readthedocs.io/en/latest/?badge=latest + .. image:: https://tidelift.com/badges/github/jaraco/keyring + :target: https://tidelift.com/subscription/pkg/pypi-keyring?utm_source=pypi-keyring&utm_medium=readme + ======================================= Installing and Using Python Keyring Lib ======================================= @@ -43,7 +46,7 @@ * macOS `Keychain <https://en.wikipedia.org/wiki/Keychain_%28software%29>`_ * Freedesktop `Secret Service - <http://standards.freedesktop.org/secret-service/>`_ supports many DE including + <http://standards.freedesktop.org/secret-service/>`_ supports many DE including GNOME (requires `secretstorage <https://pypi.python.org/pypi/secretstorage>`_) * KDE4 & KDE5 `KWallet <https://en.wikipedia.org/wiki/KWallet>`_ (requires `dbus <https://pypi.python.org/pypi/dbus-python>`_) @@ -66,11 +69,13 @@ Linux ----- - On Linux, the recommended keyring relies on SecretStorage, which in - turn relies on dbus-python, but dbus-python does not install correctly - when using the Python installers, so dbus-python must be installed - as a system package. See `the SecretStorage GitHub repo - <https://github.com/mitya57/secretstorage>`_ for details. + On Linux, the KWallet backend relies on dbus-python_, which does not always + install correctly when using pip (compilation is needed). So we recommend + that dbus-python is installed as a system package. The same also applies to + the Secret Storage backend under Python 2 (under Python 3 a different D-Bus + implementation is used). + + .. _dbus-python: https://gitlab.freedesktop.org/dbus/dbus-python ------------- Using Keyring @@ -148,12 +153,13 @@ If **keyring-path** is indicated, keyring will add that path to the Python module search path before loading the backend. - For example, this config might be used to load the SimpleKeyring from the demo - directory in the project checkout:: + For example, this config might be used to load the + ``SimpleKeyring`` from the ``simplekeyring`` module in + the ``./demo`` directory (not implemented):: [backend] default-keyring=simplekeyring.SimpleKeyring - keyring-path=/home/kang/pyworkspace/python-keyring-lib/demo/ + keyring-path=demo Third-Party Backends ==================== @@ -174,6 +180,10 @@ - `gsheet-keyring <https://pypi.org/project/gsheet-keyring>`_ - a backend that stores secrets in a Google Sheet. For use with `ipython-secrets <https://pypi.org/project/ipython-secrets>`_. + - `bitwarden-keyring <https://pypi.org/project/bitwarden-keyring/0.1.0/>`_ + - a backend that stores secrets in the `BitWarden <https://bitwarden.com/>`_ + password manager. + Write your own keyring backend ============================== @@ -181,7 +191,8 @@ The interface for the backend is defined by ``keyring.backend.KeyringBackend``. Every backend should derive from that base class and define a ``priority`` attribute and three functions: ``get_password()``, ``set_password()``, and - ``delete_password()``. + ``delete_password()``. The ``get_credential()`` function may be defined if + desired. See the ``backend`` module for more detail on the interface of this class. @@ -294,6 +305,10 @@ * ``get_keyring()``: Return the currently-loaded keyring implementation. * ``get_password(service, username)``: Returns the password stored in the active keyring. If the password does not exist, it will return None. + * ``get_credential(service, username)``: Return a credential object stored + in the active keyring. This object contains at least ``username`` and + ``password`` attributes for the specified service, where the returned + ``username`` may be different from the argument. * ``set_password(service, username, password)``: Store the password in the keyring. * ``delete_password(service, username)``: Delete the password stored in @@ -327,6 +342,14 @@ * Bug Tracker: https://github.com/jaraco/keyring/issues/ * Mailing list: http://groups.google.com/group/python-keyring + Security Contact + ================ + + If you wish to report a security vulnerability, the public disclosure + of which may exacerbate the risk, please + `Contact Tidelift security <https://tidelift.com/security>`_, + which will coordinate the fix and disclosure privately. + Making Releases =============== @@ -376,6 +399,7 @@ Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: MIT License Classifier: License :: OSI Approved :: Python Software Foundation License Classifier: License :: OSI Approved :: MIT License Classifier: Programming Language :: Python :: 2.7 @@ -385,5 +409,5 @@ Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Requires-Python: >=2.7 -Provides-Extra: docs Provides-Extra: testing +Provides-Extra: docs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-15.1.0/README.rst new/keyring-18.0.0/README.rst --- old/keyring-15.1.0/README.rst 2018-09-14 17:48:03.000000000 +0200 +++ new/keyring-18.0.0/README.rst 2019-02-13 22:45:11.000000000 +0100 @@ -6,12 +6,15 @@ .. image:: https://img.shields.io/travis/jaraco/keyring/master.svg :target: https://travis-ci.org/jaraco/keyring -.. .. image:: https://img.shields.io/appveyor/ci/jaraco/keyring/master.svg -.. :target: https://ci.appveyor.com/project/jaraco/keyring/branch/master +.. image:: https://img.shields.io/appveyor/ci/jaraco/keyring/master.svg + :target: https://ci.appveyor.com/project/jaraco/keyring/branch/master .. image:: https://readthedocs.org/projects/keyring/badge/?version=latest :target: https://keyring.readthedocs.io/en/latest/?badge=latest +.. image:: https://tidelift.com/badges/github/jaraco/keyring + :target: https://tidelift.com/subscription/pkg/pypi-keyring?utm_source=pypi-keyring&utm_medium=readme + ======================================= Installing and Using Python Keyring Lib ======================================= @@ -33,7 +36,7 @@ * macOS `Keychain <https://en.wikipedia.org/wiki/Keychain_%28software%29>`_ * Freedesktop `Secret Service - <http://standards.freedesktop.org/secret-service/>`_ supports many DE including + <http://standards.freedesktop.org/secret-service/>`_ supports many DE including GNOME (requires `secretstorage <https://pypi.python.org/pypi/secretstorage>`_) * KDE4 & KDE5 `KWallet <https://en.wikipedia.org/wiki/KWallet>`_ (requires `dbus <https://pypi.python.org/pypi/dbus-python>`_) @@ -56,11 +59,13 @@ Linux ----- -On Linux, the recommended keyring relies on SecretStorage, which in -turn relies on dbus-python, but dbus-python does not install correctly -when using the Python installers, so dbus-python must be installed -as a system package. See `the SecretStorage GitHub repo -<https://github.com/mitya57/secretstorage>`_ for details. +On Linux, the KWallet backend relies on dbus-python_, which does not always +install correctly when using pip (compilation is needed). So we recommend +that dbus-python is installed as a system package. The same also applies to +the Secret Storage backend under Python 2 (under Python 3 a different D-Bus +implementation is used). + +.. _dbus-python: https://gitlab.freedesktop.org/dbus/dbus-python ------------- Using Keyring @@ -138,12 +143,13 @@ If **keyring-path** is indicated, keyring will add that path to the Python module search path before loading the backend. -For example, this config might be used to load the SimpleKeyring from the demo -directory in the project checkout:: +For example, this config might be used to load the +``SimpleKeyring`` from the ``simplekeyring`` module in +the ``./demo`` directory (not implemented):: [backend] default-keyring=simplekeyring.SimpleKeyring - keyring-path=/home/kang/pyworkspace/python-keyring-lib/demo/ + keyring-path=demo Third-Party Backends ==================== @@ -164,6 +170,10 @@ - `gsheet-keyring <https://pypi.org/project/gsheet-keyring>`_ - a backend that stores secrets in a Google Sheet. For use with `ipython-secrets <https://pypi.org/project/ipython-secrets>`_. +- `bitwarden-keyring <https://pypi.org/project/bitwarden-keyring/0.1.0/>`_ + - a backend that stores secrets in the `BitWarden <https://bitwarden.com/>`_ + password manager. + Write your own keyring backend ============================== @@ -171,7 +181,8 @@ The interface for the backend is defined by ``keyring.backend.KeyringBackend``. Every backend should derive from that base class and define a ``priority`` attribute and three functions: ``get_password()``, ``set_password()``, and -``delete_password()``. +``delete_password()``. The ``get_credential()`` function may be defined if +desired. See the ``backend`` module for more detail on the interface of this class. @@ -284,6 +295,10 @@ * ``get_keyring()``: Return the currently-loaded keyring implementation. * ``get_password(service, username)``: Returns the password stored in the active keyring. If the password does not exist, it will return None. +* ``get_credential(service, username)``: Return a credential object stored + in the active keyring. This object contains at least ``username`` and + ``password`` attributes for the specified service, where the returned + ``username`` may be different from the argument. * ``set_password(service, username, password)``: Store the password in the keyring. * ``delete_password(service, username)``: Delete the password stored in @@ -317,6 +332,14 @@ * Bug Tracker: https://github.com/jaraco/keyring/issues/ * Mailing list: http://groups.google.com/group/python-keyring +Security Contact +================ + +If you wish to report a security vulnerability, the public disclosure +of which may exacerbate the risk, please +`Contact Tidelift security <https://tidelift.com/security>`_, +which will coordinate the fix and disclosure privately. + Making Releases =============== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-15.1.0/docs/_templates/tidelift-sidebar.html new/keyring-18.0.0/docs/_templates/tidelift-sidebar.html --- old/keyring-15.1.0/docs/_templates/tidelift-sidebar.html 1970-01-01 01:00:00.000000000 +0100 +++ new/keyring-18.0.0/docs/_templates/tidelift-sidebar.html 2019-02-13 22:45:11.000000000 +0100 @@ -0,0 +1,6 @@ +<h3 class="donation">Professional support</h3> + +<p> +Professionally-supported {{ project }} is available with the +<a href="https://tidelift.com/subscription/pkg/pypi-{{ project }}?utm_source=pypi-{{ project }}&utm_medium=readme">Tidelift Subscription</a>. +</p> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-15.1.0/docs/conf.py new/keyring-18.0.0/docs/conf.py --- old/keyring-15.1.0/docs/conf.py 2018-09-14 17:48:03.000000000 +0200 +++ new/keyring-18.0.0/docs/conf.py 2019-02-13 22:45:11.000000000 +0100 @@ -2,32 +2,31 @@ # -*- coding: utf-8 -*- # flake8: noqa -extensions = [ - 'sphinx.ext.autodoc', - 'jaraco.packaging.sphinx', - 'rst.linker', -] +extensions = ["sphinx.ext.autodoc", "jaraco.packaging.sphinx", "rst.linker"] -master_doc = 'index' +master_doc = "index" link_files = { - '../CHANGES.rst': dict( - using=dict( - GH='https://github.com', - ), - replace=[ - dict( - pattern=r'(Issue #|\B#)(?P<issue>\d+)', - url='{package_url}/issues/{issue}', - ), - dict( - pattern=r'^(?m)((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n', - with_scm='{text}\n{rev[timestamp]:%d %b %Y}\n', - ), - dict( - pattern=r'PEP[- ](?P<pep_number>\d+)', - url='https://www.python.org/dev/peps/pep-{pep_number:0>4}/', - ), - ], - ), + "../CHANGES.rst": dict( + using=dict(GH="https://github.com"), + replace=[ + dict( + pattern=r"(Issue #|\B#)(?P<issue>\d+)", + url="{package_url}/issues/{issue}", + ), + dict( + pattern=r"^(?m)((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n", + with_scm="{text}\n{rev[timestamp]:%d %b %Y}\n", + ), + dict( + pattern=r"PEP[- ](?P<pep_number>\d+)", + url="https://www.python.org/dev/peps/pep-{pep_number:0>4}/", + ), + ], + ) } + +# Custom sidebar templates, maps document names to template names. +html_theme = 'alabaster' +templates_path = ['_templates'] +html_sidebars = {'index': 'tidelift-sidebar.html'} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-15.1.0/keyring/__init__.py new/keyring-18.0.0/keyring/__init__.py --- old/keyring-15.1.0/keyring/__init__.py 2018-09-14 17:48:03.000000000 +0200 +++ new/keyring-18.0.0/keyring/__init__.py 2019-02-13 22:45:11.000000000 +0100 @@ -1,9 +1,10 @@ from __future__ import absolute_import -from .core import (set_keyring, get_keyring, set_password, get_password, - delete_password) +from .core import ( + set_keyring, get_keyring, set_password, get_password, + delete_password, get_credential) __all__ = ( 'set_keyring', 'get_keyring', 'set_password', 'get_password', - 'delete_password', + 'delete_password', 'get_credential', ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-15.1.0/keyring/backend.py new/keyring-18.0.0/keyring/backend.py --- old/keyring-15.1.0/keyring/backend.py 2018-09-14 17:48:03.000000000 +0200 +++ new/keyring-18.0.0/keyring/backend.py 2019-02-13 22:45:11.000000000 +0100 @@ -10,7 +10,7 @@ import entrypoints -from . import errors, util +from . import credentials, errors, util from .util import properties from .py27compat import add_metaclass, filter @@ -19,6 +19,10 @@ log = logging.getLogger(__name__) +by_priority = operator.attrgetter('priority') +_limit = None + + class KeyringBackendMeta(abc.ABCMeta): """ A metaclass that's both an ABCMeta and a type that keeps a registry of @@ -96,7 +100,10 @@ @abc.abstractmethod def set_password(self, service, username, password): - """Set password for the username of the service + """Set password for the username of the service. + + If the backend cannot store passwords, raise + NotImplementedError. """ raise errors.PasswordSetError("reason") @@ -105,9 +112,33 @@ # @abc.abstractmethod def delete_password(self, service, username): """Delete the password for the username of the service. + + If the backend cannot store passwords, raise + NotImplementedError. """ raise errors.PasswordDeleteError("reason") + # for backward-compatibility, don't require a backend to implement + # get_credential + # @abc.abstractmethod + def get_credential(self, service, username): + """Gets the username and password for the service. + Returns a Credential instance. + + The *username* argument is optional and may be omitted by + the caller or ignored by the backend. Callers must use the + returned username. + """ + # The default implementation requires a username here. + if username is not None: + password = self.get_password(service, username) + if password is not None: + return credentials.SimpleCredential( + username, + password, + ) + return None + class Crypter: """Base class providing encryption and decryption diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-15.1.0/keyring/backends/OS_X.py new/keyring-18.0.0/keyring/backends/OS_X.py --- old/keyring-15.1.0/keyring/backends/OS_X.py 2018-09-14 17:48:03.000000000 +0200 +++ new/keyring-18.0.0/keyring/backends/OS_X.py 2019-02-13 22:45:11.000000000 +0100 @@ -3,6 +3,8 @@ from ..backend import KeyringBackend from ..errors import PasswordSetError from ..errors import PasswordDeleteError +from ..errors import KeyringLocked +from ..errors import KeyringError from ..util import properties try: @@ -34,8 +36,12 @@ try: api.set_generic_password( self.keychain, service, username, password) - except api.Error: - raise PasswordSetError("Can't store password on keychain") + except api.KeychainDenied as e: + raise KeyringLocked("Can't store password on keychain: " + "{}".format(e)) + except api.Error as e: + raise PasswordSetError("Can't store password on keychain: " + "{}".format(e)) def get_password(self, service, username): if username is None: @@ -45,6 +51,12 @@ return api.find_generic_password(self.keychain, service, username) except api.NotFound: pass + except api.KeychainDenied as e: + raise KeyringLocked("Can't get password from keychain: " + "{}".format(e)) + except api.Error as e: + raise KeyringError("Can't get password from keychain: " + "{}".format(e)) def delete_password(self, service, username): if username is None: @@ -53,5 +65,6 @@ try: return api.delete_generic_password( self.keychain, service, username) - except api.Error: - raise PasswordDeleteError("Can't delete password in keychain") + except api.Error as e: + raise PasswordDeleteError("Can't delete password in keychain: " + "{}".format(e)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-15.1.0/keyring/backends/SecretService.py new/keyring-18.0.0/keyring/backends/SecretService.py --- old/keyring-15.1.0/keyring/backends/SecretService.py 2018-09-14 17:48:03.000000000 +0200 +++ new/keyring-18.0.0/keyring/backends/SecretService.py 2019-02-13 22:45:11.000000000 +0100 @@ -1,8 +1,5 @@ import logging -import sys -import os - from ..util import properties from ..backend import KeyringBackend from ..errors import (InitError, PasswordDeleteError, @@ -22,7 +19,7 @@ class Keyring(KeyringBackend): """Secret Service Keyring""" - appid = os.path.basename(sys.argv[0]) or 'Python keyring library' + appid = 'Python keyring library' @properties.ClassProperty @classmethod diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-15.1.0/keyring/backends/Windows.py new/keyring-18.0.0/keyring/backends/Windows.py --- old/keyring-15.1.0/keyring/backends/Windows.py 2018-09-14 17:48:03.000000000 +0200 +++ new/keyring-18.0.0/keyring/backends/Windows.py 2019-02-13 22:45:11.000000000 +0100 @@ -5,34 +5,26 @@ from ..py27compat import text_type from ..util import properties from ..backend import KeyringBackend +from ..credentials import SimpleCredential from ..errors import PasswordDeleteError, ExceptionRaisedContext -try: - # prefer pywin32-ctypes - from win32ctypes.pywin32 import pywintypes - from win32ctypes.pywin32 import win32cred - # force demand import to raise ImportError - win32cred.__name__ -except ImportError: - # fallback to pywin32 + +with ExceptionRaisedContext() as missing_deps: try: + # prefer pywin32-ctypes + from win32ctypes.pywin32 import pywintypes + from win32ctypes.pywin32 import win32cred + # force demand import to raise ImportError + win32cred.__name__ + except ImportError: + # fallback to pywin32 import pywintypes import win32cred - except ImportError: - pass - -__metaclass__ = type + # force demand import to raise ImportError + win32cred.__name__ -def has_pywin32(): - """ - Does this environment have pywin32? - Should return False even when Mercurial's Demand Import allowed import of - win32cred. - """ - with ExceptionRaisedContext() as exc: - win32cred.__name__ - return not bool(exc) +__metaclass__ = type class WinVaultKeyring(KeyringBackend): @@ -59,7 +51,7 @@ """ If available, the preferred backend on Windows. """ - if not has_pywin32(): + if missing_deps: raise RuntimeError("Requires Windows and pywin32") return 5 @@ -122,9 +114,30 @@ raise PasswordDeleteError(service) def _delete_password(self, target): - win32cred.CredDelete( - Type=win32cred.CRED_TYPE_GENERIC, - TargetName=target, + try: + win32cred.CredDelete( + Type=win32cred.CRED_TYPE_GENERIC, + TargetName=target, + ) + except pywintypes.error as e: + e = OldPywinError.wrap(e) + if e.winerror == 1168 and e.funcname == 'CredDelete': # not found + return + raise + + def get_credential(self, service, username): + res = None + # get the credentials associated with the provided username + if username: + res = self._get_password(self._compound_name(username, service)) + # get any first password under the service name + if not res: + res = self._get_password(service) + if not res: + return None + return SimpleCredential( + res['UserName'], + res['CredentialBlob'].decode('utf-16'), ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-15.1.0/keyring/backends/_OS_X_API.py new/keyring-18.0.0/keyring/backends/_OS_X_API.py --- old/keyring-15.1.0/keyring/backends/_OS_X_API.py 2018-09-14 17:48:03.000000000 +0200 +++ new/keyring-18.0.0/keyring/backends/_OS_X_API.py 2019-02-13 22:45:11.000000000 +0100 @@ -14,6 +14,9 @@ class error: item_not_found = -25300 + keychain_denied = -128 + sec_auth_failed = -25293 + plist_missing = -67030 fw = '/System/Library/Frameworks/{name}.framework/Versions/A/{name}'.format @@ -36,18 +39,29 @@ class Error(Exception): @classmethod - def raise_for_status(cls, status, msg): + def raise_for_status(cls, status): if status == 0: return - raise cls(status, msg) + if status == error.item_not_found: + raise NotFound(status, "Item not found") + if status == error.keychain_denied: + raise KeychainDenied(status, "Keychain Access Denied") + if status == error.sec_auth_failed or status == error.plist_missing: + raise SecAuthFailure(status, "Security Auth Failure: make sure " + "python is signed with codesign util") + raise cls(status, "Unknown Error") class NotFound(Error): - @classmethod - def raise_for_status(cls, status, msg): - if status == error.item_not_found: - raise cls(status, msg) - Error.raise_for_status(status, msg) + pass + + +class KeychainDenied(Error): + pass + + +class SecAuthFailure(Error): + pass @contextlib.contextmanager @@ -55,11 +69,9 @@ ref = sec_keychain_ref() if name is None: status = SecKeychainCopyDefault(ref) - msg = "Unable to open default keychain" else: status = SecKeychainOpen(name.encode('utf-8'), ref) - msg = "Unable to open keychain {name}".format(**locals()) - Error.raise_for_status(status, msg) + Error.raise_for_status(status) try: yield ref finally: @@ -97,8 +109,7 @@ None, ) - msg = "Can't fetch password from system" - NotFound.raise_for_status(status, msg) + Error.raise_for_status(status) password = ctypes.create_string_buffer(length.value) ctypes.memmove(password, data.value, length.value) @@ -198,8 +209,7 @@ None, ) - msg = "Can't fetch password from system" - NotFound.raise_for_status(status, msg) + Error.raise_for_status(status) password = ctypes.create_string_buffer(length.value) ctypes.memmove(password, data.value, length.value) @@ -244,7 +254,7 @@ item, None, len(password), password) _core.CFRelease(item) - NotFound.raise_for_status(status, "Unable to set password") + Error.raise_for_status(status) SecKeychainAddInternetPassword = _sec.SecKeychainAddInternetPassword @@ -290,7 +300,7 @@ None, ) - NotFound.raise_for_status(status, "Unable to set password") + Error.raise_for_status(status) SecKeychainItemModifyAttributesAndData = ( @@ -329,7 +339,7 @@ item, ) - Error.raise_for_status(status, "Unable to delete password") + Error.raise_for_status(status) SecKeychainItemDelete(item) _core.CFRelease(item) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-15.1.0/keyring/backends/chainer.py new/keyring-18.0.0/keyring/backends/chainer.py --- old/keyring-15.1.0/keyring/backends/chainer.py 1970-01-01 01:00:00.000000000 +0100 +++ new/keyring-18.0.0/keyring/backends/chainer.py 2019-02-13 22:45:11.000000000 +0100 @@ -0,0 +1,68 @@ +""" +Keyring Chainer - iterates over other viable backends to +discover passwords in each. +""" + +from __future__ import absolute_import + +from .. import backend +from ..util import properties + + +class ChainerBackend(backend.KeyringBackend): + """ + >>> ChainerBackend() + <keyring.backends.chainer.ChainerBackend object at ...> + """ + + # override viability as 'priority' cannot be determined + # until other backends have been constructed + viable = True + + @properties.ClassProperty + @classmethod + def priority(cls): + """ + High-priority if there are backends to chain, otherwise 0. + """ + return 10 * (len(cls.backends) > 1) + + @properties.ClassProperty + @classmethod + def backends(cls): + """ + Discover all keyrings for chaining. + """ + allowed = ( + keyring + for keyring in filter(backend._limit, backend.get_all_keyring()) + if not isinstance(keyring, ChainerBackend) + and keyring.priority > 0 + ) + return sorted(allowed, key=backend.by_priority, reverse=True) + + def get_password(self, service, username): + for keyring in self.backends: + password = keyring.get_password(service, username) + if password is not None: + return password + + def set_password(self, service, username, password): + for keyring in self.backends: + try: + return keyring.set_password(service, username, password) + except NotImplementedError: + pass + + def delete_password(self, service, username): + for keyring in self.backends: + try: + return keyring.delete_password(service, username) + except NotImplementedError: + pass + + def get_credential(self, service, username): + for keyring in self.backends: + credential = keyring.get_credential(service, username) + if credential is not None: + return credential diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-15.1.0/keyring/backends/fail.py new/keyring-18.0.0/keyring/backends/fail.py --- old/keyring-15.1.0/keyring/backends/fail.py 2018-09-14 17:48:03.000000000 +0200 +++ new/keyring-18.0.0/keyring/backends/fail.py 2019-02-13 22:45:11.000000000 +0100 @@ -16,9 +16,10 @@ def get_password(self, service, username, password=None): msg = ( - "No recommended backend was available. Install the " - "keyrings.alt package if you want to use the non-" - "recommended backends. See README.rst for details." + "No recommended backend was available. Install a recommended 3rd " + "party backend package; or, install the keyrings.alt package if " + "you want to use the non-recommended backends. See " + "https://pypi.org/project/keyring for details." ) raise RuntimeError(msg) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-15.1.0/keyring/core.py new/keyring-18.0.0/keyring/core.py --- old/keyring-15.1.0/keyring/core.py 2018-09-14 17:48:03.000000000 +0200 +++ new/keyring-18.0.0/keyring/core.py 2019-02-13 22:45:11.000000000 +0100 @@ -5,7 +5,6 @@ import os import sys import logging -import operator from .py27compat import configparser, filter from .py33compat import max @@ -70,23 +69,33 @@ _keyring_backend.delete_password(service_name, username) -def recommended(backend): - return backend.priority >= 1 +def get_credential(service_name, username): + """Get a Credential for the specified service. + """ + return _keyring_backend.get_credential(service_name, username) -by_priority = operator.attrgetter('priority') +def recommended(backend): + return backend.priority >= 1 def init_backend(limit=None): """ Load a keyring specified in the config file or infer the best available. + + Limit, if supplied, should be a callable taking a backend and returning + True if that backend should be included for consideration. """ + # save the limit for the chainer to honor + backend._limit = limit + + # get all keyrings passing the limit filter keyrings = filter(limit, backend.get_all_keyring()) set_keyring( load_env() or load_config() - or max(keyrings, default=fail.Keyring, key=by_priority) + or max(keyrings, default=fail.Keyring(), key=backend.by_priority) ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-15.1.0/keyring/tests/backends/test_chainer.py new/keyring-18.0.0/keyring/tests/backends/test_chainer.py --- old/keyring-15.1.0/keyring/tests/backends/test_chainer.py 1970-01-01 01:00:00.000000000 +0100 +++ new/keyring-18.0.0/keyring/tests/backends/test_chainer.py 2019-02-13 22:45:11.000000000 +0100 @@ -0,0 +1,37 @@ +import pytest + +import keyring.backends.chainer +from keyring import backend + + [email protected] +def two_keyrings(monkeypatch): + def get_two(): + class Keyring1(backend.KeyringBackend): + priority = 1 + + def get_password(self, system, user): + return 'ring1-{system}-{user}'.format(**locals()) + + def set_password(self, system, user, password): + pass + + class Keyring2(backend.KeyringBackend): + priority = 2 + + def get_password(self, system, user): + return 'ring2-{system}-{user}'.format(**locals()) + + def set_password(self, system, user, password): + raise NotImplementedError() + + return Keyring1(), Keyring2() + + monkeypatch.setattr('keyring.backend.get_all_keyring', get_two) + + +class TestChainer: + def test_chainer_gets_from_highest_priority(self, two_keyrings): + chainer = keyring.backends.chainer.ChainerBackend() + pw = chainer.get_password('alpha', 'bravo') + assert pw == 'ring2-alpha-bravo' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-15.1.0/keyring/tests/test_backend.py new/keyring-18.0.0/keyring/tests/test_backend.py --- old/keyring-15.1.0/keyring/tests/test_backend.py 2018-09-14 17:48:03.000000000 +0200 +++ new/keyring-18.0.0/keyring/tests/test_backend.py 2019-02-13 22:45:11.000000000 +0100 @@ -134,3 +134,25 @@ assert keyring.get_password('service1', 'user2') == 'password2' self.set_password('service2', 'user3', 'password3') assert keyring.get_password('service1', 'user1') == 'password1' + + def test_credential(self): + keyring = self.keyring + + cred = keyring.get_credential('service', None) + assert cred is None + + self.set_password('service1', 'user1', 'password1') + self.set_password('service1', 'user2', 'password2') + + cred = keyring.get_credential('service1', None) + assert cred is None or (cred.username, cred.password) in ( + ('user1', 'password1'), + ('user2', 'password2'), + ) + + cred = keyring.get_credential('service1', 'user2') + assert cred is not None + assert (cred.username, cred.password) in ( + ('user1', 'password1'), + ('user2', 'password2'), + ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-15.1.0/keyring.egg-info/PKG-INFO new/keyring-18.0.0/keyring.egg-info/PKG-INFO --- old/keyring-15.1.0/keyring.egg-info/PKG-INFO 2018-09-14 17:48:29.000000000 +0200 +++ new/keyring-18.0.0/keyring.egg-info/PKG-INFO 2019-02-13 22:45:30.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: keyring -Version: 15.1.0 +Version: 18.0.0 Summary: Store and access your passwords safely. Home-page: https://github.com/jaraco/keyring Author: Kang Zhang @@ -16,12 +16,15 @@ .. image:: https://img.shields.io/travis/jaraco/keyring/master.svg :target: https://travis-ci.org/jaraco/keyring - .. .. image:: https://img.shields.io/appveyor/ci/jaraco/keyring/master.svg - .. :target: https://ci.appveyor.com/project/jaraco/keyring/branch/master + .. image:: https://img.shields.io/appveyor/ci/jaraco/keyring/master.svg + :target: https://ci.appveyor.com/project/jaraco/keyring/branch/master .. image:: https://readthedocs.org/projects/keyring/badge/?version=latest :target: https://keyring.readthedocs.io/en/latest/?badge=latest + .. image:: https://tidelift.com/badges/github/jaraco/keyring + :target: https://tidelift.com/subscription/pkg/pypi-keyring?utm_source=pypi-keyring&utm_medium=readme + ======================================= Installing and Using Python Keyring Lib ======================================= @@ -43,7 +46,7 @@ * macOS `Keychain <https://en.wikipedia.org/wiki/Keychain_%28software%29>`_ * Freedesktop `Secret Service - <http://standards.freedesktop.org/secret-service/>`_ supports many DE including + <http://standards.freedesktop.org/secret-service/>`_ supports many DE including GNOME (requires `secretstorage <https://pypi.python.org/pypi/secretstorage>`_) * KDE4 & KDE5 `KWallet <https://en.wikipedia.org/wiki/KWallet>`_ (requires `dbus <https://pypi.python.org/pypi/dbus-python>`_) @@ -66,11 +69,13 @@ Linux ----- - On Linux, the recommended keyring relies on SecretStorage, which in - turn relies on dbus-python, but dbus-python does not install correctly - when using the Python installers, so dbus-python must be installed - as a system package. See `the SecretStorage GitHub repo - <https://github.com/mitya57/secretstorage>`_ for details. + On Linux, the KWallet backend relies on dbus-python_, which does not always + install correctly when using pip (compilation is needed). So we recommend + that dbus-python is installed as a system package. The same also applies to + the Secret Storage backend under Python 2 (under Python 3 a different D-Bus + implementation is used). + + .. _dbus-python: https://gitlab.freedesktop.org/dbus/dbus-python ------------- Using Keyring @@ -148,12 +153,13 @@ If **keyring-path** is indicated, keyring will add that path to the Python module search path before loading the backend. - For example, this config might be used to load the SimpleKeyring from the demo - directory in the project checkout:: + For example, this config might be used to load the + ``SimpleKeyring`` from the ``simplekeyring`` module in + the ``./demo`` directory (not implemented):: [backend] default-keyring=simplekeyring.SimpleKeyring - keyring-path=/home/kang/pyworkspace/python-keyring-lib/demo/ + keyring-path=demo Third-Party Backends ==================== @@ -174,6 +180,10 @@ - `gsheet-keyring <https://pypi.org/project/gsheet-keyring>`_ - a backend that stores secrets in a Google Sheet. For use with `ipython-secrets <https://pypi.org/project/ipython-secrets>`_. + - `bitwarden-keyring <https://pypi.org/project/bitwarden-keyring/0.1.0/>`_ + - a backend that stores secrets in the `BitWarden <https://bitwarden.com/>`_ + password manager. + Write your own keyring backend ============================== @@ -181,7 +191,8 @@ The interface for the backend is defined by ``keyring.backend.KeyringBackend``. Every backend should derive from that base class and define a ``priority`` attribute and three functions: ``get_password()``, ``set_password()``, and - ``delete_password()``. + ``delete_password()``. The ``get_credential()`` function may be defined if + desired. See the ``backend`` module for more detail on the interface of this class. @@ -294,6 +305,10 @@ * ``get_keyring()``: Return the currently-loaded keyring implementation. * ``get_password(service, username)``: Returns the password stored in the active keyring. If the password does not exist, it will return None. + * ``get_credential(service, username)``: Return a credential object stored + in the active keyring. This object contains at least ``username`` and + ``password`` attributes for the specified service, where the returned + ``username`` may be different from the argument. * ``set_password(service, username, password)``: Store the password in the keyring. * ``delete_password(service, username)``: Delete the password stored in @@ -327,6 +342,14 @@ * Bug Tracker: https://github.com/jaraco/keyring/issues/ * Mailing list: http://groups.google.com/group/python-keyring + Security Contact + ================ + + If you wish to report a security vulnerability, the public disclosure + of which may exacerbate the risk, please + `Contact Tidelift security <https://tidelift.com/security>`_, + which will coordinate the fix and disclosure privately. + Making Releases =============== @@ -376,6 +399,7 @@ Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: MIT License Classifier: License :: OSI Approved :: Python Software Foundation License Classifier: License :: OSI Approved :: MIT License Classifier: Programming Language :: Python :: 2.7 @@ -385,5 +409,5 @@ Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Requires-Python: >=2.7 -Provides-Extra: docs Provides-Extra: testing +Provides-Extra: docs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-15.1.0/keyring.egg-info/SOURCES.txt new/keyring-18.0.0/keyring.egg-info/SOURCES.txt --- old/keyring-15.1.0/keyring.egg-info/SOURCES.txt 2018-09-14 17:48:29.000000000 +0200 +++ new/keyring-18.0.0/keyring.egg-info/SOURCES.txt 2019-02-13 22:45:30.000000000 +0100 @@ -13,10 +13,12 @@ pytest.ini setup.cfg setup.py +skeleton.md tox.ini docs/conf.py docs/history.rst docs/index.rst +docs/_templates/tidelift-sidebar.html keyring/__init__.py keyring/__main__.py keyring/backend.py @@ -33,7 +35,6 @@ keyring.egg-info/SOURCES.txt keyring.egg-info/dependency_links.txt keyring.egg-info/entry_points.txt -keyring.egg-info/namespace_packages.txt keyring.egg-info/requires.txt keyring.egg-info/top_level.txt keyring/backends/OS_X.py @@ -41,6 +42,7 @@ keyring/backends/Windows.py keyring/backends/_OS_X_API.py keyring/backends/__init__.py +keyring/backends/chainer.py keyring/backends/fail.py keyring/backends/kwallet.py keyring/backends/null.py @@ -51,6 +53,7 @@ keyring/tests/backends/test_OS_X.py keyring/tests/backends/test_SecretService.py keyring/tests/backends/test_Windows.py +keyring/tests/backends/test_chainer.py keyring/tests/backends/test_kwallet.py keyring/util/__init__.py keyring/util/platform_.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-15.1.0/keyring.egg-info/entry_points.txt new/keyring-18.0.0/keyring.egg-info/entry_points.txt --- old/keyring-15.1.0/keyring.egg-info/entry_points.txt 2018-09-14 17:48:29.000000000 +0200 +++ new/keyring-18.0.0/keyring.egg-info/entry_points.txt 2019-02-13 22:45:30.000000000 +0100 @@ -8,5 +8,6 @@ KWallet = keyring.backends.kwallet SecretService = keyring.backends.SecretService Windows = keyring.backends.Windows +chainer = keyring.backends.chainer macOS = keyring.backends.OS_X diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-15.1.0/keyring.egg-info/namespace_packages.txt new/keyring-18.0.0/keyring.egg-info/namespace_packages.txt --- old/keyring-15.1.0/keyring.egg-info/namespace_packages.txt 2018-09-14 17:48:29.000000000 +0200 +++ new/keyring-18.0.0/keyring.egg-info/namespace_packages.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-15.1.0/keyring.egg-info/requires.txt new/keyring-18.0.0/keyring.egg-info/requires.txt --- old/keyring-15.1.0/keyring.egg-info/requires.txt 2018-09-14 17:48:29.000000000 +0200 +++ new/keyring-18.0.0/keyring.egg-info/requires.txt 2019-02-13 22:45:30.000000000 +0100 @@ -1,12 +1,12 @@ entrypoints -[:(sys_platform=="linux2" or sys_platform=="linux") and python_version<"3.5"] +[:(sys_platform == "linux2" or sys_platform == "linux") and python_version < "3.5"] secretstorage<3 -[:sys_platform=="linux" and python_version>="3.5"] +[:sys_platform == "linux" and python_version >= "3.5"] secretstorage -[:sys_platform=="win32"] +[:sys_platform == "win32"] pywin32-ctypes!=0.1.0,!=0.1.1 [docs] @@ -15,7 +15,6 @@ rst.linker>=1.9 [testing] -pytest>=3.5 -pytest-sugar>=0.9.1 -collective.checkdocs +pytest!=3.7.3,>=3.5 +pytest-checkdocs pytest-flake8 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-15.1.0/pyproject.toml new/keyring-18.0.0/pyproject.toml --- old/keyring-15.1.0/pyproject.toml 2018-09-14 17:48:03.000000000 +0200 +++ new/keyring-18.0.0/pyproject.toml 2019-02-13 22:45:11.000000000 +0100 @@ -1,2 +1,3 @@ [build-system] -requires = ["setuptools>=30.3", "wheel", "setuptools_scm>=1.15"] +requires = ["setuptools>=34.4", "wheel", "setuptools_scm>=1.15"] +build-backend = "setuptools.build_meta" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-15.1.0/pytest.ini new/keyring-18.0.0/pytest.ini --- old/keyring-15.1.0/pytest.ini 2018-09-14 17:48:03.000000000 +0200 +++ new/keyring-18.0.0/pytest.ini 2019-02-13 22:45:11.000000000 +0100 @@ -2,3 +2,10 @@ norecursedirs=dist build .tox .eggs addopts=--doctest-modules --flake8 doctest_optionflags=ALLOW_UNICODE ELLIPSIS +filterwarnings= + ignore:Possible nested set::pycodestyle:113 + ignore:Using or importing the ABCs::flake8:410 + # workaround for https://sourceforge.net/p/docutils/bugs/348/ + ignore:'U' mode is deprecated::docutils.io + # workaround for https://gitlab.com/pycqa/flake8/issues/275 + ignore:You passed a bytestring as `filenames`.::flake8 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-15.1.0/setup.cfg new/keyring-18.0.0/setup.cfg --- old/keyring-15.1.0/setup.cfg 2018-09-14 17:48:29.000000000 +0200 +++ new/keyring-18.0.0/setup.cfg 2019-02-13 22:45:30.000000000 +0100 @@ -1,13 +1,61 @@ -[aliases] -release = dists upload -dists = clean --all sdist bdist_wheel - [bdist_wheel] universal = 1 [metadata] license_file = LICENSE +name = keyring +author = Kang Zhang +author_email = [email protected] +maintainer = Jason R. Coombs +maintainer_email = [email protected] +description = Store and access your passwords safely. long_description = file:README.rst +url = https://github.com/jaraco/keyring +classifiers = + Development Status :: 5 - Production/Stable + Intended Audience :: Developers + License :: OSI Approved :: MIT License + License :: OSI Approved :: Python Software Foundation License + License :: OSI Approved :: MIT License + Programming Language :: Python :: 2.7 + Programming Language :: Python :: 3.3 + Programming Language :: Python :: 3.4 + Programming Language :: Python :: 3.5 + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + +[options] +packages = find: +include_package_data = true +python_requires = >=2.7 +install_requires = + entrypoints + pywin32-ctypes!=0.1.0,!=0.1.1; sys_platform=="win32" + secretstorage; sys_platform=="linux" and python_version>="3.5" + secretstorage<3; (sys_platform=="linux2" or sys_platform=="linux") and python_version<"3.5" +setup_requires = setuptools_scm >= 1.15.0 + +[options.extras_require] +testing = + pytest >= 3.5, !=3.7.3 + pytest-checkdocs + pytest-flake8 +docs = + sphinx + jaraco.packaging >= 3.2 + rst.linker >= 1.9 + +[options.entry_points] +console_scripts = + keyring=keyring.cli:main +devpi_client = + keyring = keyring.devpi_client +keyring.backends = + Windows = keyring.backends.Windows + macOS = keyring.backends.OS_X + SecretService = keyring.backends.SecretService + KWallet = keyring.backends.kwallet + chainer = keyring.backends.chainer [egg_info] tag_build = diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-15.1.0/setup.py new/keyring-18.0.0/setup.py --- old/keyring-15.1.0/setup.py 2018-09-14 17:48:03.000000000 +0200 +++ new/keyring-18.0.0/setup.py 2019-02-13 22:45:11.000000000 +0100 @@ -1,94 +1,6 @@ #!/usr/bin/env python -# Project skeleton maintained at https://github.com/jaraco/skeleton - import setuptools -name = 'keyring' -description = 'Store and access your passwords safely.' -nspkg_technique = 'native' -""" -Does this package use "native" namespace packages or -pkg_resources "managed" namespace packages? -""" - -params = dict( - name=name, - use_scm_version=True, - author="Kang Zhang", - author_email="[email protected]", - maintainer='Jason R. Coombs', - maintainer_email='[email protected]', - description=description or name, - url="https://github.com/jaraco/" + name, - packages=setuptools.find_packages(), - include_package_data=True, - namespace_packages=( - name.split('.')[:-1] if nspkg_technique == 'managed' - else [] - ), - python_requires='>=2.7', - install_requires=[ - 'entrypoints', - ], - extras_require={ - 'testing': [ - # upstream - 'pytest>=3.5', - 'pytest-sugar>=0.9.1', - 'collective.checkdocs', - 'pytest-flake8', - - # local - ], - 'docs': [ - # upstream - 'sphinx', - 'jaraco.packaging>=3.2', - 'rst.linker>=1.9', - - # local - ], - ':sys_platform=="win32"': [ - 'pywin32-ctypes!=0.1.0,!=0.1.1', - ], - ':sys_platform=="linux" and python_version>="3.5"': [ - "secretstorage", - ], - ':(sys_platform=="linux2" or sys_platform=="linux")' - ' and python_version<"3.5"': [ - "secretstorage<3", - ], - }, - setup_requires=[ - 'setuptools_scm>=1.15.0', - ], - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "License :: OSI Approved :: Python Software Foundation License", - "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3.3", - "Programming Language :: Python :: 3.4", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - ], - entry_points={ - 'console_scripts': [ - 'keyring=keyring.cli:main', - ], - 'devpi_client': [ - 'keyring = keyring.devpi_client', - ], - 'keyring.backends': [ - 'Windows = keyring.backends.Windows', - 'macOS = keyring.backends.OS_X', - 'SecretService = keyring.backends.SecretService', - 'KWallet = keyring.backends.kwallet', - ], - }, -) -if __name__ == '__main__': - setuptools.setup(**params) +if __name__ == "__main__": + setuptools.setup(use_scm_version=True) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-15.1.0/skeleton.md new/keyring-18.0.0/skeleton.md --- old/keyring-15.1.0/skeleton.md 1970-01-01 01:00:00.000000000 +0100 +++ new/keyring-18.0.0/skeleton.md 2019-02-13 22:45:11.000000000 +0100 @@ -0,0 +1,128 @@ +# Overview + +This project is merged with [skeleton](https://github.com/jaraco/skeleton). What is skeleton? It's the scaffolding of a Python project jaraco [introduced in his blog](https://blog.jaraco.com/a-project-skeleton-for-python-projects/). It seeks to provide a means to re-use techniques and inherit advances when managing projects for distribution. + +## An SCM Managed Approach + +While maintaining dozens of projects in PyPI, jaraco derives best practices for project distribution and publishes them in the [skeleton repo](https://github.com/jaraco/skeleton), a git repo capturing the evolution and culmination of these best practices. + +It's intended to be used by a new or existing project to adopt these practices and honed and proven techniques. Adopters are encouraged to use the project directly and maintain a small deviation from the technique, make their own fork for more substantial changes unique to their environment or preferences, or simply adopt the skeleton once and abandon it thereafter. + +The primary advantage to using an SCM for maintaining these techniques is that those tools help facilitate the merge between the template and its adopting projects. + +Another advantage to using an SCM-managed approach is that tools like GitHub recognize that a change in the skeleton is the _same change_ across all projects that merge with that skeleton. Without the ancestry, with a traditional copy/paste approach, a [commit like this](https://github.com/jaraco/skeleton/commit/12eed1326e1bc26ce256e7b3f8cd8d3a5beab2d5) would produce notifications in the upstream project issue for each and every application, but because it's centralized, GitHub provides just the one notification when the change is added to the skeleton. + +# Usage + +## new projects + +To use skeleton for a new project, simply pull the skeleton into a new project: + +``` +$ git init my-new-project +$ cd my-new-project +$ git pull gh://jaraco/skeleton +``` + +Now customize the project to suit your individual project needs. + +## existing projects + +If you have an existing project, you can still incorporate the skeleton by merging it into the codebase. + +``` +$ git merge skeleton --allow-unrelated-histories +``` + +The `--allow-unrelated-histories` is necessary because the history from the skeleton was previously unrelated to the existing codebase. Resolve any merge conflicts and commit to the master, and now the project is based on the shared skeleton. + +## Updating + +Whenever a change is needed or desired for the general technique for packaging, it can be made in the skeleton project and then merged into each of the derived projects as needed, recommended before each release. As a result, features and best practices for packaging are centrally maintained and readily trickle into a whole suite of packages. This technique lowers the amount of tedious work necessary to create or maintain a project, and coupled with other techniques like continuous integration and deployment, lowers the cost of creating and maintaining refined Python projects to just a few, familiar git operations. + +Thereafter, the target project can make whatever customizations it deems relevant to the scaffolding. The project may even at some point decide that the divergence is too great to merit renewed merging with the original skeleton. This approach applies maximal guidance while creating minimal constraints. + +# Features + +The features/techniques employed by the skeleton include: + +- PEP 517/518 based build relying on setuptools as the build tool +- setuptools declarative configuration using setup.cfg +- tox for running tests +- A README.rst as reStructuredText with some popular badges, but with readthedocs and appveyor badges commented out +- A CHANGES.rst file intended for publishing release notes about the project. + +## Packaging Conventions + +A pyproject.toml is included to enable PEP 517 and PEP 518 compatibility and declares the requirements necessary to build the project on setuptools (a minimum version compatible with setup.cfg declarative config). + +The setup.cfg file implements the following features: + +- Assumes universal wheel for release +- Advertises the project's LICENSE file (MIT by default) +- Reads the README.rst file into the long description +- Some common Trove classifiers +- Includes all packages discovered in the repo +- Data files in the package are also included (not just Python files) +- Declares the required Python versions +- Declares install requirements (empty by default) +- Declares setup requirements for legacy environments +- Supplies two 'extras': + - testing: requirements for running tests + - docs: requirements for building docs + - these extras split the declaration into "upstream" (requirements as declared by the skeleton) and "local" (those specific to the local project); these markers help avoid merge conflicts +- Placeholder for defining entry points + +Additionally, the setup.py file declares `use_scm_version` which relies on [setuptools_scm](https://pypi.org/project/setuptools_scm) to do two things: + +- derive the project version from SCM tags +- ensure that all files committed to the repo are automatically included in releases + +## Running Tests + +The skeleton assumes the developer has [tox](https://pypi.org/project/tox) installed. The developer is expected to run `tox` to run tests on the current Python version using [pytest](https://pypi.org/project/pytest). + +Other environments (invoked with `tox -e {name}`) supplied include: + + - a `build-docs` environment to build the documentation + - a `release` environment to publish the package to PyPI + +A pytest.ini is included to define common options around running tests. In particular: + +- rely on default test discovery in the current directory +- avoid recursing into common directories not containing tests +- run doctests on modules and invoke flake8 tests +- in doctests, allow unicode literals and regular literals to match, allowing for doctests to run on Python 2 and 3. Also enable ELLIPSES, a default that would be undone by supplying the prior option. +- filters out known warnings caused by libraries/functionality included by the skeleton + +Relies a .flake8 file to correct some default behaviors: + +- allow tabs for indentation (legacy for jaraco projects) +- disable mutually incompatible rules W503 and W504. + +## Continuous Integration + +The project is pre-configured to run tests in [Travis-CI](https://travis-ci.org) (.travis.yml). Any new project must be enabled either through their web site or with the `travis enable` command. In addition to running tests, an additional deploy stage is configured to automatically release tagged commits. The username and password for PyPI must be configured for each project using the `travis` command and only after the travis project is created. As releases are cut with [twine](https://pypi.org/project/twine), the two values are supplied through the `TWINE_USERNAME` and `TWINE_PASSWORD`. To configure the latter as a secret, run the following command: + +``` +echo "TWINE_PASSWORD={password}" | travis encrypt +``` + +Or disable it in the CI definition and configure it through the web UI. + +Features include: +- test against Python 2 and 3 +- run on Ubuntu Xenial +- correct for broken IPv6 + +Also provided is a minimal template for running under Appveyor (Windows). + +## Building Documentation + +Documentation is automatically built by [Read the Docs](https://readthedocs.org) when the project is registered with it, by way of the .readthedocs.yml file. To test the docs build manually, a tox env may be invoked as `tox -e build-docs`. Both techniques rely on the dependencies declared in `setup.cfg/options.extras_require.docs`. + +In addition to building the sphinx docs scaffolded in `docs/`, the docs build a `history.html` file that first injects release dates and hyperlinks into the CHANGES.rst before incorporating it as history in the docs. + +## Cutting releases + +By default, tagged commits are released through the continuous integration deploy stage. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-15.1.0/tox.ini new/keyring-18.0.0/tox.ini --- old/keyring-15.1.0/tox.ini 2018-09-14 17:48:03.000000000 +0200 +++ new/keyring-18.0.0/tox.ini 2019-02-13 22:45:11.000000000 +0100 @@ -5,11 +5,8 @@ [testenv] deps = setuptools>=31.0.1 - # workaround for yaml/pyyaml#126 - # pyyaml>=4.2b2;python_version=="3.7" commands = pytest {posargs} - python setup.py checkdocs usedevelop = True extras = testing @@ -20,3 +17,15 @@ changedir = docs commands = python -m sphinx . {toxinidir}/build/html + +[testenv:release] +skip_install = True +deps = + pep517>=0.5 + # workaround for https://github.com/pypa/twine/issues/423 + git+https://github.com/pypa/twine + path.py +commands = + python -c "import path; path.Path('dist').rmtree_p()" + python -m pep517.build . + python -m twine upload dist/*
