- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 684
add incremental building for setuptools>=79 #40616
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
Changes from all commits
7766f50
              bb86f56
              2c5be37
              0f4c64d
              94d9bae
              e833529
              4503938
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|  | @@ -46,9 +46,17 @@ SITEPACKAGESDIR=$(python3 -c 'import sysconfig; print(sysconfig.get_paths()["pur | |||||||
| # does not shadow the namespace package sage during the build. | ||||||||
| (cd "$SITEPACKAGESDIR" && rm -f sage/__init__.py) | ||||||||
| if [ "$SAGE_EDITABLE" = yes ]; then | ||||||||
| # Until https://github.com/sagemath/sage/issues/34209 switches us to PEP 660 editable wheels | ||||||||
| export SETUPTOOLS_ENABLE_FEATURES=legacy-editable | ||||||||
| sdh_pip_editable_install . | ||||||||
| # Check if this is an incremental build by looking for existing editable install | ||||||||
| if python3 -c "import importlib.metadata; importlib.metadata.distribution('sagemath-standard')" 2>/dev/null && \ | ||||||||
| python3 -c "import sage; import os; exit(0 if os.path.exists(os.path.join(os.path.dirname(sage.__file__), '..', 'setup.py')) else 1)" 2>/dev/null; then | ||||||||
| 
     | ||||||||
| python3 -c "import sage; import os; exit(0 if os.path.exists(os.path.join(os.path.dirname(sage.__file__), '..', 'setup.py')) else 1)" 2>/dev/null; then | |
| [ -f "$(python3 -c 'import sage, os; print(os.path.abspath(os.path.join(os.path.dirname(sage.__file__), "..", "setup.py")))' 2>/dev/null)" ]; then | 
    
      
    
      Copilot
AI
    
    
    
      Aug 17, 2025 
    
  
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using setup.py directly is discouraged in modern Python packaging. Consider using python3 -m build or pip install --no-build-isolation -e . for consistency with modern setuptools practices.
| python3 setup.py build_ext --inplace || sdh_die "Error during incremental build" | |
| # Use pip editable install for incremental compilation (modern practice) | |
| sdh_pip_editable_install . || sdh_die "Error during incremental build" | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition checks for 'sagemath-standard' distribution but this may not be the correct package name for all configurations. Consider using a more reliable method to detect existing editable installs or make the package name configurable.