Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: lovetox/keyring
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: jaraco/keyring
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Able to merge. These branches can be automatically merged.
Loading
Showing with 937 additions and 479 deletions.
  1. +6 −0 .coveragerc
  2. +0 −8 .github/dependabot.yml
  3. +53 −45 .github/workflows/main.yml
  4. +5 −3 .pre-commit-config.yaml
  5. +10 −3 .readthedocs.yaml
  6. +116 −1 NEWS.rst
  7. +10 −10 README.rst
  8. +5 −18 conftest.py
  9. +14 −0 docs/conf.py
  10. +1 −1 hook-keyring.backend.py
  11. +4 −4 keyring/__init__.py
  12. +0 −7 keyring/_compat.py
  13. +65 −29 keyring/backend.py
  14. +14 −0 keyring/backend_complete.bash
  15. +11 −10 keyring/backends/SecretService.py
  16. +28 −30 keyring/backends/Windows.py
  17. +3 −2 keyring/backends/chainer.py
  18. +3 −3 keyring/backends/fail.py
  19. +6 −7 keyring/backends/kwallet.py
  20. +4 −5 keyring/backends/libsecret.py
  21. +10 −15 keyring/backends/macOS/__init__.py
  22. +26 −15 keyring/backends/macOS/api.py
  23. +3 −3 keyring/backends/null.py
  24. +83 −15 keyring/cli.py
  25. +7 −0 keyring/compat/__init__.py
  26. 0 keyring/{_properties_compat.py → compat/properties.py}
  27. +9 −0 keyring/compat/py312.py
  28. +9 −0 keyring/compat/py38.py
  29. +14 −9 keyring/completion.py
  30. +14 −7 keyring/core.py
  31. +28 −13 keyring/credentials.py
  32. +1 −6 keyring/devpi_client.py
  33. +6 −0 keyring/errors.py
  34. +2 −2 keyring/http.py
  35. +0 −10 keyring/py312compat.py
  36. +26 −4 keyring/testing/backend.py
  37. +2 −5 keyring/testing/util.py
  38. +2 −28 keyring/util/__init__.py
  39. +5 −33 keyring/util/platform_.py
  40. +17 −3 mypy.ini
  41. +96 −3 pyproject.toml
  42. +7 −9 pytest.ini
  43. +57 −0 ruff.toml
  44. +0 −80 setup.cfg
  45. +6 −0 tea.yaml
  46. +1 −1 tests/backends/test_SecretService.py
  47. +3 −2 tests/backends/test_Windows.py
  48. +4 −13 tests/backends/test_kwallet.py
  49. +1 −1 tests/backends/test_libsecret.py
  50. +1 −1 tests/backends/test_macOS.py
  51. +97 −0 tests/test_cli.py
  52. +6 −0 tests/test_core.py
  53. +1 −2 tests/test_integration.py
  54. +11 −7 tests/test_multiprocess.py
  55. +1 −1 tests/test_packaging.py
  56. +23 −5 tox.ini
6 changes: 6 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -7,3 +7,9 @@ disable_warnings =

[report]
show_missing = True
exclude_also =
# Exclude common false positives per
# https://coverage.readthedocs.io/en/latest/excluding.html#advanced-exclusion
# Ref jaraco/skeleton#97 and jaraco/skeleton#135
class .*\bProtocol\):
if TYPE_CHECKING:
8 changes: 0 additions & 8 deletions .github/dependabot.yml

This file was deleted.

98 changes: 53 additions & 45 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,96 +1,105 @@
name: tests

