Skip to content

Commit

Permalink
pkgs/sage-conf_conda/setup.py: Skip some files generated in editable …
Browse files Browse the repository at this point in the history
…mode when copying in non-editable mode
  • Loading branch information
mkoeppe committed Oct 1, 2023
1 parent 66a407e commit 18aebf4
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions pkgs/sage-conf_conda/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from setuptools import setup
from distutils.command.build_scripts import build_scripts as distutils_build_scripts
from setuptools.command.build_py import build_py as setuptools_build_py
from setuptools.command.editable_wheel import editable_wheel as setuptools_editable_wheel
from setuptools.errors import SetupError


Expand Down Expand Up @@ -75,7 +76,9 @@ def ignore(path, names):
return ['src']
### ignore more stuff --- .tox etc.
return [name for name in names
if name in ('.tox', '.git', '__pycache__')]
if name in ('.tox', '.git', '__pycache__',
'prefix', 'local', 'venv', 'upstream',
'config.status', 'config.log', 'logs')]

if not os.path.exists(os.path.join(SAGE_ROOT, 'config.status')):
# config.status and other configure output has to be writable.
Expand All @@ -99,6 +102,16 @@ def run(self):
distutils_build_scripts.run(self)


class editable_wheel(setuptools_editable_wheel):
r"""
Customized so that exceptions raised by our build_py
do not lead to the "Customization incompatible with editable install" message
"""
_safely_run = setuptools_editable_wheel.run_command


setup(
cmdclass=dict(build_py=build_py, build_scripts=build_scripts)
cmdclass=dict(build_py=build_py,
build_scripts=build_scripts,
editable_wheel=editable_wheel)
)

0 comments on commit 18aebf4

Please sign in to comment.