Skip to content

Commit

Permalink
Add entry points. Clean build dir
Browse files Browse the repository at this point in the history
If build dir is not cleaned, then building for multiple different
Pythons will include extensions compiled for one Python version in the
wheels for another version, which conda does not like one bit
(among other reasons not to do it):

pypa/wheel#147

Add `--no-deps` to pip command. It doesn't seem to be necessary, as I
don't see dependencies being installed at build time. However it is
recommended so I'm doing it just in case.
  • Loading branch information
chrisjbillington committed May 19, 2020
1 parent ccc3166 commit 1141101
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion setuptools_conda/setuptools_conda.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ def finalize_options(self):
def run(self):
# Clean
shutil.rmtree(self.BUILD_DIR, ignore_errors=True)
shutil.rmtree('build', ignore_errors=True)
os.makedirs(self.RECIPE_DIR)

# Run bdist_wheel to make a wheel in the recipe dir:
Expand All @@ -297,7 +298,7 @@ def run(self):
'package': {'name': self.NAME, 'version': self.VERSION,},
'source': {'url': f'../{wheel}', 'sha256': sha256},
'build': {
'script': "{{ PYTHON }} -m pip install %s -vv" % wheel,
'script': "{{ PYTHON }} -m pip install %s --no-deps -vv" % wheel,
'number': self.build_number,
},
'requirements': {
Expand All @@ -316,6 +317,10 @@ def run(self):
package_details['build']['noarch'] = 'python'
if self.build_string is not None:
package_details['build']['string'] = self.build_string
console_scripts = self.distribution.entry_points.get('console_scripts', [])
gui_scripts = self.distribution.entry_points.get('gui_scripts', [])
if console_scripts or gui_scripts:
package_details['build']['entry_points'] = console_scripts + gui_scripts
if self.license_file is not None:
shutil.copy(self.license_file, self.BUILD_DIR)
package_details['about']['license_file'] = f'../{self.license_file}'
Expand Down

0 comments on commit 1141101

Please sign in to comment.