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
159123f3
Commit
159123f3
authored
Jun 24, 2019
by
Brian Turek
Committed by
Steph Samson
Jun 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for maintainers setting in pyproject.toml (#1175)
parent
964d004b
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
66 additions
and
2 deletions
+66
-2
docs/docs/pyproject.md
+6
-0
poetry/json/schemas/poetry-schema.json
+10
-0
poetry/masonry/builders/builder.py
+8
-0
poetry/masonry/builders/sdist.py
+4
-0
poetry/masonry/metadata.py
+2
-2
poetry/packages/package.py
+24
-0
poetry/poetry.py
+3
-0
tests/masonry/builders/fixtures/complete/pyproject.toml
+3
-0
tests/masonry/builders/test_complete.py
+4
-0
tests/masonry/test_api.py
+2
-0
No files found.
docs/docs/pyproject.md
View file @
159123f3
...
@@ -46,6 +46,12 @@ The authors of the package. **Required**
...
@@ -46,6 +46,12 @@ The authors of the package. **Required**
This is a list of authors and should contain at least one author. Authors must be in the form
`name <email>`
.
This is a list of authors and should contain at least one author. Authors must be in the form
`name <email>`
.
## maintainers
The maintainers of the package.
**Optional**
This is a list of maintainers and should be distinct from authors. Maintainers may contain an email and be in the form
`name <email>`
.
## readme
## readme
The readme file of the package.
**Optional**
The readme file of the package.
**Optional**
...
...
poetry/json/schemas/poetry-schema.json
View file @
159123f3
...
@@ -50,6 +50,9 @@
...
@@ -50,6 +50,9 @@
"authors"
:
{
"authors"
:
{
"$ref"
:
"#/definitions/authors"
"$ref"
:
"#/definitions/authors"
},
},
"maintainers"
:
{
"$ref"
:
"#/definitions/maintainers"
},
"readme"
:
{
"readme"
:
{
"type"
:
"string"
,
"type"
:
"string"
,
"description"
:
"The path to the README file"
"description"
:
"The path to the README file"
...
@@ -180,6 +183,13 @@
...
@@ -180,6 +183,13 @@
"type"
:
"string"
"type"
:
"string"
}
}
},
},
"maintainers"
:
{
"type"
:
"array"
,
"description"
:
"List of maintainers, other than the original author(s), that upkeep the package."
,
"items"
:
{
"type"
:
"string"
}
},
"dependencies"
:
{
"dependencies"
:
{
"type"
:
"object"
,
"type"
:
"object"
,
"patternProperties"
:
{
"patternProperties"
:
{
...
...
poetry/masonry/builders/builder.py
View file @
159123f3
...
@@ -178,6 +178,14 @@ class Builder(object):
...
@@ -178,6 +178,14 @@ class Builder(object):
if
self
.
_meta
.
author_email
:
if
self
.
_meta
.
author_email
:
content
+=
"Author-email: {}
\n
"
.
format
(
to_str
(
self
.
_meta
.
author_email
))
content
+=
"Author-email: {}
\n
"
.
format
(
to_str
(
self
.
_meta
.
author_email
))
if
self
.
_meta
.
maintainer
:
content
+=
"Maintainer: {}
\n
"
.
format
(
to_str
(
self
.
_meta
.
maintainer
))
if
self
.
_meta
.
maintainer_email
:
content
+=
"Maintainer-email: {}
\n
"
.
format
(
to_str
(
self
.
_meta
.
maintainer_email
)
)
if
self
.
_meta
.
requires_python
:
if
self
.
_meta
.
requires_python
:
content
+=
"Requires-Python: {}
\n
"
.
format
(
self
.
_meta
.
requires_python
)
content
+=
"Requires-Python: {}
\n
"
.
format
(
self
.
_meta
.
requires_python
)
...
...
poetry/masonry/builders/sdist.py
View file @
159123f3
...
@@ -32,6 +32,8 @@ setup_kwargs = {{
...
@@ -32,6 +32,8 @@ setup_kwargs = {{
'long_description': {long_description!r},
'long_description': {long_description!r},
'author': {author!r},
'author': {author!r},
'author_email': {author_email!r},
'author_email': {author_email!r},
'maintainer': {maintainer!r},
'maintainer_email': {maintainer_email!r},
'url': {url!r},
'url': {url!r},
{extra}
{extra}
}}
}}
...
@@ -180,6 +182,8 @@ class SdistBuilder(Builder):
...
@@ -180,6 +182,8 @@ class SdistBuilder(Builder):
long_description
=
to_str
(
self
.
_meta
.
description
),
long_description
=
to_str
(
self
.
_meta
.
description
),
author
=
to_str
(
self
.
_meta
.
author
),
author
=
to_str
(
self
.
_meta
.
author
),
author_email
=
to_str
(
self
.
_meta
.
author_email
),
author_email
=
to_str
(
self
.
_meta
.
author_email
),
maintainer
=
to_str
(
self
.
_meta
.
maintainer
),
maintainer_email
=
to_str
(
self
.
_meta
.
maintainer_email
),
url
=
to_str
(
self
.
_meta
.
home_page
),
url
=
to_str
(
self
.
_meta
.
home_page
),
extra
=
"
\n
"
.
join
(
extra
),
extra
=
"
\n
"
.
join
(
extra
),
after
=
"
\n
"
.
join
(
after
),
after
=
"
\n
"
.
join
(
after
),
...
...
poetry/masonry/metadata.py
View file @
159123f3
...
@@ -60,8 +60,8 @@ class Metadata:
...
@@ -60,8 +60,8 @@ class Metadata:
meta
.
classifiers
=
package
.
all_classifiers
meta
.
classifiers
=
package
.
all_classifiers
# Version 1.2
# Version 1.2
meta
.
maintainer
=
meta
.
author
meta
.
maintainer
=
package
.
maintainer_name
meta
.
maintainer_email
=
meta
.
autho
r_email
meta
.
maintainer_email
=
package
.
maintaine
r_email
# Requires python
# Requires python
if
package
.
python_versions
!=
"*"
:
if
package
.
python_versions
!=
"*"
:
...
...
poetry/packages/package.py
View file @
159123f3
...
@@ -46,6 +46,7 @@ class Package(object):
...
@@ -46,6 +46,7 @@ class Package(object):
self
.
description
=
""
self
.
description
=
""
self
.
_authors
=
[]
self
.
_authors
=
[]
self
.
_maintainers
=
[]
self
.
homepage
=
None
self
.
homepage
=
None
self
.
repository_url
=
None
self
.
repository_url
=
None
...
@@ -135,6 +136,18 @@ class Package(object):
...
@@ -135,6 +136,18 @@ class Package(object):
return
self
.
_get_author
()[
"email"
]
return
self
.
_get_author
()[
"email"
]
@property
@property
def
maintainers
(
self
):
# type: () -> list
return
self
.
_maintainers
@property
def
maintainer_name
(
self
):
# type: () -> str
return
self
.
_get_maintainer
()[
"name"
]
@property
def
maintainer_email
(
self
):
# type: () -> str
return
self
.
_get_maintainer
()[
"email"
]
@property
def
all_requires
(
self
):
def
all_requires
(
self
):
return
self
.
requires
+
self
.
dev_requires
return
self
.
requires
+
self
.
dev_requires
...
@@ -149,6 +162,17 @@ class Package(object):
...
@@ -149,6 +162,17 @@ class Package(object):
return
{
"name"
:
name
,
"email"
:
email
}
return
{
"name"
:
name
,
"email"
:
email
}
def
_get_maintainer
(
self
):
# type: () -> dict
if
not
self
.
_maintainers
:
return
{
"name"
:
None
,
"email"
:
None
}
m
=
AUTHOR_REGEX
.
match
(
self
.
_maintainers
[
0
])
name
=
m
.
group
(
"name"
)
email
=
m
.
group
(
"email"
)
return
{
"name"
:
name
,
"email"
:
email
}
@property
@property
def
python_versions
(
self
):
def
python_versions
(
self
):
return
self
.
_python_versions
return
self
.
_python_versions
...
...
poetry/poetry.py
View file @
159123f3
...
@@ -113,6 +113,9 @@ class Poetry:
...
@@ -113,6 +113,9 @@ class Poetry:
for
author
in
local_config
[
"authors"
]:
for
author
in
local_config
[
"authors"
]:
package
.
authors
.
append
(
author
)
package
.
authors
.
append
(
author
)
for
maintainer
in
local_config
.
get
(
"maintainers"
,
[]):
package
.
maintainers
.
append
(
maintainer
)
package
.
description
=
local_config
.
get
(
"description"
,
""
)
package
.
description
=
local_config
.
get
(
"description"
,
""
)
package
.
homepage
=
local_config
.
get
(
"homepage"
)
package
.
homepage
=
local_config
.
get
(
"homepage"
)
package
.
repository_url
=
local_config
.
get
(
"repository"
)
package
.
repository_url
=
local_config
.
get
(
"repository"
)
...
...
tests/masonry/builders/fixtures/complete/pyproject.toml
View file @
159123f3
...
@@ -5,6 +5,9 @@ description = "Some description."
...
@@ -5,6 +5,9 @@ description = "Some description."
authors
=
[
authors
=
[
"Sébastien Eustace <sebastien@eustace.io>"
"Sébastien Eustace <sebastien@eustace.io>"
]
]
maintainers
=
[
"People Everywhere <people@everywhere.com>"
]
license
=
"MIT"
license
=
"MIT"
readme
=
"README.rst"
readme
=
"README.rst"
...
...
tests/masonry/builders/test_complete.py
View file @
159123f3
...
@@ -209,6 +209,8 @@ License: MIT
...
@@ -209,6 +209,8 @@ License: MIT
Keywords: packaging,dependency,poetry
Keywords: packaging,dependency,poetry
Author: Sébastien Eustace
Author: Sébastien Eustace
Author-email: sebastien@eustace.io
Author-email: sebastien@eustace.io
Maintainer: People Everywhere
Maintainer-email: people@everywhere.com
Requires-Python: >=3.6,<4.0
Requires-Python: >=3.6,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3
...
@@ -309,6 +311,8 @@ License: MIT
...
@@ -309,6 +311,8 @@ License: MIT
Keywords: packaging,dependency,poetry
Keywords: packaging,dependency,poetry
Author: Sébastien Eustace
Author: Sébastien Eustace
Author-email: sebastien@eustace.io
Author-email: sebastien@eustace.io
Maintainer: People Everywhere
Maintainer-email: people@everywhere.com
Requires-Python: >=3.6,<4.0
Requires-Python: >=3.6,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3
...
...
tests/masonry/test_api.py
View file @
159123f3
...
@@ -87,6 +87,8 @@ License: MIT
...
@@ -87,6 +87,8 @@ License: MIT
Keywords: packaging,dependency,poetry
Keywords: packaging,dependency,poetry
Author: Sébastien Eustace
Author: Sébastien Eustace
Author-email: sebastien@eustace.io
Author-email: sebastien@eustace.io
Maintainer: People Everywhere
Maintainer-email: people@everywhere.com
Requires-Python: >=3.6,<4.0
Requires-Python: >=3.6,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3
...
...
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