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

Improvement: Follow XDG config spec #1789

Open
1 task done
thernstig opened this issue Jan 24, 2021 · 7 comments
Open
1 task done

Improvement: Follow XDG config spec #1789

thernstig opened this issue Jan 24, 2021 · 7 comments

Comments

@thernstig
Copy link

thernstig commented Jan 24, 2021

An old issus was closed regarding XDG: #139 - but that was 7 years ago now. Since then the XDG spec have become much more predominant. Many common tools follow it.

This issue is created to re-evaluate where pyenv is installed by default, using the XDG config and data dirs as appropriate. This gives a cleaner home directory for users, and users will also know that files placed in $XDG_CONFIG_HOME or the default $HOME/.config, are files that I as a user can manually update. And then also sync via dotfiles between machines, if wanted.

Prerequisite

  • [ x] Make sure your problem is not listed in the common build problems.
  • [ x] Make sure no duplicated issue has already been reported in the pyenv issues. You should look for closed issues, too.
  • [x ] Make sure you are not asking us to help solving your specific issue.
    • GitHub issues is opened mainly for development purposes. If you want to ask someone to help solving your problem, go to some community site like Gitter, StackOverflow, etc.
  • [x ] Make sure your problem is not derived from packaging (e.g. Homebrew).
    • Please refer to the package documentation for the installation issues, etc.
  • [x ] Make sure your problem is not derived from plugins.
    • This repository is maintaining pyenv and the default python-build plugin only. Please refrain from reporting issues of other plugins here.

Description

  • [ x] Platform information (e.g. Ubuntu Linux 16.04): Ubuntu 20.04
  • [ x] OS architecture (e.g. amd64): amd64
  • [ x] pyenv version: 1.2.22
  • [ x] Python version: 3.8.7
  • [ x] C Compiler information (e.g. gcc 7.3): 9.3
  • Please attach verbose build log as gist
    • You can turn on verbose debug logging using by setting PYENV_DEBUG=1, e.g. env PYENV_DEBUG=1 pyenv install -v 3.6.4
@native-api
Copy link
Member

native-api commented Mar 10, 2021

I don't see anything in https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html about software installed per-user which Pyenv is in the stock setup as are its Python installations.
So that spec doesn't apply to it AFAICS.

@thernstig
Copy link
Author

XDG_DATA_HOME is used for this, at least in other tools I use. Quick example: https://github.com/jorgebucaran/nvm.fish

@native-api
Copy link
Member

share is for platform-independent data (thus the name "share" i.e. shared between architectures). Python is platform-dependent.

@thernstig
Copy link
Author

There are plenty of tools that are platform-dependent tools using the XDG config spec. The spec was made for per-user tools, so I am pretty sure the smart guys who made this thought of this.

@native-api
Copy link
Member

native-api commented May 7, 2021

Having read https://bbs.archlinux.org/viewtopic.php?id=227166 which explains how XDG relates to the FHS, it's clear that installed software is outside of XDG and paths to it are pointed to by other envvars:

~/.local/bin ← PATH
~/.local/etc ← XDG_CONFIG_HOME
~/.local/include
~/.local/lib ← LD_LIBRARY_PATH
~/.local/opt
~/.local/share ← XDG_DATA_DIRS
~/.local/srv
~/.local/var/cache ← XDG_CACHE_HOME
~/.local/var/lib ← XDG_DATA_HOME
~/.local/var/log ← XDG_LOG_HOME (not standard, but I set and use it anyway)


Pyenv uses the /opt approarch -- because it allows to manage an installation and allow multiple side-by-side installations without a package manager. Placing stuff under a shared location wouldn't allow that.

So it anything, it should be moved to ~/.local/opt.

@thernstig
Copy link
Author

I am fine with that, as long as it does not clutter up the space directly under the home directory. Most Linux tools out there have moved into the XDG_CONFIG_SPEC and comparing the home directory to a few years ago, it is much cleaner in this regard.

@native-api
Copy link
Member

native-api commented May 7, 2021

Feel free to submit a PR to change the default installation directory and link to this discussion.

https://github.com/pyenv/pyenv-installer will need a PR to do the same as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants