poetry add mojimoji fails

Created on 8 Oct 2019  路  8Comments  路  Source: python-poetry/poetry

  • [x] I am on the latest Poetry version.
  • [x] I have searched the issues of this repo and believe that this is not a duplicate.
  • [x] If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name:

Mac OS X 10.14.6

  • Poetry version:

0.12.17

  • Link of a Gist with the contents of your pyproject.toml file:

https://gist.github.com/tamuhey/a2f03a72a4cb9b6e5b8b6cfd3c72a0fe

Issue

command:

$ poetry add mojimoji -vvv

fails. The error shown:

Using virtualenv: /Users/my_name/work/foo/.venv
PyPI: 9 packages found for mojimoji *
Using version ^0.0.9 for mojimoji

Updating dependencies
Resolving dependencies...
   1: fact: foo is 0.1.0
   1: derived: foo
   1: fact: foo depends on mojimoji (^0.0.9)
   1: selecting foo (0.1.0)
   1: derived: mojimoji (^0.0.9)
PyPI: 1 packages found for mojimoji >=0.0.9,<0.0.10
   1: selecting mojimoji (0.0.9)
   1: Version solving took 0.008 seconds.
   1: Tried 1 solutions.


Package operations: 1 install, 0 updates, 0 removals

  - Installing mojimoji (0.0.9)

[EnvCommandError]                                                                                                                                  
Command ['/Users/my_name/work/foo/.venv/bin/python', '-m', 'pip', 'install', '--no-deps', 'mojimoji==0.0.9'] errored with the following return code 1, and output:           
Collecting mojimoji==0.0.9                                                                                                                                      
  Could not find a version that satisfies the requirement mojimoji==0.0.9 (from versions: 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.0.6, 0.0.7, 0.0.8, 0.0.9.post0)  
No matching distribution found for mojimoji==0.0.9                                                                                                              
You are using pip version 19.0.3, however version 19.2.3 is available.                                                                                          
You should consider upgrading via the 'pip install --upgrade pip' command.                                                                                      

Exception trace:
 /Users/my_name/.poetry/lib/poetry/_vendor/py3.7/cleo/application.py in run() at line 94
   status_code = self.do_run(input_, output_)
 /Users/my_name/.poetry/lib/poetry/console/application.py in do_run() at line 88
   return super(Application, self).do_run(i, o)
 /Users/my_name/.poetry/lib/poetry/_vendor/py3.7/cleo/application.py in do_run() at line 197
   status_code = command.run(input_, output_)
 /Users/my_name/.poetry/lib/poetry/console/commands/command.py in run() at line 77
   return super(BaseCommand, self).run(i, o)
 /Users/my_name/.poetry/lib/poetry/_vendor/py3.7/cleo/commands/base_command.py in run() at line 146
   status_code = self.execute(input_, output_)
 /Users/my_name/.poetry/lib/poetry/_vendor/py3.7/cleo/commands/command.py in execute() at line 107
   return self.handle()
 /Users/my_name/.poetry/lib/poetry/console/commands/add.py in handle() at line 139
   status = installer.run()
 /Users/my_name/.poetry/lib/poetry/installation/installer.py in run() at line 73
   self._do_install(local_repo)
 /Users/my_name/.poetry/lib/poetry/installation/installer.py in _do_install() at line 290
   self._execute(op)
 /Users/my_name/.poetry/lib/poetry/installation/installer.py in _execute() at line 306
   getattr(self, "_execute_{}".format(method))(operation)
 /Users/my_name/.poetry/lib/poetry/installation/installer.py in _execute_install() at line 331
   self._installer.install(operation.package)
 /Users/my_name/.poetry/lib/poetry/installation/pip_installer.py in install() at line 91
   self.run(*args)
 /Users/my_name/.poetry/lib/poetry/installation/pip_installer.py in run() at line 112
   return self._env.run("python", "-m", "pip", *args, **kwargs)
 /Users/my_name/.poetry/lib/poetry/utils/env.py in run() at line 539
   return super(VirtualEnv, self).run(bin, *args, **kwargs)
 /Users/my_name/.poetry/lib/poetry/utils/env.py in run() at line 388
   raise EnvCommandError(e, input=input_)

add [-D|--dev] [--git GIT] [--path PATH] [-E|--extras EXTRAS] [--optional] [--python PYTHON] [--platform PLATFORM] [--allow-prereleases] [--dry-run] [--] <name> (<name>)...

Bug stale

All 8 comments

Poetry resolves your dependency of mojimoji = "^0.0.9" into version 0.0.9, then it tries to run pip install mojimoji==0.0.9.

The name of the source distribution file on PyPI was mojimoji-0.0.9.post0.tar.gz which is not semver compliant name (I think the publisher meant to use 0.0.9-post0 ?). Anyway, 0.0.9.post0 and 0.0.9 are not equal for pip, so the package fails to install.

If you are fine with using version 0.0.8 of the package for now, you can run poetry add mojimoji==0.0.8 instead.

@0916dhkim Thanks!
pipenv can install this package, so I want to fix this case.

Hello @0916dhkim,

0.0.9.post0 is a PEP-440-compliant post-release version.

Parsing version strings with regular expressions

>>> import re
>>> def is_canonical(version):
...     return re.match(r'^([1-9][0-9]*!)?(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))*((a|b|rc)(0|[1-9][0-9]*))?(\.post(0|[1-9][0-9]*))?(\.dev(0|[1-9][0-9]*))?$', version) is not None
... 
>>> is_canonical('0.0.9.post0')
True

@tamuhey Yes, I can confirm that mojimoji = "~=0.0.9" matches 0.0.9.post0 with pipenv. This is strange.

@Jamim Sorry, I did not know about PEP-440. So do you think this is a glitch in Poetry's constraint checking mechanism?

So do you think this is a glitch in Poetry's constraint checking mechanism?

It seems so.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Use mojimoji2 instead of mojimoji.

Was this page helpful?
0 / 5 - 0 ratings