Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/charonload/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import re
import site
import sys
import sysconfig
import tempfile
from dataclasses import dataclass
from typing import TYPE_CHECKING
Expand Down Expand Up @@ -218,8 +219,9 @@ def _find_stubs_directory(
return full_stubs_directory

def _exclude_install_directories(self: Self, directory: pathlib.Path) -> pathlib.Path | None:
install_directories = [site.getusersitepackages()] if site.ENABLE_USER_SITE else []
install_directories.extend(site.getsitepackages())
install_directories = [site.getuserbase()] if site.ENABLE_USER_SITE else []
install_directories.extend(sysconfig.get_paths().values())
install_directories = list(set(install_directories)) # Remove duplicates

return (
directory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

import charonload

PROJECT_ROOT_DIRECTORY = pathlib.Path(__file__).parent
PROJECT_ROOT_DIRECTORY = pathlib.Path(__file__).parents[2]

VSCODE_STUBS_DIRECTORY = PROJECT_ROOT_DIRECTORY / "typings"


charonload.module_config["_c_charonload_installed_project"] = charonload.Config(
pathlib.Path(__file__).parent / "_C",
build_directory=PROJECT_ROOT_DIRECTORY, # Intentionally do in-source build
stubs_directory=PROJECT_ROOT_DIRECTORY, # Similar to common in-source typings directory for VS Code
stubs_directory=VSCODE_STUBS_DIRECTORY, # Common in-source typings directory for VS Code
verbose=True,
)

Expand Down