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

How to move configuration? #6854

Closed
BeyondEvil opened this issue Oct 21, 2022 · 16 comments
Closed

How to move configuration? #6854

BeyondEvil opened this issue Oct 21, 2022 · 16 comments
Labels
kind/question User questions (candidates for conversion to discussion)

Comments

@BeyondEvil
Copy link

❯ poetry
Configuration file exists at /Users/jimbrannlund/Library/Application Support/pypoetry, reusing this directory.

Consider moving configuration to /Users/jimbrannlund/Library/Preferences/pypoetry, as support for the legacy directory will be removed in an upcoming release.
Poetry (version 1.2.2)
❯ cp -R /Users/jimbrannlund/Library/Application\ Support/pypoetry/ /Users/jimbrannlund/Library/Preferences/pypoetry
❯ mv /Users/jimbrannlund/Library/Application\ Support/pypoetry /Users/jimbrannlund/Library/Application\ Support/ppp
❯ poetry         
zsh: command not found: poetry
❯ uname -a                                                                                                         
Darwin F8-4D-89-71-75-73 21.4.0 Darwin Kernel Version 21.4.0: Mon Feb 21 20:35:58 PST 2022; root:xnu-8020.101.4~2/RELEASE_ARM64_T6000 arm64

Originally installed via the official installer and updated via poetry self update.

@BeyondEvil BeyondEvil added area/docs Documentation issues/improvements status/triage This issue needs to be triaged labels Oct 21, 2022
@BeyondEvil
Copy link
Author

To fix I had to update the symbolic link under the new directory ~/Library/Preferences/pypoetry:

sh
❯ ls -la ~/Library/Preferences/pypoetry
total 16
drwxr-xr-x    6 jimbrannlund  staff   192 Oct 21 01:57 .
drwx------+ 271 jimbrannlund  staff  8672 Oct 21 02:04 ..
-rw-r--r--    1 jimbrannlund  staff     6 Oct 21 01:39 VERSION
-rw-------    1 jimbrannlund  staff   111 Oct 21 01:39 config.toml
lrwxr-xr-x    1 jimbrannlund  staff    64 Oct 21 01:57 poetry -> /Users/jimbrannlund/Library/Preferences/pypoetry/venv/bin/poetry
drwxr-xr-x    7 jimbrannlund  staff   224 Oct 21 01:39 venv

and under .local/bin:

❯ ls -la ~/.local/bin
lrwxr-xr-x   1 jimbrannlund  staff    64 Oct 21 02:00 poetry -> /Users/jimbrannlund/Library/Preferences/pypoetry/venv/bin/poetry

Be nice to have a function perform these steps for you. 😊

@neersighted neersighted added kind/question User questions (candidates for conversion to discussion) and removed area/docs Documentation issues/improvements status/triage This issue needs to be triaged labels Oct 21, 2022
@neersighted
Copy link
Member

Only the TOML files need to move -- Poetry broke because you moved the installation out from under it. We could introduce an automatic rename, but at the time the relocation was introduced there was an outcry against automatically moving a user's files. We might want to revisit that discussion.

@BeyondEvil
Copy link
Author

Oh, I see, so only TOML needs to live under Preferences? The rest stays under Application Support?

@neersighted
Copy link
Member

Correct!

@dariobig
Copy link

lots of words, but if I understand it correctly all that needs to be done is:

mv /Users/$USER/Library/Application\ Support/pypoetry/config.toml /Users/$USER/Library/Preferences/pypoetry

@jacklj
Copy link

jacklj commented Mar 8, 2023

@dariobig I think there's a typo 🙂, it should be:

mv /Users/$USER/Library/Application\ Support/pypoetry/config.toml /Users/$USER/Library/Preferences/pypoetry/config.toml

@slhck
Copy link

slhck commented May 22, 2023

Shouldn't this be the exact opposite? For me Poetry 1.3.1 says:

Configuration file exists at /Users/werner/Library/Preferences/pypoetry, reusing this directory.
Consider moving TOML configuration files to /Users/werner/Library/Application Support/pypoetry ...

So the mv arguments should be swapped:

mkdir -p /Users/$USER/Library/Application\ Support/pypoetry
mv /Users/$USER/Library/Preferences/pypoetry/config.toml /Users/$USER/Library/Application\ Support/pypoetry/config.toml

That said, this really should be automated, or at least semi-automated, e.g. by printing the commands the user should run manually.

@lorenzwalthert
Copy link

@slhck with poetry 1.5, I also get that warning, and upon moving, changing a setting like

poetry config virtualenvs.options.no-setuptools false      

I get the warning again. I had to delete the whole directory in /Users/$USER/Library/Preferences/pypoetry to make the warning go away (not sure that has unintended side effects!).

@dimbleby
Copy link
Contributor

flip-flopping is inherited from the platformdirs project, which preferred one thing in its 1.0 release, then another thing in its 2.0 release, and then reverted to the 1.0 behaviour in its 3.0 release.

Hopefully they've settled on the right answer now and you should just be able to do whatever it is that poetry 1.5 says.

@slhck
Copy link

slhck commented May 22, 2023

I see, thanks. I ended up removing the config and reinstalling poetry completely.

@ajatkj
Copy link

ajatkj commented May 27, 2023

I just moved config.toml from ~/Users/Preferences/pypoetry to ~/Users/Library/Application Support/pypoetry and it worked.

@xshapira
Copy link

xshapira commented Jun 4, 2023

@slhck Thank you!

This worked perfectly with Poetry 1.5.0:

mkdir -p /Users/$USER/Library/Application\ Support/pypoetry
mv /Users/$USER/Library/Preferences/pypoetry/config.toml /Users/$USER/Library/Application\ Support/pypoetry/config.toml

@camerondavison
Copy link

I had to do

mkdir -p "${HOME}/Library/Application Support/pypoetry/"
mv "${HOME}/Library/Preferences/pypoetry/"*.toml "${HOME}/Library/Application Support/pypoetry/"

I think that it would be nice to either prompt every once in a while or provide some command that would do the move for people. Then just say run "poetry self move-config" or something like that so that people do not have to search through github to figure out what they are supposed to do.

@hughperkins
Copy link

To save anyone else having to read through this llooonnnggg thread, note that I tried @camerondavison 's approach, and that worked for me.

Before using his approach:
Screenshot 2023-12-24 at 04 14 09

After using his approach:
Screenshot 2023-12-24 at 04 14 13

@hughperkins
Copy link

hughperkins commented Dec 24, 2023

PS I agree with @camerondavison 's ideas of "I think that it would be nice to either prompt every once in a while or provide some command that would do the move for people. Then just say run "poetry self move-config" or something like that so that people do not have to search through github to figure out what they are supposed to do.".

I've created an issue for this at #8818

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/question User questions (candidates for conversion to discussion)
Projects
None yet
Development

No branches or pull requests