Skip to content

Commit

Permalink
An initial attempt to skip collection on macOS API module. Doesn't wo…
Browse files Browse the repository at this point in the history
…rk because mac_ver doesn't work on newer macs with older Pythons. Ref #529.
  • Loading branch information
jaraco committed Nov 25, 2021
1 parent 4e4ec97 commit 73f27cb
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions conftest.py
@@ -1,8 +1,29 @@
import sys
import platform

collect_ignore = ["hook-keyring.backend.py"]

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

def macos_api_ignore():
"""
Starting with macOS 11, the security API becomes
non-viable except on universal2 binaries.
Ref #525.
"""

def make_ver(string):
return tuple(map(int, string.split('.')))

release, _, _ = platform.mac_ver()

return (
platform.system() != 'Darwin'
or make_ver(release) > (11,)
and sys.version_info < (3, 8, 7)
)


collect_ignore.extend(['keyring/backends/macOS/api.py'] * macos_api_ignore())

collect_ignore.append('keyring/devpi_client.py')

0 comments on commit 73f27cb

Please sign in to comment.