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
c2d9a6b8
Unverified
Commit
c2d9a6b8
authored
Oct 15, 2018
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for the Project-URL metadata
parent
13f2776a
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
39 additions
and
0 deletions
+39
-0
CHANGELOG.md
+1
-0
poetry/masonry/builders/sdist.py
+3
-0
poetry/masonry/builders/wheel.py
+3
-0
poetry/masonry/metadata.py
+7
-0
poetry/packages/package.py
+16
-0
poetry/poetry.py
+1
-0
tests/masonry/builders/test_complete.py
+2
-0
tests/masonry/builders/test_sdist.py
+6
-0
No files found.
CHANGELOG.md
View file @
c2d9a6b8
...
...
@@ -8,6 +8,7 @@
-
Added support for multi-constraints dependencies.
-
Added a cache version system.
-
Added a
`--lock`
option to
`update`
to only update the lock file without executing operations.
-
Added support for the
`Project-URL`
metadata.
### Changed
...
...
poetry/masonry/builders/sdist.py
View file @
c2d9a6b8
...
...
@@ -221,6 +221,9 @@ class SdistBuilder(Builder):
for
dep
in
sorted
(
self
.
_meta
.
requires_dist
):
pkg_info
+=
"Requires-Dist: {}
\n
"
.
format
(
dep
)
for
name
,
url
in
sorted
(
self
.
_meta
.
project_urls
,
key
=
lambda
u
:
u
[
0
]):
pkg_info
+=
"Project-URL: {}, {}
\n
"
.
format
(
name
,
url
)
return
encode
(
pkg_info
)
def
find_packages
(
self
,
include
):
...
...
poetry/masonry/builders/wheel.py
View file @
c2d9a6b8
...
...
@@ -325,6 +325,9 @@ class WheelBuilder(Builder):
for
dep
in
sorted
(
self
.
_meta
.
requires_dist
):
fp
.
write
(
"Requires-Dist: {}
\n
"
.
format
(
dep
))
for
name
,
url
in
sorted
(
self
.
_meta
.
project_urls
,
key
=
lambda
u
:
u
[
0
]):
fp
.
write
(
"Project-URL: {}, {}
\n
"
.
format
(
name
,
url
))
if
self
.
_meta
.
description_content_type
:
fp
.
write
(
"Description-Content-Type: "
...
...
poetry/masonry/metadata.py
View file @
c2d9a6b8
...
...
@@ -80,4 +80,11 @@ class Metadata:
meta
.
provides_extra
=
[
e
for
e
in
package
.
extras
]
if
package
.
urls
:
for
name
,
url
in
package
.
urls
.
items
():
if
name
==
"Homepage"
and
meta
.
home_page
==
url
:
continue
meta
.
project_urls
+=
((
name
,
url
),)
return
meta
poetry/packages/package.py
View file @
c2d9a6b8
...
...
@@ -49,6 +49,7 @@ class Package(object):
self
.
homepage
=
None
self
.
repository_url
=
None
self
.
documentation_url
=
None
self
.
keywords
=
[]
self
.
_license
=
None
self
.
readme
=
None
...
...
@@ -221,6 +222,21 @@ class Package(object):
return
sorted
(
classifiers
)
@property
def
urls
(
self
):
urls
=
{}
if
self
.
homepage
:
urls
[
"Homepage"
]
=
self
.
homepage
if
self
.
repository_url
:
urls
[
"Repository"
]
=
self
.
repository_url
if
self
.
documentation_url
:
urls
[
"Documentation"
]
=
self
.
documentation_url
return
urls
def
is_prerelease
(
self
):
return
self
.
_version
.
is_prerelease
()
...
...
poetry/poetry.py
View file @
c2d9a6b8
...
...
@@ -106,6 +106,7 @@ class Poetry:
package
.
description
=
local_config
.
get
(
"description"
,
""
)
package
.
homepage
=
local_config
.
get
(
"homepage"
)
package
.
repository_url
=
local_config
.
get
(
"repository"
)
package
.
documentation_url
=
local_config
.
get
(
"documentation"
)
try
:
license_
=
license_by_id
(
local_config
.
get
(
"license"
))
except
ValueError
:
...
...
tests/masonry/builders/test_complete.py
View file @
c2d9a6b8
...
...
@@ -150,6 +150,8 @@ Provides-Extra: time
Requires-Dist: cachy[msgpack] (>=0.2.0,<0.3.0)
Requires-Dist: cleo (>=0.6,<0.7)
Requires-Dist: pendulum (>=1.4,<2.0); extra == "time"
Project-URL: Documentation, https://poetry.eustace.io/docs
Project-URL: Repository, https://github.com/sdispater/poetry
Description-Content-Type: text/x-rst
My Package
...
...
tests/masonry/builders/test_sdist.py
View file @
c2d9a6b8
...
...
@@ -165,6 +165,12 @@ def test_make_pkg_info():
'pendulum (>=1.4,<2.0); extra == "time"'
,
]
urls
=
parsed
.
get_all
(
"Project-URL"
)
assert
urls
==
[
"Documentation, https://poetry.eustace.io/docs"
,
"Repository, https://github.com/sdispater/poetry"
,
]
def
test_make_pkg_info_any_python
():
poetry
=
Poetry
.
create
(
project
(
"module1"
))
...
...
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