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
b9bac10a
Unverified
Commit
b9bac10a
authored
Jun 27, 2018
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix config command
parent
0f0558f9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
6 deletions
+11
-6
poetry/console/commands/config.py
+6
-4
pyproject.toml
+3
-2
tests/console/commands/test_config.py
+2
-0
No files found.
poetry/console/commands/config.py
View file @
b9bac10a
...
...
@@ -64,18 +64,20 @@ To remove a repository (repo is a short alias for repositories):
return
unique_config_values
def
initialize
(
self
,
i
,
o
):
from
poetry.utils._compat
import
decode
super
(
ConfigCommand
,
self
)
.
initialize
(
i
,
o
)
# Create config file if it does not exist
if
not
self
.
_config
.
file
.
exists
():
self
.
_config
.
file
.
parent
.
mkdir
(
parents
=
True
,
exist_ok
=
True
)
with
self
.
_config
.
file
.
open
(
"w"
)
as
f
:
f
.
write
(
TEMPLATE
)
with
self
.
_config
.
file
.
open
(
"w"
,
encoding
=
"utf-8"
)
as
f
:
f
.
write
(
decode
(
TEMPLATE
)
)
if
not
self
.
_auth_config
.
file
.
exists
():
self
.
_auth_config
.
file
.
parent
.
mkdir
(
parents
=
True
,
exist_ok
=
True
)
with
self
.
_auth_config
.
file
.
open
(
"w"
)
as
f
:
f
.
write
(
AUTH_TEMPLATE
)
with
self
.
_auth_config
.
file
.
open
(
"w"
,
encoding
=
"utf-8"
)
as
f
:
f
.
write
(
decode
(
AUTH_TEMPLATE
)
)
def
handle
(
self
):
if
self
.
option
(
"list"
):
...
...
pyproject.toml
View file @
b9bac10a
...
...
@@ -39,8 +39,9 @@ shellingham = "^1.1"
# The typing module is not in the stdlib in Python 2.7 and 3.4
typing
=
{
version
=
"^3.6"
,
python
=
"~2.7 || ~3.4"
}
# Use pathlib2 and virtualenv for Python 2.7
pathlib2
=
{
version
=
"^2.3"
,
python
=
"~2.7"
}
# Use pathlib2 for Python 2.7 and 3.4
pathlib2
=
{
version
=
"^2.3"
,
python
=
"~2.7 || ~3.4"
}
# Use virtualenv for Python 2.7 since venv does not exist
virtualenv
=
{
version
=
"^16.0"
,
python
=
"~2.7"
}
[tool.poetry.dev-dependencies]
...
...
tests/console/commands/test_config.py
View file @
b9bac10a
...
...
@@ -11,6 +11,8 @@ from poetry.utils.toml_file import TomlFile
@pytest.fixture
def
config
():
with
tempfile
.
NamedTemporaryFile
()
as
f
:
f
.
close
()
return
Config
(
TomlFile
(
f
.
name
))
...
...
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