Skip to content

Commit

Permalink
remove appdirs
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasdiener authored and inducer committed Apr 1, 2024
1 parent bdc9f4f commit c7a6f13
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
9 changes: 3 additions & 6 deletions pyopencl/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,19 +343,16 @@ def _create_built_program_from_source_cached(ctx, src, options_bytes,
from os.path import join

if cache_dir is None:
try:
import platformdirs as appdirs
except ImportError:
import appdirs
import platformdirs

# Determine the cache directory in the same way as pytools.PersistentDict,
# which PyOpenCL uses for invoker caches.
if sys.platform == "darwin" and os.getenv("XDG_CACHE_HOME") is not None:
# appdirs and platformdirs do not handle XDG_CACHE_HOME on macOS
# platformdirs does not handle XDG_CACHE_HOME on macOS
# https://github.com/platformdirs/platformdirs/issues/269
cache_dir = join(os.getenv("XDG_CACHE_HOME"), "pyopencl")
else:
cache_dir = appdirs.user_cache_dir("pyopencl", "pyopencl")
cache_dir = platformdirs.user_cache_dir("pyopencl", "pyopencl")

cache_dir = join(cache_dir,
"pyopencl-compiler-cache-v2-py{}".format(
Expand Down
3 changes: 0 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ exclude = (?x)(
pyopencl/compyte
)
[mypy-appdirs.*]
ignore_missing_imports = True
[mypy-IPython.*]
ignore_missing_imports = True
Expand Down

0 comments on commit c7a6f13

Please sign in to comment.