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
4aa6b170
Unverified
Commit
4aa6b170
authored
Mar 03, 2018
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert layout to not use TOMLFile for now
parent
d7ad5b04
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
+18
-9
poetry/layouts/layout.py
+18
-9
No files found.
poetry/layouts/layout.py
View file @
4aa6b170
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
import
re
import
re
from
poetry.toml.toml_file
import
TOMLFile
import
toml
from
poetry.utils.toml_file
import
TomlFile
from
poetry.vcs.git
import
Git
from
poetry.vcs.git
import
Git
_canonicalize_regex
=
re
.
compile
(
r"[-_.]+"
)
_canonicalize_regex
=
re
.
compile
(
r"[-_.]+"
)
...
@@ -89,20 +89,29 @@ class Layout(object):
...
@@ -89,20 +89,29 @@ class Layout(object):
)
)
def
_write_poetry
(
self
,
path
):
def
_write_poetry
(
self
,
path
):
toml
=
TOMLFile
([])
output
=
{
toml
[
'package'
]
=
{
'package'
:
{
'name'
:
self
.
_project
,
'name'
:
self
.
_project
,
'version'
:
self
.
_version
,
'version'
:
self
.
_version
,
'authors'
:
[
self
.
_author
],
'authors'
:
[
self
.
_author
],
}
}
toml
[
'dependencies'
]
=
{}
toml
[
'dev-dependencies'
]
=
{
'pytest'
:
'^3.4'
,
}
}
poetry
=
TomlFile
(
path
/
'poetry.toml'
)
content
=
toml
.
dumps
(
output
,
preserve
=
True
)
output
=
{
'dependencies'
:
{},
'dev-dependencies'
:
{
'pytest'
:
'^3.4'
}
}
content
+=
'
\n
'
+
toml
.
dumps
(
output
,
preserve
=
True
)
poetry
=
path
/
'poetry.toml'
poetry
.
write
(
toml
)
with
poetry
.
open
(
'w'
)
as
f
:
f
.
write
(
content
)
def
_canonicalize_name
(
self
,
name
:
str
)
->
str
:
def
_canonicalize_name
(
self
,
name
:
str
)
->
str
:
return
_canonicalize_regex
.
sub
(
"-"
,
name
)
.
lower
()
return
_canonicalize_regex
.
sub
(
"-"
,
name
)
.
lower
()
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