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

ValueError/TypeError with path dependency #454

Closed
3 tasks done
ghost opened this issue Sep 24, 2018 · 9 comments
Closed
3 tasks done

ValueError/TypeError with path dependency #454

ghost opened this issue Sep 24, 2018 · 9 comments
Labels
kind/bug Something isn't working as expected

Comments

@ghost
Copy link

ghost commented Sep 24, 2018

  • 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
  • Poetry version: 0.11.5
  • toml below

Issue

Note: the dependency uses setup.py and Pipfile/Pipfile.lock.

[tool.poetry]

name="my_demo"
version = "0.0.1"
description = ""
authors = ["me"]

[tool.poetry.dependencies]
python = "^3.6"

epype = {path = "/home/user/dotfiles/dotfiles/.emacs.d/python/epype"}
$ poetry lock -vvv
Using virtualenv: /home/user/.cache/pypoetry/virtualenvs/epype-py3.6
Updating dependencies
Resolving dependencies...
   1: fact: my-demo is 0.0.1
   1: derived: my-demo
   1: fact: my-demo depends on epype (0.0.1)
   1: selecting my-demo (0.0.1)
   1: derived: epype (0.0.1)
   1: selecting epype (0.0.1)
   1: Version solving took 0.004 seconds.
   1: Tried 1 solutions.

                                   
[ValueError]        
Invalid type <class 'NoneType'>  
                                   
Exception trace:
 /home/user/.envs/dotfiles-_bp8OBTv/lib/python3.6/site-packages/cleo/application.py in run() at line 94
   status_code = self.do_run(input_, output_)
 /home/user/.envs/dotfiles-_bp8OBTv/lib/python3.6/site-packages/poetry/console/application.py in do_run() at line 88
   return super(Application, self).do_run(i, o)
 /home/user/.envs/dotfiles-_bp8OBTv/lib/python3.6/site-packages/cleo/application.py in do_run() at line 197
   status_code = command.run(input_, output_)
 /home/user/.envs/dotfiles-_bp8OBTv/lib/python3.6/site-packages/poetry/console/commands/command.py in run() at line 77
   return super(BaseCommand, self).run(i, o)
 /home/user/.envs/dotfiles-_bp8OBTv/lib/python3.6/site-packages/cleo/commands/base_command.py in run() at line 146
   status_code = self.execute(input_, output_)
 /home/user/.envs/dotfiles-_bp8OBTv/lib/python3.6/site-packages/cleo/commands/command.py in execute() at line 107
   return self.handle()
 /home/user/.envs/dotfiles-_bp8OBTv/lib/python3.6/site-packages/poetry/console/commands/lock.py in handle() at line 33
   return installer.run()
 /home/user/.envs/dotfiles-_bp8OBTv/lib/python3.6/site-packages/poetry/installation/installer.py in run() at line 76
   self._do_install(local_repo)
 /home/user/.envs/dotfiles-_bp8OBTv/lib/python3.6/site-packages/poetry/installation/installer.py in _do_install() at line 277
   self._package, local_repo.packages
 /home/user/.envs/dotfiles-_bp8OBTv/lib/python3.6/site-packages/poetry/packages/locker.py in set_lock_data() at line 122
   lock["package"] = packages
 /home/user/.envs/dotfiles-_bp8OBTv/lib/python3.6/site-packages/tomlkit/container.py in __setitem__() at line 488
   self.append(key, value)
 /home/user/.envs/dotfiles-_bp8OBTv/lib/python3.6/site-packages/tomlkit/container.py in append() at line 90
   item = _item(item)
 /home/user/.envs/dotfiles-_bp8OBTv/lib/python3.6/site-packages/tomlkit/items.py in item() at line 55
   i = item(_v)
 /home/user/.envs/dotfiles-_bp8OBTv/lib/python3.6/site-packages/tomlkit/items.py in item() at line 77
   raise ValueError("Invalid type {}".format(type(value)))

lock
@songww
Copy link

songww commented Oct 10, 2018

Hello
Looks like exception raised when resolve dependencies of /home/user/dotfiles/dotfiles/.emacs.d/python/epype.

@ghost
Copy link
Author

ghost commented Oct 10, 2018

I switched epype to use poetry instead of setup.py and that worked, but I wish the error could be more informative. I still don't know what the problem was.

@bryanforbes
Copy link
Contributor

I hit this issue with a git package I was using. I traced it down to the package not having a description in its setup.py. It ended up as None coming out of pkginfo.UnpackedSDist in puzzle/provider.py and then when the package info is passed to a TomlDocument in packages/locker.py it raises an error because TomlDocument doesn't handle None.

@sdispater If you could give me a hint as to how to fix this, I could take a stab at it. I'm not sure how exactly None should be handled in these cases.

@sdispater
Copy link
Member

@bryanforbes I think that this is something that should be handled by TOMLKit. None (and its TOML equivalent null) is valid and should be properly handled.

@bryanforbes
Copy link
Contributor

As I understand it, TOML doesn't have null. The suggestion from the TOML spec writers is to leave out the line.

@sdispater
Copy link
Member

I thought there was support for null in TOML, my bad.

So, I think it should be handled in the locker: leave the description line out if it's null and handle the absence of description when loading data from the lock file.

@sdispater sdispater added the kind/bug Something isn't working as expected label Dec 12, 2018
@bryanforbes
Copy link
Contributor

As I think about this more, I think TOMLKit should ignore None instead of raising an error (which would leave that key out of the toml file) and then the locker should handle the absence of description (or any other keys) when loading the data.

@sdispater
Copy link
Member

This should be fixed in the latest 0.12.11 release.

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

Successfully merging a pull request may close this issue.

3 participants