Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify experimental all-conda installation instructions via pkgs/sage-conf_conda #36367

Merged
merged 10 commits into from
Oct 8, 2023
17 changes: 15 additions & 2 deletions pkgs/sage-conf_conda/setup.py
Original file line number Diff line number Diff line change
@@ -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


@@ -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.
@@ -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)
)