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

"poetry config" command does not create path to config.toml in 1.0.0a4 #1179

Closed
3 tasks done
hozn opened this issue Jun 20, 2019 · 7 comments
Closed
3 tasks done

"poetry config" command does not create path to config.toml in 1.0.0a4 #1179

hozn opened this issue Jun 20, 2019 · 7 comments
Labels
kind/bug Something isn't working as expected

Comments

@hozn
Copy link

hozn commented Jun 20, 2019

  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: Ubuntu 18.04 w/ python3.7 (in docker container)
  • Poetry version: 1.0.0a4
  • Link of a Gist with the contents of your pyproject.toml file: N/A

Issue

The poetry config command does not auto create the path to the directory in latest preview version:

root@58ef10ebedba:/build# poetry --version
Poetry version 1.0.0a4
root@58ef10ebedba:/build# poetry config -vvv settings.virtualenvs.in-project true

[FileNotFoundError]
[Errno 2] No such file or directory: '/root/.config/pypoetry/config.toml'

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/clikit/console_application.py", line 131, in run
    status_code = command.handle(parsed_args, io)
  File "/usr/local/lib/python3.7/dist-packages/clikit/api/command/command.py", line 112, in handle
    status_code = self._do_handle(args, io)
  File "/usr/local/lib/python3.7/dist-packages/clikit/api/command/command.py", line 160, in _do_handle
    return getattr(handler, handler_method)(args, io, self)
  File "/usr/local/lib/python3.7/dist-packages/cleo/commands/command.py", line 92, in wrap_handle
    return self.handle()
  File "/usr/local/lib/python3.7/dist-packages/poetry/console/commands/config.py", line 152, in handle
    setting_key, unique_config_values[setting_key], values
  File "/usr/local/lib/python3.7/dist-packages/poetry/console/commands/config.py", line 240, in _handle_single_value
    self._settings_config.add_property(key, normalizer(value))
  File "/usr/local/lib/python3.7/dist-packages/poetry/config.py", line 65, in add_property
    self.dump()
  File "/usr/local/lib/python3.7/dist-packages/poetry/config.py", line 101, in dump
    fd = os.open(str(self._file), os.O_WRONLY | os.O_CREAT, mode)

This works fine in latest stable version:

root@4575f7467c4c:/build# poetry --version
Poetry 0.12.16
root@4575f7467c4c:/build# ls /root/.config
ls: cannot access '/root/.config': No such file or directory
root@4575f7467c4c:/build# poetry config settings.virtualenvs.in-project true
root@4575f7467c4c:/build# ls /root/.config
pypoetry
root@4575f7467c4c:/build# ls /root/.config/pypoetry
auth.toml  config.toml
root@4575f7467c4c:/build# cat /root/.config/pypoetry/config.toml
[settings]
[settings.virtualenvs]
in-project = true
@hozn
Copy link
Author

hozn commented Jun 20, 2019

I've tracked this down to a change in cleo's internal API. I'll attempt to submit a PR to fix this.

hozn added a commit to hozn/poetry that referenced this issue Jun 20, 2019
@M5oul
Copy link

M5oul commented Aug 4, 2019

This duplicate #1248 and #840.
Should be fixed by #1272.

@M5oul
Copy link

M5oul commented Aug 20, 2019

With 1.0.0a4, I just had to create ~/.config/pypoetry folder and the configuration was working.
With 1.0.0b1, I have to create the folder + create the file ~/.config/pypoetry/config.toml.

@brycedrennan brycedrennan added the kind/bug Something isn't working as expected label Aug 26, 2019
@brycedrennan
Copy link
Contributor

Can anyone confirm that #1324 fixed this?

@M5oul
Copy link

M5oul commented Aug 31, 2019

I tested it, it is fixed! I am looking forward for the next pre-release.

@brycedrennan
Copy link
Contributor

Great!

Copy link

github-actions bot commented Mar 3, 2024

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 Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

3 participants