on: [push, pull_request]
on:
merge_group:
push:
branches-ignore:
# temporary GH branches relating to merge queues (jaraco/skeleton#93)
- gh-readonly-queue/**
tags:
# required if branches-ignore is supplied (jaraco/skeleton#103)
- '**'
pull_request:
workflow_dispatch:

permissions:
contents: read

env:
# Environment variables to support color support (jaraco/skeleton#66):
# Request colored output from CLI tools supporting it. Different tools
# interpret the value differently. For some, just being set is sufficient.
# For others, it must be a non-zero integer. For yet others, being set
# to a non-empty value is sufficient. For tox, it must be one of
# <blank>, 0, 1, false, no, off, on, true, yes. The only enabling value
# in common is "1".
# Environment variable to support color support (jaraco/skeleton#66)
FORCE_COLOR: 1
# MyPy's color enforcement (must be a non-zero number)
MYPY_FORCE_COLOR: -42
# Recognized by the `py` package, dependency of `pytest` (must be "1")
PY_COLORS: 1
# Make tox-wrapped tools see color requests
TOX_TESTENV_PASSENV: >-
FORCE_COLOR
MYPY_FORCE_COLOR
NO_COLOR
PY_COLORS
PYTEST_THEME
PYTEST_THEME_MODE

# Suppress noisy pip warnings
PIP_DISABLE_PIP_VERSION_CHECK: 'true'
PIP_NO_PYTHON_VERSION_WARNING: 'true'
PIP_NO_WARN_SCRIPT_LOCATION: 'true'

# Disable the spinner, noise in GHA; TODO(webknjaz): Fix this upstream
# Must be "1".
TOX_PARALLEL_NO_SPINNER: 1
# Ensure tests can sense settings about the environment
TOX_OVERRIDE: >-
testenv.pass_env+=GITHUB_*,FORCE_COLOR
jobs:
test:
strategy:
# https://blog.jaraco.com/efficient-use-of-ci-resources/
matrix:
python:
- "3.8"
- "3.11"
- "3.12"
- "3.9"
- "3.13"
platform:
- ubuntu-latest
- macos-latest
- windows-latest
include:
- python: "3.9"
platform: ubuntu-latest
- python: "3.10"
platform: ubuntu-latest
- python: pypy3.9
- python: "3.11"
platform: ubuntu-latest
- python: "3.12"
platform: ubuntu-latest
- python: "3.14"
platform: ubuntu-latest
- python: pypy3.10
platform: ubuntu-latest
runs-on: ${{ matrix.platform }}
continue-on-error: ${{ matrix.python == '3.12' }}
continue-on-error: ${{ matrix.python == '3.14' }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install build dependencies
# Install dependencies for building packages on pre-release Pythons
# jaraco/skeleton#161
if: matrix.python == '3.14' && matrix.platform == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install -y libxml2-dev libxslt-dev
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
allow-prereleases: true
- name: Install tox
run: |
python -m pip install tox
run: python -m pip install tox
- name: Run
run: tox

docs:
collateral:
strategy:
fail-fast: false
matrix:
job:
- diffcov
- docs
runs-on: ubuntu-latest
env:
TOXENV: docs
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install tox
run: |
python -m pip install tox
- name: Run
run: tox
run: python -m pip install tox
- name: Eval ${{ matrix.job }}
run: tox -e ${{ matrix.job }}

check: # This job does nothing and is only used for the branch protection
if: always()

needs:
- test
- docs
- collateral

runs-on: ubuntu-latest

@@ -109,14 +118,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install tox
run: |
python -m pip install tox
run: python -m pip install tox
- name: Run
run: tox -e release
env:
8 changes: 5 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
repos:
- repo: https://github.com/psf/black
rev: 22.6.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.1
hooks:
- id: black
- id: ruff
args: [--fix, --unsafe-fixes]
- id: ruff-format
13 changes: 10 additions & 3 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -3,10 +3,17 @@ python:
install:
- path: .
extra_requirements:
- docs
- doc

sphinx:
configuration: docs/conf.py

# required boilerplate readthedocs/readthedocs.org#10401
build:
os: ubuntu-22.04
os: ubuntu-lts-latest
tools:
python: "3"
python: latest
# post-checkout job to ensure the clone isn't shallow jaraco/skeleton#114
jobs:
post_checkout:
- git fetch --unshallow || true
117 changes: 116 additions & 1 deletion NEWS.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,118 @@
v25.6.0
=======

Features
--------

- Avoid logging a warning when config does not specify a backend. (#682)


v25.5.0
=======

Features
--------

- When parsing ``keyring_path`` from the config, the home directory is now expanded from ``~``. (#696)


Bugfixes
--------

- In get_credential, now returns None when the indicated username is not found. (#698)


v25.4.1
=======

Bugfixes
--------

- Fixed ValueError for AnonymousCredentials in CLI. (#694)


v25.4.0
=======

Features
--------

- Refined type spec and interfaces on credential objects. Introduced AnonymousCredential to model a secret without a username. (#689)


v25.3.0
=======

Features
--------

- Deprecated support for empty usernames. Now all backends will reject an empty string as input for the 'username' field when setting a password. Later this deprecation will become a more visible user warning and even later an error. If this warning is triggered in your environment, please consider using a static value (even 'username') or comment in the issue and describe the use-case that demands support for empty usernames. (#668)


v25.2.1
=======

Bugfixes
--------

- Fix typo in CLI creds mode. (#681)


v25.2.0
=======

Features
--------

- Added options for 'keyring get' command to support credential retrieval and emit as JSON. (#678)


v25.1.0
=======

Features
--------

- Replace ExceptionRaisedContext with ExceptionTrap.


v25.0.1
=======

Bugfixes
--------

- When completion is unavailable, exit with non-zero status and emit message to stderr. (#671)


v25.0.0
=======

Deprecations and Removals
-------------------------

- Removed check for config in XDG_DATA_HOME on Linux systems. (#99)
- In platform config support, remove support for Windows XP, now 10 years sunset.


v24.3.1
=======

Bugfixes
--------

- Minor fixes to account for emergent typing and linter concerns.


v24.3.0
=======

Features
--------

- Added bash completion support. (#643)


v24.2.0
=======

@@ -416,7 +531,7 @@ v19.3.0
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
Additionally, the error message from the underlying error is
now included in any errors that occur.

17.1.1
Loading