Commit f0bb4970 by Sébastien Eustace

Fix init and add commands

parent e89ad9af
......@@ -5,6 +5,7 @@
### Fixed
- Fixed packages not found for prerelease version constraints when resolving dependencies.
- Fixed `init` and `add` commands.
## [0.10.0] - 2018-05-28
......
......@@ -29,6 +29,9 @@ If you do not specify a version constraint, poetry will choose a suitable one ba
'poetry.repositories.pypi_repository'
]
def initialize(self, i, o):
super(AddCommand, self).initialize(i, o)
def handle(self):
from poetry.installation import Installer
from poetry.semver import parse_constraint
......
......@@ -33,6 +33,16 @@ The <info>init</info> command creates a basic <comment>pyproject.toml</> file in
self.pool = None
def initialize(self, i, o):
from poetry.repositories import Pool
from poetry.repositories.pypi_repository import PyPiRepository
super(InitCommand, self).initialize(i, o)
if self.pool is None:
self.pool = Pool()
self.pool.add_repository(PyPiRepository())
def handle(self):
from poetry.layouts import layout
from poetry.utils._compat import Path
......
......@@ -88,7 +88,10 @@ class PyPiRepository(Repository):
"""
Find packages on the remote server.
"""
if constraint is not None and not isinstance(constraint, VersionConstraint):
if constraint is None:
constraint = '*'
if not isinstance(constraint, VersionConstraint):
constraint = parse_constraint(constraint)
info = self.get_package_info(name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment