Skip to content
Open
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
19 changes: 14 additions & 5 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,27 @@ jobs:

outputs:
VERSION: ${{ steps.generate.outputs.version }}

strategy:
matrix:
python-version:
- '3.9'
- '3.10'
- '3.12'
- '3.13'
- '3.14'
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: 'recursive'
fetch-depth: 0

- name: Set up Python 3.10
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: ${{ matrix.python-version }}
cache: 'pip'
allow-prereleases: true

- name: Install dependencies
run: |
Expand All @@ -78,7 +86,7 @@ jobs:
- name: Save sdist as job artifact
uses: actions/upload-artifact@v4
with:
name: wxPython-source
name: wxPython-source-${{ matrix.python-version }}
path: dist/wxPython-${{ steps.generate.outputs.version }}.tar.gz

- name: Create demo source distribution (sdist_demo)
Expand All @@ -104,6 +112,7 @@ jobs:
strategy:
fail-fast: false
matrix:
sdist-python-version: ['3.10']
os: [ ubuntu-22.04, windows-2022, macos-13 ]
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ]
architecture: [ 'x86', 'x64' ]
Expand Down Expand Up @@ -152,7 +161,7 @@ jobs:
- name: download CI source artifact
uses: actions/download-artifact@v4
with:
name: wxPython-source
name: wxPython-source-${{ matrix.sdist-python-version }}
path: dist

- name: Set up Python ${{ matrix.python-version }}-${{ matrix.architecture }}
Expand Down
10 changes: 10 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This configuration file was automatically generated by Gitpod.
# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml)
# and commit this file to your remote git repository to share the goodness with others.

# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart

tasks:
- init: echo "nothing done"


23 changes: 17 additions & 6 deletions buildtools/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,35 @@
import os
import glob
import fnmatch
import logging
import shlex
import re
import shutil
import subprocess
import platform

from distutils.file_util import copy_file
from distutils.dir_util import mkpath
from setuptools._distutils.file_util import copy_file
from pathlib import Path
from typing import Union

try:
from setuptools.modified import newer
except ImportError:
from distutils.dep_util import newer

import distutils.sysconfig
import sysconfig

runSilently = False

log = logging.getLogger()

def mkpath(name: Union[Path, str], mode=0o777, verbose: Union[bool, int] = False):
"""Replacement for distutils.dir_util.mkpath function, with verbose support"""
path = Path(name)
if verbose and not path.is_dir():
log.info("creating %s", path)
Path(path).mkdir(mode=mode, parents=True, exist_ok=True)

#----------------------------------------------------------------------

class Configuration(object):
Expand Down Expand Up @@ -269,7 +281,7 @@ def finishSetup(self, wx_config=None, debug=None, compiler=None):
# we get the right sysroot, but we also need to ensure that
# the other linker flags that distutils wants to use are
# included as well.
LDSHARED = distutils.sysconfig.get_config_var('LDSHARED').split()
LDSHARED = sysconfig.get_config_var('LDSHARED').split()
# remove the compiler command
del LDSHARED[0]
# remove any -sysroot flags and their arg
Expand Down Expand Up @@ -1068,8 +1080,7 @@ def getToolsPlatformName(useLinuxBits=False):


def updateLicenseFiles(cfg):
from distutils.file_util import copy_file
from distutils.dir_util import mkpath
from setuptools._distutils.file_util import copy_file

# Copy the license files from wxWidgets
mkpath('license')
Expand Down
59 changes: 30 additions & 29 deletions buildtools/distutils_hacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@
# License: wxWindows License
#----------------------------------------------------------------------

import logging
import sys
import os

import distutils.command.install
import distutils.command.install_data
import distutils.command.install_headers
import distutils.command.clean
import setuptools.command.install
import setuptools._distutils.command.install_data
import setuptools._distutils.command.install_headers
import setuptools._distutils.command.clean

