Skip to content

Commit

Permalink
pyinstaller: fix CI on py<3.10 (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmrowla authored Nov 15, 2022
1 parent cbe7c28 commit b95c953
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 11 additions & 2 deletions pydrive2/__pyinstaller/test_hook-googleapiclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,21 @@
from PyInstaller import __main__ as pyi_main


_APP_SOURCE = """import importlib.resources
# NOTE: importlib.resources.contents is available in py3.7+, but due to how
# pyinstaller handles importlib, we need to use the importlib_resources
# backport if there are any resources methods that are not available in a given
# python version, which ends up being py<3.10
_APP_SOURCE = """
import sys
if sys.version_info >= (3, 10):
from importlib.resources import contents
else:
from importlib_resources import contents
import pydrive2.files
cache_files = importlib.resources.contents(
cache_files = contents(
"googleapiclient.discovery_cache.documents"
)
assert len(cache_files) > 0
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"flake8-docstrings",
"pytest-mock",
"pyinstaller",
"importlib_resources; python_version < '3.10'",
]

tests_requirements.append("black==22.10.0")
Expand Down

0 comments on commit b95c953

Please sign in to comment.