Commit 99f62087 by Sébastien Eustace

Add license validation in init command

parent 13dfae49
......@@ -5,6 +5,7 @@
### Added
- Added support for `packages`, `include` and `exclude` properties.
- Added license validation in `init` command.
### Changed
......
......@@ -98,7 +98,7 @@ The <info>init</info> command creates a basic <comment>pyproject.toml</> file in
question = self.create_question(
"License [<comment>{}</comment>]: ".format(license), default=license
)
question.validator = self._validate_license
license = self.ask(question)
question = self.create_question("Compatible Python versions [*]: ", default="*")
......@@ -293,6 +293,13 @@ The <info>init</info> command creates a basic <comment>pyproject.toml</> file in
return author
def _validate_license(self, license):
from poetry.spdx import license_by_id
license_by_id(license)
return license
def _get_pool(self):
from poetry.repositories import Pool
from poetry.repositories.pypi_repository import PyPiRepository
......
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