Skip to content

.github/workflows/ci-sage.yml: Use passagemath #4929

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
12 changes: 6 additions & 6 deletions .github/workflows/ci-sage.yml
Original file line number Diff line number Diff line change
@@ -73,20 +73,20 @@ jobs:
&& echo "sage-package create ${{ env.SPKG }} --pypi --source normal --type standard; sage-package create ${{ env.SPKG }} --version git --tarball ${{ env.SPKG }}-git.tar.gz --type=standard" > upstream/update-pkgs.sh \
&& if [ -n "${{ env.REMOVE_PATCHES }}" ]; then echo "(cd ../build/pkgs/${{ env.SPKG }}/patches && rm -f ${{ env.REMOVE_PATCHES }}; :)" >> upstream/update-pkgs.sh; fi \
&& ls -l upstream/
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
path: upstream
name: upstream

linux:
# https://github.com/sagemath/sage/blob/develop/.github/workflows/docker.yml
uses: sagemath/sage/.github/workflows/docker.yml@develop
# https://github.com/passagemath/passagemath/blob/main/.github/workflows/docker.yml
uses: passagemath/passagemath/.github/workflows/docker.yml@main
with:
# Sage distribution packages to build
targets: setuptools pyzmq
# Standard setting: Test the current beta release of Sage:
sage_repo: sagemath/sage
sage_ref: develop
# Standard setting: Test the current main of passagemath:
sage_repo: passagemath/passagemath
sage_ref: main
upstream_artifact: upstream
# We prefix the image name with the SPKG name ("setuptools-") to avoid the error
# 'Package "sage-docker-..." is already associated with another repository.'

Unchanged files with check annotations Beta

from . import monkey
import distutils.log

Check warning on line 7 in setuptools/logging.py

GitHub Actions / pyright (3.13, ubuntu-latest)

Import "distutils.log" could not be resolved (reportMissingImports)
def _not_warning(record):
logging.basicConfig(
format="{message}", style='{', handlers=handlers, level=logging.DEBUG
)
if inspect.ismodule(distutils.dist.log):

Check warning on line 29 in setuptools/logging.py

GitHub Actions / pyright (3.13, ubuntu-latest)

"dist" is not a known attribute of module "distutils.log" (reportAttributeAccessIssue)

Check warning on line 29 in setuptools/logging.py

GitHub Actions / pyright (3.9, ubuntu-latest)

"dist" is not a known attribute of module "distutils" (reportAttributeAccessIssue)
monkey.patch_func(set_threshold, distutils.log, 'set_threshold')
# For some reason `distutils.log` module is getting cached in `distutils.dist`
# and then loaded again when patched,
# implying: id(distutils.log) != id(distutils.dist.log).
# Make sure the same module object is used everywhere:
distutils.dist.log = distutils.log

Check warning on line 35 in setuptools/logging.py

GitHub Actions / pyright (3.13, ubuntu-latest)

"dist" is not a known attribute of module "distutils.log" (reportAttributeAccessIssue)

Check warning on line 35 in setuptools/logging.py

GitHub Actions / pyright (3.9, ubuntu-latest)

"dist" is not a known attribute of module "distutils" (reportAttributeAccessIssue)
def set_threshold(level: int) -> int:
try:
# Ensure a DistutilsError raised by these methods is the same as distutils.errors.DistutilsError
from distutils._modified import (

Check warning on line 3 in setuptools/modified.py

GitHub Actions / pyright (3.13, ubuntu-latest)

Import "distutils._modified" could not be resolved from source (reportMissingModuleSource)

Check warning on line 3 in setuptools/modified.py

GitHub Actions / pyright (3.9, ubuntu-latest)

Import "distutils._modified" could not be resolved (reportMissingImports)
newer,
newer_group,
newer_pairwise,
import types
from typing import TypeVar, cast, overload
import distutils.filelist

Check warning on line 13 in setuptools/monkey.py

GitHub Actions / pyright (3.13, ubuntu-latest)

Import "distutils.filelist" could not be resolved from source (reportMissingModuleSource)
_T = TypeVar("_T")
_UnpatchT = TypeVar("_UnpatchT", type, types.FunctionType)
_patch_distribution_metadata()
# Install Distribution throughout the distutils
for module in distutils.dist, distutils.core, distutils.cmd:

Check warning on line 81 in setuptools/monkey.py

GitHub Actions / pyright (3.13, ubuntu-latest)

"dist" is not a known attribute of module "distutils" (reportAttributeAccessIssue)

Check warning on line 81 in setuptools/monkey.py

GitHub Actions / pyright (3.13, ubuntu-latest)

"core" is not a known attribute of module "distutils" (reportAttributeAccessIssue)

Check warning on line 81 in setuptools/monkey.py

GitHub Actions / pyright (3.13, ubuntu-latest)

"cmd" is not a known attribute of module "distutils" (reportAttributeAccessIssue)

Check warning on line 81 in setuptools/monkey.py

GitHub Actions / pyright (3.9, ubuntu-latest)

"dist" is not a known attribute of module "distutils" (reportAttributeAccessIssue)

Check warning on line 81 in setuptools/monkey.py

GitHub Actions / pyright (3.9, ubuntu-latest)

"core" is not a known attribute of module "distutils" (reportAttributeAccessIssue)

Check warning on line 81 in setuptools/monkey.py

GitHub Actions / pyright (3.9, ubuntu-latest)

"cmd" is not a known attribute of module "distutils" (reportAttributeAccessIssue)
module.Distribution = setuptools.dist.Distribution
# Install the patched Extension
if 'distutils.command.build_ext' in sys.modules:
sys.modules[
'distutils.command.build_ext'
].Extension = setuptools.extension.Extension

Check warning on line 90 in setuptools/monkey.py

GitHub Actions / pyright (3.13, ubuntu-latest)

Cannot assign to attribute "Extension" for class "ModuleType"   Attribute "Extension" is unknown (reportAttributeAccessIssue)

Check warning on line 90 in setuptools/monkey.py

GitHub Actions / pyright (3.9, ubuntu-latest)

Cannot assign to attribute "Extension" for class "ModuleType"   Attribute "Extension" is unknown (reportAttributeAccessIssue)
def _patch_distribution_metadata():
'get_fullname',
):
new_val = getattr(_core_metadata, attr)
setattr(distutils.dist.DistributionMetadata, attr, new_val)

Check warning on line 105 in setuptools/monkey.py

GitHub Actions / pyright (3.13, ubuntu-latest)

"dist" is not a known attribute of module "distutils" (reportAttributeAccessIssue)

Check warning on line 105 in setuptools/monkey.py

GitHub Actions / pyright (3.9, ubuntu-latest)

"dist" is not a known attribute of module "distutils" (reportAttributeAccessIssue)
def patch_func(replacement, target_mod, func_name):
"""
Undo secondary effect of `extra_path` adding to `install_lib`
"""
suffix = os.path.relpath(self.install_lib, self.install_libbase)

Check warning on line 79 in setup.py

GitHub Actions / pyright (3.9, ubuntu-latest)

No overloads for "relpath" match the provided arguments (reportCallIssue)

Check warning on line 79 in setup.py

GitHub Actions / pyright (3.9, ubuntu-latest)

Argument of type "str | None" cannot be assigned to parameter "path" of type "StrPath" in function "relpath"   Type "str | None" is not assignable to type "StrPath"     Type "None" is not assignable to type "StrPath"       "None" is not assignable to "str"       "None" is incompatible with protocol "PathLike[str]"         "__fspath__" is not present (reportArgumentType)
if suffix.strip() == self._pth_contents.strip():
self.install_lib = self.install_libbase