Skip to content

Commit

Permalink
fixed locations.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mohan43u committed May 10, 2022
1 parent a028700 commit a2226bc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 74 deletions.
18 changes: 15 additions & 3 deletions src/poetry/locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,16 @@

logger = logging.getLogger(__name__)

CACHE_DIR = user_cache_path("pypoetry", appauthor=False)
CONFIG_DIR = user_config_path("pypoetry", appauthor=False, roaming=True)
CACHE_DIR = (
Path(os.path.join(os.environ["PROJECT_HOME"], ".cache"))
if sys.platform.startswith("linux") and "PROJECT_HOME" in os.environ
else user_cache_path("pypoetry", appauthor=False)
)
CONFIG_DIR = (
Path(os.path.join(os.environ["PROJECT_HOME"], ".config"))
if sys.platform.startswith("linux") and "PROJECT_HOME" in os.environ
else user_config_path("pypoetry", appauthor=False, roaming=True)
)

REPOSITORY_CACHE_DIR = CACHE_DIR / "cache" / "repositories"

Expand Down Expand Up @@ -44,4 +52,8 @@ def data_dir() -> Path:
if poetry_home:
return Path(poetry_home).expanduser()

return user_data_path("pypoetry", appauthor=False, roaming=True)
return (
Path(os.path.join(os.environ["PROJECT_HOME"], ".local/share"))
if sys.platform.startswith("linux") and "PROJECT_HOME" in os.environ
else user_data_path("pypoetry", appauthor=False, roaming=True)
)
71 changes: 0 additions & 71 deletions tests/utils/test_appdirs.py

This file was deleted.

0 comments on commit a2226bc

Please sign in to comment.