try:
from setuptools.modified import newer, newer_group
except ImportError:
from distutils.dep_util import newer, newer_group

from distutils import log
log = logging.getLogger()

from .config import Config, posixjoin, loadETG, etg2sip

Expand All @@ -33,23 +34,23 @@
# New command classes


class wx_smart_install_data(distutils.command.install_data.install_data):
class wx_smart_install_data(setuptools._distutils.command.install_data.install_data):
"""need to change self.install_dir to the actual library dir"""
def run(self):
install_cmd = self.get_finalized_command('install')
self.install_dir = getattr(install_cmd, 'install_lib')
return distutils.command.install_data.install_data.run(self)
return setuptools._distutils.command.install_data.install_data.run(self)


class wx_extra_clean(distutils.command.clean.clean):
class wx_extra_clean(setuptools._distutils.command.clean.clean):
"""
Also cleans stuff that this setup.py copies itself. If the
--all flag was used also searches for .pyc, .pyd, .so files
"""
def run(self):
from distutils.filelist import FileList
from setuptools._distutils.filelist import FileList

distutils.command.clean.clean.run(self)
setuptools._distutils.command.clean.clean.run(self)

cfg = Config()
if self.all:
Expand Down Expand Up @@ -82,7 +83,7 @@ def run(self):
# is used in our package build. If we detect that the current
# distutils does not have it then make sure that it is removed from
# the command-line options, otherwise the build will fail.
for item in distutils.command.install.install.user_options:
for item in setuptools.command.install.install.user_options:
if item[0] == 'install-layout=':
break
else:
Expand All @@ -93,27 +94,27 @@ def run(self):



class wx_install(distutils.command.install.install):
class wx_install(setuptools.command.install.install):
"""
Turns off install_path_file
"""
def initialize_options(self):
distutils.command.install.install.initialize_options(self)
setuptools.command.install.install.initialize_options(self)
self.install_path_file = 0


class wx_install_headers(distutils.command.install_headers.install_headers):
class wx_install_headers(setuptools._distutils.command.install_headers.install_headers):
"""
Install the header files to the WXPREFIX, with an extra dir per
filename too
"""
def initialize_options(self):
self.root = None
distutils.command.install_headers.install_headers.initialize_options(self)
setuptools._distutils.command.install_headers.install_headers.initialize_options(self)

def finalize_options(self):
self.set_undefined_options('install', ('root', 'root'))
distutils.command.install_headers.install_headers.finalize_options(self)
setuptools._distutils.command.install_headers.install_headers.finalize_options(self)

def run(self):
if os.name == 'nt':
Expand Down Expand Up @@ -149,9 +150,10 @@ def run(self):
# -arch is specified in our compiler args then we need to strip all of
# the -arch and -isysroot args provided by Python.

import distutils.unixccompiler
import distutils.sysconfig
from distutils.errors import DistutilsExecError, CompileError
import setuptools._distutils.unixccompiler
import setuptools._distutils.sysconfig
from setuptools.errors import CompileError
from setuptools._distutils.errors import DistutilsExecError

