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

Bump the pip-updates group across 1 directory with 3 updates #1433

Merged
merged 2 commits into from
Sep 11, 2024
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
diff --git a/giscanner/ccompiler.py b/giscanner/ccompiler.py
index d0ed70a3c4a1a6b7f9029827e87920cb34841334..9a732cd5ee92a99e6c60d76dafd5788a933ad383 100644
--- a/giscanner/ccompiler.py
+++ b/giscanner/ccompiler.py
@@ -26,7 +26,6 @@ import tempfile
import sys
import distutils

-from distutils.msvccompiler import MSVCCompiler
from distutils.unixccompiler import UnixCCompiler
from distutils.cygwinccompiler import Mingw32CCompiler
from distutils.sysconfig import get_config_vars
@@ -167,7 +166,7 @@ class CCompiler(object):
# Now, create the distutils ccompiler instance based on the info we have.
if compiler_name == 'msvc':
# For MSVC, we need to create a instance of a subclass of distutil's
- # MSVC9Compiler class, as it does not provide a preprocess()
+ # MSVCCompiler class, as it does not provide a preprocess()
# implementation
from . import msvccompiler
self.compiler = msvccompiler.get_msvc_compiler()
@@ -460,7 +459,7 @@ class CCompiler(object):
return self.compiler.linker_exe

def check_is_msvc(self):
- return isinstance(self.compiler, MSVCCompiler)
+ return self.compiler.compiler_type == "msvc"

# Private APIs
def _set_cpp_options(self, options):
@@ -486,7 +485,7 @@ class CCompiler(object):
# macros for compiling using distutils
# get dropped for MSVC builds, so
# escape the escape character.
- if isinstance(self.compiler, MSVCCompiler):
+ if self.check_is_msvc():
macro_value = macro_value.replace('\"', '\\\"')
macros.append((macro_name, macro_value))
elif option.startswith('-U'):
diff --git a/giscanner/msvccompiler.py b/giscanner/msvccompiler.py
index 0a543982007d0c813575b16c94709f5c342b4372..e333a80f548e17df8ca158627164ac6fb841cd99 100644
--- a/giscanner/msvccompiler.py
+++ b/giscanner/msvccompiler.py
@@ -19,30 +19,30 @@
#

import os
-import distutils
+from typing import Type

from distutils.errors import DistutilsExecError, CompileError
-from distutils.ccompiler import CCompiler, gen_preprocess_options
+from distutils.ccompiler import CCompiler, gen_preprocess_options, new_compiler
from distutils.dep_util import newer

# Distutil's MSVCCompiler does not provide a preprocess()
# Implementation, so do our own here.


+DistutilsMSVCCompiler: Type = type(new_compiler(compiler="msvc"))
+
+
def get_msvc_compiler():
return MSVCCompiler()


-class MSVCCompiler(distutils.msvccompiler.MSVCCompiler):
+class MSVCCompiler(DistutilsMSVCCompiler):

def __init__(self, verbose=0, dry_run=0, force=0):
- super(distutils.msvccompiler.MSVCCompiler, self).__init__()
+ super(DistutilsMSVCCompiler, self).__init__()
CCompiler.__init__(self, verbose, dry_run, force)
self.__paths = []
self.__arch = None # deprecated name
- if os.name == 'nt':
- if isinstance(self, distutils.msvc9compiler.MSVCCompiler):
- self.__version = distutils.msvc9compiler.VERSION
self.initialized = False
self.preprocess_options = None
if self.check_is_clang_cl():
2 changes: 2 additions & 0 deletions gvsbuild/projects/gobject_introspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ def __init__(self):
patches=[
# https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/427
"001-incorrect-giscanner-path.patch",
# https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/490
"002-remove-distutils-msvccompiler.patch",
],
)

Expand Down
32 changes: 18 additions & 14 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ build = ">=0.9,<1.3"
lastversion = { version = ">=2.4.2,<4.0.0", optional = true }
packaging = { version = ">=21.3,<25.0", optional = true }
typer = {extras = ["all"], version = ">=0.6.1,<0.13.0"}
setuptools = {version = ">=69.2,<74.0", python = ">=3.12"}
setuptools = {version = ">=69.2,<75.0", python = ">=3.12"}

[tool.poetry.group.dev.dependencies]
pre-commit = "^3.0.1"
Expand Down