Commit 5b14bd10 by Sébastien Eustace

Make the email address for authors optional

parent 70c324b4
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
- Dependency resolution caches now use sha256 hashes. - Dependency resolution caches now use sha256 hashes.
- Changed CLI error style. - Changed CLI error style.
- Improved debugging of dependency resolution. - Improved debugging of dependency resolution.
- Made the email address for authors optional.
### Fixed ### Fixed
......
...@@ -18,7 +18,7 @@ from .dependency import Dependency ...@@ -18,7 +18,7 @@ from .dependency import Dependency
from .file_dependency import FileDependency from .file_dependency import FileDependency
from .vcs_dependency import VCSDependency from .vcs_dependency import VCSDependency
AUTHOR_REGEX = re.compile('(?u)^(?P<name>[- .,\w\d\'’"()]+) <(?P<email>.+?)>$') AUTHOR_REGEX = re.compile('(?u)^(?P<name>[- .,\w\d\'’"()]+)(?: <(?P<email>.+?)>)?$')
class Package(object): class Package(object):
......
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from poetry.packages import Package
def test_package_authors():
package = Package('foo', '0.1.0')
package.authors.append('Sébastien Eustace <sebastien@eustace.io>')
assert package.author_name == 'Sébastien Eustace'
assert package.author_email == 'sebastien@eustace.io'
package.authors.insert(0, 'John Doe')
assert package.author_name == 'John Doe'
assert package.author_email is None
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment