Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
python-poetry
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
python-poetry
Commits
99f62087
Unverified
Commit
99f62087
authored
Jun 19, 2018
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add license validation in init command
parent
13dfae49
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
CHANGELOG.md
+1
-0
poetry/console/commands/init.py
+9
-2
No files found.
CHANGELOG.md
View file @
99f62087
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
### Added
### Added
-
Added support for
`packages`
,
`include`
and
`exclude`
properties.
-
Added support for
`packages`
,
`include`
and
`exclude`
properties.
-
Added license validation in
`init`
command.
### Changed
### Changed
...
...
poetry/console/commands/init.py
View file @
99f62087
...
@@ -26,7 +26,7 @@ class InitCommand(Command):
...
@@ -26,7 +26,7 @@ class InitCommand(Command):
"""
"""
help
=
"""
\
help
=
"""
\
The <info>init</info> command creates a basic <comment>pyproject.toml</> file in the current directory.
The <info>init</info> command creates a basic <comment>pyproject.toml</> file in the current directory.
"""
"""
def
__init__
(
self
):
def
__init__
(
self
):
...
@@ -98,7 +98,7 @@ The <info>init</info> command creates a basic <comment>pyproject.toml</> file in
...
@@ -98,7 +98,7 @@ The <info>init</info> command creates a basic <comment>pyproject.toml</> file in
question
=
self
.
create_question
(
question
=
self
.
create_question
(
"License [<comment>{}</comment>]: "
.
format
(
license
),
default
=
license
"License [<comment>{}</comment>]: "
.
format
(
license
),
default
=
license
)
)
question
.
validator
=
self
.
_validate_license
license
=
self
.
ask
(
question
)
license
=
self
.
ask
(
question
)
question
=
self
.
create_question
(
"Compatible Python versions [*]: "
,
default
=
"*"
)
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
...
@@ -293,6 +293,13 @@ The <info>init</info> command creates a basic <comment>pyproject.toml</> file in
return
author
return
author
def
_validate_license
(
self
,
license
):
from
poetry.spdx
import
license_by_id
license_by_id
(
license
)
return
license
def
_get_pool
(
self
):
def
_get_pool
(
self
):
from
poetry.repositories
import
Pool
from
poetry.repositories
import
Pool
from
poetry.repositories.pypi_repository
import
PyPiRepository
from
poetry.repositories.pypi_repository
import
PyPiRepository
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment