Skip to content

fix pkg_resources DeprecationWarning #40548

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

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/onCreate-conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ mamba env create -y --file environment-3.11-linux.yml || mamba env update --file
conda init bash

# Build sage
conda run -n sage-dev pip install --no-build-isolation -v -v -e . --config-settings=build-dir="build/conda-cp311"
conda run -n sage-dev pip install --no-build-isolation -v -v --config-settings=build-dir="build/conda-cp311" --editable .
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ env:
FROM_DOCKER_TARGET: "with-targets"
FROM_DOCKER_TAG: ${{ github.event.inputs.docker_tag || 'dev'}}
EXTRA_CONFIGURE_ARGS: --enable-fat-binary
# Enable editable installs for faster incremental builds
SAGE_EDITABLE: yes

jobs:
test-long:
Expand Down
98 changes: 90 additions & 8 deletions .github/workflows/ci-meson.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,30 @@ jobs:
activate-environment: sage-dev
environment-file: environment-${{ matrix.python }}-${{ startsWith(matrix.os, 'macos') && (startsWith(runner.arch, 'ARM') && 'macos' || 'macos-x86_64') || startsWith(matrix.os, 'ubuntu') && 'linux' || 'win' }}.yml

- name: Install build dependencies
if: runner.os == 'Linux'
shell: bash -l {0}
run: |
# Ensure essential build tools are available for Linux builds
sudo apt-get update
sudo apt-get install -y build-essential gfortran libtool-bin

- name: Install build dependencies (macOS)
if: runner.os == 'macOS'
shell: bash -l {0}
run: |
# Ensure build dependencies are properly installed on macOS
# First update conda and pip to latest versions
conda update -n base –y conda
# Install/update essential build tools in the correct order
conda activate sage-dev
pip install --upgrade pip
pip install --upgrade setuptools wheel
pip install --upgrade meson-python
# Verify installations
python -c "import setuptools; print(f'setuptools: {setuptools.__version__}')"
python -c "import mesonpy; print(f'meson-python: {mesonpy.__version__}')"

# Sometimes the conda setup fails due to network issues.
# This is a workaround to retry the setup step if it fails.
# Workaround for https://github.com/conda-incubator/setup-miniconda/issues/129
Expand All @@ -123,33 +147,91 @@ jobs:
conda info
conda list

- name: Clean build artifacts
shell: bash -l {0}
run: |
# Clean any previous build artifacts that might cause issues
rm -rf build/ dist/ *.egg-info builddir/
find . -name "*.pyc" -delete
find . -name "__pycache__" -type d -exec rm -rf {} + 2>/dev/null || true

- name: Verify Python environment
shell: bash -l {0}
run: |
# Verify the Python environment is correctly set up
python --version
pip --version
python -c "import sys; print(f'Python executable: {sys.executable}')"
python -c "import sysconfig; print(f'Python include: {sysconfig.get_path(\"include\")}')"
# Test that we can import required build dependencies
python -c "import setuptools, wheel, mesonpy; print('Build dependencies OK')" || {
echo "Build dependencies missing, installing..."
pip install --upgrade setuptools wheel meson-python
}

- name: Build
shell: bash -l {0}
run: |
if [[ "$RUNNER_OS" != "Windows" ]]; then
# Clean environment to avoid conflicts
unset CFLAGS CXXFLAGS LDFLAGS
# Set up ccache for faster builds
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
export CC="ccache $CC"
export CXX="ccache $CXX"
# Only use ccache if the base compilers are available
if command -v gcc >/dev/null 2>&1; then
export CC="ccache gcc"
fi
if command -v g++ >/dev/null 2>&1; then
export CXX="ccache g++"
fi
else
export LIB="$LIB;$CONDA_PREFIX\\Library\\lib"
export INCLUDE="$INCLUDE;$CONDA_PREFIX\\Library\\include"
fi

# Debug: Show environment before build
echo "=== Build Environment ==="
echo "Python: $(python --version)"
echo "Pip: $(pip --version)"
echo "Working directory: $(pwd)"
echo "Python path: $PYTHONPATH"

# Use --no-deps and pip check below to verify that all necessary dependencies are installed via conda
pip install --no-build-isolation --no-deps --config-settings=builddir=builddir ${{ matrix.editable && '--editable' || '' }} . -v
if [[ "${{ matrix.editable }}" == "true" ]]; then
echo "Building in editable mode..."
pip install --no-build-isolation --no-deps --config-settings=builddir=builddir --editable . -v
else
echo "Building in standard mode..."
pip install --no-build-isolation --no-deps --config-settings=builddir=builddir . -v
fi

- name: Check update-meson
# this step must be after build, because meson.build creates a number of __init__.py files
# that is needed to make tools/update-meson.py run correctly
shell: bash -l {0}
if: matrix.tests == 'all'
run: |
# Store current git state
git add .
git stash push -m "Pre-update-meson state"

# Run update-meson
python tools/update-meson.py
if ! ./tools/test-git-no-uncommitted-changes; then
git add --intent-to-add . # also show newly created files in git diff
git status
git diff
false

# Check if update-meson made any changes to tracked files
if ! git diff --quiet HEAD; then
echo "update-meson.py made changes to tracked files:"
git diff HEAD
echo "Please run 'python tools/update-meson.py' and commit the changes."
exit 1
fi

# Check for new untracked files that should be committed
if [ -n "$(git ls-files --others --exclude-standard)" ]; then
echo "update-meson.py created new files that may need to be committed:"
git ls-files --others --exclude-standard
echo "If these files should be tracked, please add and commit them."
# Don't fail for new files, just warn
fi

- name: Verify dependencies
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,16 @@ jobs:
# Install build dependencies manually as workaround for https://github.com/astral-sh/uv/issues/1516
uv pip install \
meson-python \
"setuptools >=68.1.1" \
"cypari2 >=2.2.1" \
"cysignals >=1.11.2, != 1.12.0" \
"cython >=3.0, != 3.0.3, < 3.1.0" \
"gmpy2 ~=2.1.b999" \
memory_allocator \
"numpy >=1.25" \
jinja2 \
setuptools
uv sync --frozen --inexact --no-build-isolation -v
jinja2
# Use editable install for faster incremental builds
MESONPY_EDITABLE_VERBOSE=1 uv sync --frozen --inexact --no-build-isolation -v

- name: Test
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/doc-build-pdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ env:
FROM_DOCKER_TARGET: "with-targets"
FROM_DOCKER_TAG: ${{ github.event.inputs.docker_tag || 'dev'}}
EXTRA_CONFIGURE_ARGS: --enable-fat-binary
# Enable editable installs for faster incremental builds
SAGE_EDITABLE: yes

jobs:
build-doc-pdf:
Expand Down
22 changes: 19 additions & 3 deletions .github/workflows/doc-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,30 @@ jobs:
channel-priority: true
activate-environment: sage-dev
environment-file: environment-${{ env.PYTHON_VERSION }}-linux.yml

- name: Install build dependencies
shell: bash -l {0}
run: |
# Ensure essential build tools are available
sudo apt-get update
sudo apt-get install -y build-essential gfortran libtool-bin

- name: Build Sage
shell: bash -l {0}
run: |
# Clean environment to avoid conflicts
unset CFLAGS CXXFLAGS LDFLAGS
# Set up ccache for faster builds
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
export CC="ccache $CC"
export CXX="ccache $CXX"
pip install --no-build-isolation --config-settings=builddir=builddir . -v
# Only use ccache if the base compilers are available
if command -v gcc >/dev/null 2>&1; then
export CC="ccache gcc"
fi
if command -v g++ >/dev/null 2>&1; then
export CXX="ccache g++"
fi
# Use editable install for faster incremental builds
MESONPY_EDITABLE_VERBOSE=1 pip install --no-build-isolation --config-settings=builddir=builddir --editable . -v

#
# For pull requests
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ jobs:
FROM_DOCKER_TAG: ${{ inputs.from_docker_tag }}
EXTRA_CONFIGURE_ARGS: --enable-fat-binary
EXTRA_SAGE_PACKAGES: ${{ inputs.extra_sage_packages }}
# Enable editable installs for faster incremental builds
SAGE_EDITABLE: yes
steps:
- name: Maximize build disk space
uses: easimon/maximize-build-space@v10
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:
;;
esac
(sleep ${{ inputs.timeout }}; pkill make) &
MAKE="make -j12" EXTRA_SAGE_PACKAGES="${{ inputs.extra_sage_packages }}" "${{ steps.python.outputs.python-path }}" -m pipx run tox -e $TOX_ENV -- SAGE_NUM_THREADS=6 $TARGETS
MAKE="make -j12" EXTRA_SAGE_PACKAGES="${{ inputs.extra_sage_packages }}" SAGE_EDITABLE=yes "${{ steps.python.outputs.python-path }}" -m pipx run tox -e $TOX_ENV -- SAGE_NUM_THREADS=6 $TARGETS
- name: Prepare logs artifact
run: |
mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; cp -r .tox/*/log "artifacts/$LOGS_ARTIFACT_NAME"
Expand Down
2 changes: 1 addition & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ tasks:
&& conda config --append envs_dirs $(pwd)
&& conda activate $(pwd)/venv
&& ./bootstrap
&& pip install --no-build-isolation -v -v -e ./src
&& pip install --no-build-isolation -v -v --editable ./src
# Activate conda environment, set up Trac remote
# RestructuredText extension recommends python extension, although we have already installed it
# So disable the recommendation dialog
Expand Down
12 changes: 11 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,15 @@
// Use the Meson build system for C/C++ files
"C_Cpp.default.configurationProvider": "mesonbuild.mesonbuild",
// Use the compile_commands.json file generated by Meson for IntelliSense
"C_Cpp.default.compileCommands": "${workspaceFolder}/builddir/compile_commands.json"
"C_Cpp.default.compileCommands": "${workspaceFolder}/builddir/compile_commands.json",
// Environment variables for SageMath development
"terminal.integrated.env.linux": {
"MESONPY_EDITABLE_VERBOSE": "1"
},
"terminal.integrated.env.osx": {
"MESONPY_EDITABLE_VERBOSE": "1"
},
"terminal.integrated.env.windows": {
"MESONPY_EDITABLE_VERBOSE": "1"
}
}
2 changes: 1 addition & 1 deletion build/bin/sage-spkg
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ fi
. sage-build-env-config
. sage-build-env || exit_with_error_msg "Error setting environment variables by sourcing sage-build-env"

# Remove '.' from PYTHONPATH, to avoid trouble with setuptools / easy_install
# Remove '.' from PYTHONPATH, to avoid trouble with setuptools / pip
# (cf. #10192, #10176):
if [ -n "$PYTHONPATH" ]; then
# We also collapse multiple slashs into a single one (first substitution),
Expand Down
4 changes: 2 additions & 2 deletions build/pkgs/beniget/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=beniget-VERSION.tar.gz
sha1=0167f16d17fbd61b91e620bca07e4ec7054ce51d
sha256=75554b3b8ad0553ce2f607627dad3d95c60c441189875b98e097528f8e23ac0c
sha1=95233c191f0ea8486a8ef0cf40d9c5a9838f2439
sha256=a0258537e65e7e14ec33a86802f865a667f949bb6c73646d55e42f7c45a052ae
upstream_url=https://files.pythonhosted.org/packages/source/b/beniget/beniget-VERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/beniget/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.1
0.4.2.post1
4 changes: 2 additions & 2 deletions build/pkgs/cysignals/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=cysignals-VERSION.tar.gz
sha1=e285e209a3a5f9469cb5ade746c518cd3a600a9b
sha256=89f7626dbf29db5ab3d6eff15a89978f4eb5193c320e9099bcc157dacdefd1eb
sha1=d3f23d9d82aab06939996f8cbc881a1c529cab98
sha256=4aefa3b35eb036cb40b2b948df84725976b987895338204f64550e2d63891f5f
upstream_url=https://files.pythonhosted.org/packages/source/c/cysignals/cysignals-VERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/cysignals/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.12.3
1.12.4
4 changes: 2 additions & 2 deletions build/pkgs/cython/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=cython-VERSION.tar.gz
sha1=f692b0c6f209b75b6bbd69bdbd57fac23785c23e
sha256=7146dd2af8682b4ca61331851e6aebce9fe5158e75300343f80c07ca80b1faff
sha1=3bd5a99e283297a423bb9bb1ab9765bb4bfde86e
sha256=10ee785e42328924b78f75a74f66a813cb956b4a9bc91c44816d089d5934c089
upstream_url=https://files.pythonhosted.org/packages/source/c/cython/cython-VERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/cython/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.11
3.1.3
4 changes: 2 additions & 2 deletions build/pkgs/gast/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=gast-VERSION.tar.gz
sha1=6c113cf8d33cc654d33210335103485ab41d3dbb
sha256=9c270fe5f4b130969b54174de7db4e764b09b4f7f67ccfc32480e29f78348d97
sha1=6ff8b1105c331ac55d1f9fa389b7486b9f8c9c07
sha256=88fc5300d32c7ac6ca7b515310862f71e6fdf2c029bbec7c66c0f5dd47b6b1fb
upstream_url=https://files.pythonhosted.org/packages/source/g/gast/gast-VERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/gast/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.4
0.6.0
11 changes: 5 additions & 6 deletions build/pkgs/pip/SPKG.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
pip: Tool for installing and managing Python packages
=====================================================
pip
===

Description
-----------

This package installs pip, the tool for installing and managing Python
packages, such as those found in the Python Package Index. It’s a
replacement for easy_install.
This package installs pip, the standard tool for installing and managing Python
packages, such as those found in the Python Package Index. It has replaced
the deprecated easy_install tool.

License
-------
Expand All @@ -23,4 +23,3 @@ Upstream Contact
- Bug Tracking: https://github.com/pypa/pip/issues
- Mailing list: http://groups.google.com/group/python-virtualenv
- Docs: https://pip.pypa.io/

4 changes: 2 additions & 2 deletions build/pkgs/pythran/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=pythran-VERSION-py3-none-any.whl
sha1=2341d42c014f88318f447083c62e8d3953b04ac2
sha256=be569cc2817b625ccd2c8f74fa3c93806f245c65fadc282c26a9f546ebd34cfa
sha1=5e68b54f525e1f7de6e73aa3e897f5f21652bd1d
sha256=405ecf2100d4926d1a15640c36bd1b19a560386653d0ee4d5234f9421ef4034b
upstream_url=https://files.pythonhosted.org/packages/py3/p/pythran/pythran-VERSION-py3-none-any.whl
2 changes: 1 addition & 1 deletion build/pkgs/pythran/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.17.0
0.18.0
4 changes: 2 additions & 2 deletions build/pkgs/setuptools/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=setuptools-VERSION-py3-none-any.whl
sha1=3756539d45341ca5cec9e2dfe11539faa066f5cd
sha256=b208925fcb9f7af924ed2dc04708ea89791e24bde0d3020b27df0e116088b34e
sha1=f82aabaab9ae429e91d2b0d748ecd2c0b07c5de8
sha256=062d34222ad13e0cc312a4c02d73f059e86a4acbfbdea8f8f76b28c99f306922
upstream_url=https://files.pythonhosted.org/packages/py3/s/setuptools/setuptools-VERSION-py3-none-any.whl
2 changes: 1 addition & 1 deletion build/pkgs/setuptools/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
73.0.1
80.9.0
4 changes: 2 additions & 2 deletions build/pkgs/setuptools_scm/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=setuptools_scm-VERSION-py3-none-any.whl
sha1=be606b6acb67714b96e9e1e9a9944feaca504e44
sha256=897a3226a6fd4a6eb2f068745e49733261a21f70b1bb28fce0339feb978d9af3
sha1=29b1eb2fa08075564f062c354eab106380ad16e6
sha256=332ca0d43791b818b841213e76b1971b7711a960761c5bea5fc5cdb5196fbce3
upstream_url=https://files.pythonhosted.org/packages/py3/s/setuptools_scm/setuptools_scm-VERSION-py3-none-any.whl
2 changes: 1 addition & 1 deletion build/pkgs/setuptools_scm/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.1.0
8.3.1
7 changes: 5 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ ENV SAGE_FAT_BINARY yes
# Just to be sure Sage doesn't try to build its own GCC (even though
# it shouldn't with a recent GCC package from the system and with gfortran)
ENV SAGE_INSTALL_GCC no
# Enable editable installs for faster incremental builds
ARG SAGE_EDITABLE="yes"
ENV SAGE_EDITABLE $SAGE_EDITABLE
# Set MAKEFLAGS and SAGE_NUM_THREADS to build things in parallel during the
# docker build. Note that these do not leak into the sagemath and sagemath-dev
# images.
Expand All @@ -197,8 +200,8 @@ ENV MAKEFLAGS $MAKEFLAGS
ARG SAGE_NUM_THREADS="2"
ENV SAGE_NUM_THREADS $SAGE_NUM_THREADS
RUN make configure
# Old default before https://github.com/sagemath/sage/issues/32406
RUN ./configure --disable-editable
# Enable editable installs by default (SAGE_EDITABLE=yes is the default in configure.ac)
RUN ./configure
RUN make build

################################################################################
Expand Down
Loading
Loading