Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use XDG_CACHE_HOME for caching #1355

Closed
wants to merge 2 commits into from

Conversation

ssbarnea
Copy link
Member

XDG Base Directory Specification defines is a single base directory relative to which user-specific non-essential (cached) data should be written. This directory is defined by the environment variable $XDG_CACHE_HOME.

This commit change directories cookiecutter_replay and cookiecutters where cookiecutter stores its own data.

@insspb insspb added the WIP Work In Progress label Apr 14, 2020
@insspb
Copy link
Member

insspb commented Apr 14, 2020

Related #104

@insspb insspb added this to In progress in 1.7.1 Release via automation Apr 14, 2020
@ssbarnea ssbarnea changed the title WIP: Using XDG_CACHE_HOME Using XDG_CACHE_HOME Apr 14, 2020
@ssbarnea ssbarnea marked this pull request as ready for review April 14, 2020 12:59
[XDG Base Directory Specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) defines is a single base directory relative to which user-specific non-essential (cached) data should be written. This directory is defined by the environment variable $XDG_CACHE_HOME.

This commit change directories `cookiecutter_replay` and `cookiecutters` where cookiecutter stores its own data.
@ssbarnea
Copy link
Member Author

@insspb There is a problem with python2.7 32bit from appveyor which failed twice without any explanation. When I added the -v to pytest to increase verbosity, it worked.

I propose we keep the -v to see what happens in the future.

@ssbarnea ssbarnea requested a review from insspb April 14, 2020 14:21
@ssbarnea ssbarnea added enhancement This issue/PR relates to a feature request. and removed WIP Work In Progress labels Apr 14, 2020
@ssbarnea ssbarnea changed the title Using XDG_CACHE_HOME Use XDG_CACHE_HOME for caching Apr 14, 2020
@luzfcb
Copy link
Contributor

luzfcb commented Apr 14, 2020

I propose we keep the -v to see what happens in the future.

+1 to this idea.

@insspb
Copy link
Member

insspb commented Apr 14, 2020

@ssbarnea @luzfcb Agree with -v, about pull request, will review a little bit later.

@ssbarnea ssbarnea added this to the 1.8.0 milestone Apr 14, 2020
@ssbarnea ssbarnea removed this from In progress in 1.7.1 Release Apr 14, 2020
@ssbarnea
Copy link
Member Author

ssbarnea commented Apr 14, 2020

I removed this feature from 1.7.1 release because it is introduding a breaking change: the
new caching directory will be different.

My suggestion is that we should merge it just after we release 1.7.1

@insspb insspb added this to In progress in 1.8.0 Release via automation Apr 14, 2020
@insspb
Copy link
Member

insspb commented Apr 14, 2020

@insspb insspb mentioned this pull request Apr 14, 2020
@luzfcb
Copy link
Contributor

luzfcb commented Apr 14, 2020

Any manual test was made on Windows?

@ssbarnea
Copy link
Member Author

@luzfcb I am not a big fun of either manual-testing or Windows platform, so you are welcomed to take this challenge. The good part is that we do hae CI/CD running on Windows, and it did not fail.

Copy link
Member

@insspb insspb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ssbarnea

Issues in this PR:

  1. Tests write files to codebase directory, it looks like on screenshot.
    image

  2. I am not yet sure, but as far as I read using Pathlib path is more compatible between linux/windows/mac systems. Maybe we should migrate file operations to this module:

#1403

1.8.0 Release automation moved this from In progress to Pending approval May 26, 2020
@insspb insspb added the waiting-for-contributor Waiting for answer from original contributor. label May 26, 2020
@insspb insspb modified the milestones: 1.8.0, 2.0.0 May 26, 2020
@insspb insspb added this to In progress in File system related via automation May 28, 2020
@insspb
Copy link
Member

insspb commented May 29, 2020

@ssbarnea please check #971 for same ideas, but with external windows support

pgierz added a commit to pgierz/cookiecutter that referenced this pull request Jan 1, 2021
…s locations

This allows the ``cookiecutterrc`` file to be read from multiple places:

1) Environ variable ``${COOKIECUTTER_USER_CONFIG_PATH}``
2) ``${XDG_CONFIG_HOME}/cookiecutter/cookiecutterc``
3) ``${XDG_CONFIG_HOME}/cookiecutterrc``
4) ``${HOME}/.cookiecutterrc``

This allows the program to be more conform with the XDG standard.

Related: See also cookiecutter#1355, which has similar ideas for the cache
(``cookiecutters`` and ``cookiecutter_replay`` folders)
@RuRo
Copy link

RuRo commented Oct 21, 2021

Is this PR dead?

@ssbarnea
Copy link
Member Author

More or less. While I do not have time to work on it it worth nothing that there is an even older competing PR that tries to do almost the same.

I would keep it open until we have a fix merged. Once we have it merged, we can close the other pull requests.

@ssbarnea
Copy link
Member Author

Closing as dead, I hope someone will implement it.

@ssbarnea ssbarnea closed this Jan 28, 2023
File system related automation moved this from In progress to Closed/Declined Jan 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This issue/PR relates to a feature request. waiting-for-contributor Waiting for answer from original contributor.
Projects
File system related
  
Closed/Declined
1.8.0 Release
  
Pending approval
Development

Successfully merging this pull request may close these issues.

None yet

5 participants