Skip to content

Commit

Permalink
Merge pull request #1636 from ErikDanielsson/changes-cache-dir
Browse files Browse the repository at this point in the history
Change base cache dir
  • Loading branch information
ewels authored Jun 21, 2022
2 parents bc88269 + 9bb817a commit 67fae3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Add `--fail-warned` flag to pipeline linting workflow ([#1593](https://github.com/nf-core/tools/pull/1593))
- Updated the package requirements to prevent defunct installations of nf-core ([#1620](https://github.com/nf-core/tools/pull/1620))
- Fix and improve broken test for Singularity container download ([#1622](https://github.com/nf-core/tools/pull/1622))
- Use [`$XDG_CACHE_HOME`](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) or `~/.cache` instead of `$XDG_CONFIG_HOME` or `~/config/` as base directory for API cache

### Modules

Expand Down
6 changes: 3 additions & 3 deletions nf_core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
]
)

NFCORE_CONFIG_DIR = os.path.join(
os.environ.get("XDG_CONFIG_HOME", os.path.join(os.getenv("HOME"), ".config")),
NFCORE_CACHE_DIR = os.path.join(
os.environ.get("XDG_CACHE_HOME", os.path.join(os.getenv("HOME"), ".cache")),
"nf-core",
)

Expand Down Expand Up @@ -308,7 +308,7 @@ def setup_requests_cachedir():
Also returns the config dict so that we can use the same setup with a Session.
"""
pyversion = ".".join(str(v) for v in sys.version_info[0:3])
cachedir = os.path.join(NFCORE_CONFIG_DIR, f"cache_{pyversion}")
cachedir = os.path.join(NFCORE_CACHE_DIR, f"cache_{pyversion}")

config = {
"cache_name": os.path.join(cachedir, "github_info"),
Expand Down

0 comments on commit 67fae3b

Please sign in to comment.