Skip to content

Commit

Permalink
Rename macOS backend to reflect the modern name inclusive of macOS 11.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Jan 24, 2021
1 parent 3355c65 commit 4aed205
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 12 deletions.
7 changes: 7 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
v22.0.0
-------

* Renamed macOS backend from ``OS_X`` to ``macOS``.
Any users specifying the backend by name will need to
use the new name ``keyring.backends.macOS``.

v21.8.0
-------

Expand Down
2 changes: 1 addition & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
collect_ignore = ["hook-keyring.backend.py"]

if platform.system() != 'Darwin':
collect_ignore.append('keyring/backends/_OS_X_API.py')
collect_ignore.append('keyring/backends/macOS/api.py')

collect_ignore.append('keyring/devpi_client.py')
14 changes: 7 additions & 7 deletions keyring/backends/OS_X.py → keyring/backends/macOS/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import platform
import os

from ..backend import KeyringBackend
from ..errors import PasswordSetError
from ..errors import PasswordDeleteError
from ..errors import KeyringLocked
from ..errors import KeyringError
from ..util import properties
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:
from . import _OS_X_API as api
from . import api
except Exception:
pass

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion keyring/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def _load_keyring_class(keyring_name):
>>> popular_names = [
... 'keyring.backends.Windows.WinVaultKeyring',
... 'keyring.backends.OS_X.Keyring',
... 'keyring.backends.macOS.Keyring',
... 'keyring.backends.kwallet.DBusKeyring',
... 'keyring.backends.SecretService.Keyring',
... ]
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ devpi_client =
keyring = keyring.devpi_client
keyring.backends =
Windows = keyring.backends.Windows
macOS = keyring.backends.OS_X
macOS = keyring.backends.macOS
SecretService = keyring.backends.SecretService
KWallet = keyring.backends.kwallet
chainer = keyring.backends.chainer
4 changes: 2 additions & 2 deletions tests/backends/test_OS_X.py → tests/backends/test_macOS.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pytest

from keyring.testing.backend import BackendBasicTests
from keyring.backends import OS_X
from keyring.backends import macOS


def is_osx_keychain_supported():
Expand All @@ -13,4 +13,4 @@ def is_osx_keychain_supported():
@pytest.mark.skipif(not is_osx_keychain_supported(), reason="Needs macOS")
class TestOSXKeychain(BackendBasicTests):
def init_keyring(self):
return OS_X.Keyring()
return macOS.Keyring()

5 comments on commit 4aed205

@JD-Veiga
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

These changes break backwards compatibility. IMHO, it would be better to keep the older names for a while and raise a DeprecationWarning.

Personally, I am suffering troubles with pip list -o command similar to those explained by @gothicVI in #486

In any case, thank you for your work. One of my favourite libraries.

@gothicVI
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this even impact non-Apple installations in the first place?

@JD-Veiga
Copy link

@JD-Veiga JD-Veiga commented on 4aed205 Jan 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I supposed because all backends are imported whatever OS is running:

from . import backend

@jaraco
Copy link
Owner Author

@jaraco jaraco commented on 4aed205 Jan 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes break backwards compatibility. IMHO, it would be better to keep the older names for a while and raise a DeprecationWarning.

Acknowledged. The reported failure was unexpected. The only expected breakage was for macOS users that are explicitly specifying the macOS backend by name (expected to be a negligible if present user base).

How does this even impact non-Apple installations in the first place?

Keyring enumerates every backend through the plugin discovery mechanism, which relies on the metadata in each package including the metadata in keyring.

@JD-Veiga
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my case, I solved the issue by installing and re-installing keyring (see #486 (comment)). There are several copies of keyring metadata in my system, corresponding to successive version of the library. So I think that the cause is the way I use pip (in combination with macports). No bug in keyring at all.

Thank you for your time and sorry for the inconvenience.

Please sign in to comment.