Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow drivers requiring extended attributes to use any xattr implementation #194

Merged
merged 1 commit into from
Feb 17, 2025

Conversation

eli-schwartz
Copy link
Contributor

There are two reasonably popular implementations of "xattr" on PyPI:

  • xattr
  • pyxattr

They both provide the same importable name, "import xattr", but provide different APIs once you do import it. There can only be one installed to any given python environment. Detect which one is available and utilize its API, rather than assume that the one preferred by this package's install_requires is the one actually installed in the current environment.

This aids people in manually crafting environments containing a mix of packages if any of them require pyxattr specifically. Unfortunately PyPA metadata standards do not support boolean "OR" dependency operators, so this is primarily useful to people installing software using a non-python package manager (such as a linux distro package manager).

…tation

There are two reasonably popular implementations of "xattr" on PyPI:

- xattr
- pyxattr

They both provide the same importable name, "import xattr", but provide
different APIs once you do import it. There can only be one installed to
any given python environment. Detect which one is available and utilize
its API, rather than assume that the one preferred by this package's
install_requires is the one actually installed in the current
environment.

This aids people in manually crafting environments containing a mix of
packages if any of them require pyxattr specifically. Unfortunately PyPA
metadata standards do not support boolean "OR" dependency operators, so
this is primarily useful to people installing software using a
non-python package manager (such as a linux distro package manager).

Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>
@tobias-urdin tobias-urdin merged commit 1858ee4 into jd:master Feb 17, 2025
6 checks passed
@eli-schwartz eli-schwartz deleted the pyxattr branch February 17, 2025 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants