Browse Source

only produce a universal setup.py if the package is universal

master
Niklas Rosenstein 6 months ago
parent
commit
e185b6d647
Signed by: NiklasRosenstein <rosensteinniklas@gmail.com> GPG Key ID: 06D269B33D25F6C6
2 changed files with 18 additions and 7 deletions
  1. +7
    -0
      .changelog/_unreleased.yml
  2. +11
    -7
      src/shore/plugins/setuptools.py

+ 7
- 0
.changelog/_unreleased.yml View File

@@ -0,0 +1,7 @@
- types:
- fix
issues: []
components:
- setuptools
description: '`setup.py` now sets the `bdist_wheel:universal:1` flag only if the
package looks like it is a universal package (based on `Package.is_universal()`).'

+ 11
- 7
src/shore/plugins/setuptools.py View File

@@ -317,13 +317,7 @@ class SetuptoolsRenderer:
cmdclass = {cmdclass},
keywords = {keywords!r},
classifiers = {classifiers!r},
options = {{
'bdist_wheel': {{
'universal': True,
}},
}},
)
''').format(
''').rstrip().format(
package=package,
packages_args=packages_args,
author_name=package.get_author().name if package.get_author() else None,
@@ -344,6 +338,16 @@ class SetuptoolsRenderer:
classifiers = package.classifiers,
))

if package.is_universal():
fp.write(textwrap.dedent('''
options = {
'bdist_wheel': {
'universal': True,
},
},
)
'''))

def _render_entrypoints(self, entrypoints):
if not entrypoints:
return '{}'


Loading…
Cancel
Save