@@ -29,6 +29,7 @@ def __init__(self, *args, **kwargs):
29
29
30
30
self .__path = None
31
31
self .__fields = None
32
+ self .__contributors_as_maintainers = None
32
33
33
34
@property
34
35
def path (self ) -> str :
@@ -63,6 +64,14 @@ def fields(self) -> None | set[str]:
63
64
self .__fields = set (fields )
64
65
return self .__fields
65
66
67
+ @property
68
+ def contributors_as_maintainers (self ) -> bool :
69
+ if self .__contributors_as_maintainers is None :
70
+ self .__contributors_as_maintainers = self .config .get (
71
+ "contributors-as-maintainers" , True
72
+ )
73
+ return self .__contributors_as_maintainers
74
+
66
75
def load_package_data (self ):
67
76
path = os .path .normpath (os .path .join (self .root , self .path ))
68
77
if not os .path .isfile (path ):
@@ -114,17 +123,26 @@ def update(self, metadata: dict[str, Any]):
114
123
new_metadata = {"name" : package ["name" ]}
115
124
116
125
authors = None
126
+ maintainers = None
117
127
118
128
if "author" in package :
119
129
authors = [self ._parse_person (package ["author" ])]
120
130
121
131
if "contributors" in package :
122
- new_metadata [ "maintainers" ] = [
132
+ contributors = [
123
133
self ._parse_person (p ) for p in package ["contributors" ]
124
134
]
135
+ if self .contributors_as_maintainers :
136
+ maintainers = contributors
137
+ else :
138
+ authors = [* (authors or []), * contributors ]
139
+
125
140
if authors is not None :
126
141
new_metadata ['authors' ] = authors
127
142
143
+ if maintainers is not None :
144
+ new_metadata ['maintainers' ] = maintainers
145
+
128
146
if "keywords" in package :
129
147
new_metadata ["keywords" ] = package ["keywords" ]
130
148
0 commit comments