Skip to content
This repository has been archived by the owner on Jan 12, 2021. It is now read-only.

Commit

Permalink
improve links processing
Browse files Browse the repository at this point in the history
  • Loading branch information
orsinium committed Apr 22, 2019
1 parent f013fc9 commit 935e36d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion dephell/__version__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

__version__ = '0.5.6'
__version__ = '0.5.7'
__author__ = 'Gram (@orsinium)'
__license__ = 'MIT'
22 changes: 13 additions & 9 deletions dephell/converters/egginfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,16 @@ def parse_info(cls, content: str, root=None) -> RootDependency:

# links
fields = (
('home', 'Home-Page'),
('homepage', 'Home-Page'),
('download', 'Download-URL'),
('project', 'Project-URL'),
)
for key, name in fields:
link = cls._get(info, name)
if link:
root.links[key] = link
for link in cls._get_list(info, 'Project-URL'):
key, url = link.split(', ')
root.links[key] = url

# authors
for name in ('author', 'maintainer'):
Expand Down Expand Up @@ -226,14 +228,16 @@ def make_info(self, reqs, project: RootDependency, with_requires: bool) -> str:
content.append(('Summary', project.description))

# links
fields = (
('home', 'Home-Page'),
('download', 'Download-URL'),
('project', 'Project-URL'),
fields = dict(
homepage='Home-Page',
download='Download-URL',
)
for key, name in fields:
if key in project.links:
content.append((name, project.links[key]))
for key, url in project.links.items():
if key in fields:
content.append((fields[key], url))
else:
key = key[0].upper() + key[1:]
content.append(('Project-URL', '{}, {}'.format(key, url)))

# authors
if project.authors:
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,13 @@ import_heading_localfolder = "app"

[tool.poetry]
name = "dephell"
version = "0.5.6"
version = "0.5.7"
authors = ["Gram <master_fess@mail.ru>"]
description = "Dependency resolution for Python"
readme = "README.md"
license = "MIT"
repository = "https://github.com/dephell/dephell"
documentation = "https://dephell.readthedocs.io/en/latest/"
keywords = [
"dephell", "packaging", "dependency", "dependencies", "venv", "licenses",
"pip", "poetry", "pipfile", "pipenv", "setuptools",
Expand Down

0 comments on commit 935e36d

Please sign in to comment.