|
35 | 35 | package.setdefault('pypi_name', package['repo_name'])
|
36 | 36 |
|
37 | 37 | if package.get('badges'):
|
38 |
| - package['badges'] = [x.strip() for x in package['badges'].split(',')] |
| 38 | + package['badges'] = {x.strip() for x in package['badges'].split(',')} |
39 | 39 | else:
|
40 |
| - package['badges'] = ['pypi', 'conda'] |
| 40 | + package['badges'] = {'pypi', 'conda'} |
41 | 41 |
|
42 | 42 | needs_newline = False
|
43 | 43 | if 'pypi' in package['badges']:
|
|
49 | 49 | else:
|
50 | 50 | print('not found')
|
51 | 51 | package['badges'].remove('pypi')
|
52 |
| - if package.get('conda_channel') and 'conda' not in package['badges']: |
53 |
| - package['badges'].append('conda') |
| 52 | + if package.get('conda_channel'): |
| 53 | + package['badges'].add('conda') |
54 | 54 | package.setdefault('conda_channel', 'conda-forge')
|
55 | 55 | if 'conda' in package['badges']:
|
56 | 56 | needs_newline = True
|
|
66 | 66 | if needs_newline:
|
67 | 67 | print()
|
68 | 68 |
|
69 |
| - if package.get('sponsors') and 'sponsor' not in package['badges']: |
70 |
| - package['badges'].append('sponsor') |
71 |
| - if package.get('site') and 'site' not in package['badges'] and 'rtd' not in package['badges']: |
72 |
| - package['badges'].append('site') |
73 |
| - if package.get('dormant') and 'dormant' not in package['badges']: |
74 |
| - package['badges'].append('dormant') |
| 69 | + if package.get('sponsors'): |
| 70 | + package['badges'].add('sponsor') |
| 71 | + if package.get('site') and package['badges'].isdisjoint({'site', 'rtd'}): |
| 72 | + package['badges'].add('site') |
| 73 | + if package.get('dormant'): |
| 74 | + package['badges'].add('dormant') |
75 | 75 |
|
76 | 76 | if 'rtd' in package['badges']:
|
77 | 77 | package.setdefault('rtd_name', package['repo_name'])
|
|
0 commit comments