def _darwin_compiler_fixup(compiler_so, cc_args):
"""
Expand Down Expand Up @@ -240,7 +242,7 @@ def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
except DistutilsExecError as msg:
raise CompileError(msg)

_orig_parse_makefile = distutils.sysconfig.parse_makefile
_orig_parse_makefile = setuptools._distutils.sysconfig.parse_makefile
def _parse_makefile(filename, g=None):
rv = _orig_parse_makefile(filename, g)

Expand All @@ -255,10 +257,10 @@ def _parse_makefile(filename, g=None):
return rv


distutils.unixccompiler.UnixCCompiler = MyUnixCCompiler
distutils.unixccompiler._darwin_compiler_fixup = _darwin_compiler_fixup
distutils.unixccompiler._darwin_compiler = _darwin_compiler_fixup_24
distutils.sysconfig.parse_makefile = _parse_makefile
setuptools._distutils.unixccompiler.UnixCCompiler = MyUnixCCompiler
setuptools._distutils.unixccompiler._darwin_compiler_fixup = _darwin_compiler_fixup
setuptools._distutils.unixccompiler._darwin_compiler = _darwin_compiler_fixup_24
setuptools._distutils.sysconfig.parse_makefile = _parse_makefile


# Inject a little code into the CCompiler class that will check if the object
Expand All @@ -285,8 +287,7 @@ def _setup_compile(self, outdir, macros, incdirs, sources, depends, extra):
# Another hack-job for the CygwinCCompiler class, this time replacing
# the _compile function with one that will pass the -I flags to windres.

import distutils.cygwinccompiler
from distutils.errors import DistutilsExecError, CompileError
import setuptools._distutils.cygwinccompiler

def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
if ext == '.rc' or ext == '.res':
Expand All @@ -304,7 +305,7 @@ def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
except DistutilsExecError as msg:
raise CompileError(msg)

distutils.cygwinccompiler.CygwinCCompiler._compile = _compile
setuptools._distutils.cygwinccompiler.CygwinCCompiler._compile = _compile


#----------------------------------------------------------------------
Expand All @@ -316,8 +317,8 @@ def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
# a monkey-patch of the msvc9compiler.MSVCCompiler.initialize method.

if os.name == 'nt' and sys.version_info >= (2,6):
import distutils.msvc9compiler
_orig_initialize = distutils.msvc9compiler.MSVCCompiler.initialize
import setuptools._distutils.msvc9compiler
_orig_initialize = setuptools._distutils.msvc9compiler.MSVCCompiler.initialize

def _initialize(self, *args, **kw):
rv = _orig_initialize(self, *args, **kw)
Expand Down
13 changes: 8 additions & 5 deletions buildtools/sipdistutils.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
# Subclasses distutils.command.build_ext,
# Subclasses setuptools.command.build_ext,
# replacing it with a SIP version that compiles .sip -> .cpp
# before calling the original build_ext command.
# Written by Giovanni Bajo <rasky at develer dot com>
# Based on Pyrex.Distutils, written by Graham Fawcett and Darrel Gallion.

import distutils.command.build_ext
from distutils.dep_util import newer, newer_group
import setuptools.command.build_ext
try:
from setuptools.modified import newer, newer_group
except ImportError:
from distutils.dep_util import newer, newer_group
import os
import sys
from hashlib import sha1

build_ext_base = distutils.command.build_ext.build_ext
build_ext_base = setuptools.command.build_ext.build_ext

def replace_suffix(path, new_suffix):
return os.path.splitext(path)[0] + new_suffix

class build_ext (build_ext_base):
class build_ext(build_ext_base):

description = "Compile SIP descriptions, then build C/C++ extensions (compile/link to build directory)"

Expand Down
22 changes: 11 additions & 11 deletions requirements/devel.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ pytest-xdist
pytest-forked
pytest-timeout

sphinx==2.2.0 ; python_version >= '3.0'
sphinx ; python_version >= '3.0'
sphinx==1.8.5 ; python_version < '3.0'
alabaster<0.7.14
sphinxcontrib-applehelp<1.0.8
sphinxcontrib-devhelp<1.0.6
sphinxcontrib-htmlhelp<2.0.5
sphinxcontrib-jsmath<1.0.2
sphinxcontrib-qthelp<1.0.7
sphinxcontrib-serializinghtml<1.1.10
Jinja2==2.10
markupsafe==1.1.1
doc2dash==2.3.0
alabaster
sphinxcontrib-applehelp
sphinxcontrib-devhelp
sphinxcontrib-htmlhelp
sphinxcontrib-jsmath
sphinxcontrib-qthelp
sphinxcontrib-serializinghtml
Jinja2
markupsafe
doc2dash
beautifulsoup4
attrdict3 ; sys_platform == 'win32'
typing-extensions; python_version < '3.10'
Loading