Skip to content

Commit

Permalink
MAINT: Support Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Oct 19, 2023
1 parent f4b6f2f commit eae3ec5
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,16 @@
import numpy
from numpy.distutils.command import build, install_data, build_src
from numpy.distutils.core import setup
my_build_src_super = build_src.build_src
build_src_run = build_src.build_src.run
del build_src
HAS_NUMPY = True
except ImportError:
HAS_NUMPY = False
from distutils.command import build, install_data
from distutils.core import setup
my_build_src_super = object
build_src_run = lambda *args, **kwargs: None
import io
import os
import time
Expand Down Expand Up @@ -124,8 +129,8 @@ def mlab_reference(self):
mlab_ref_dir = join(DEFAULT_INPUT_DIR, 'mayavi', 'auto')

source_path = 'mayavi'
sources = '(\.py)|(\.rst)$'
excluded_dirs = '^\.'
sources = r'(\.py)|(\.rst)$'
excluded_dirs = r'^\.'
target_path = mlab_ref_dir
target_time = self.latest_modified(target_path,
ignore_dirs=excluded_dirs)[0]
Expand Down Expand Up @@ -288,7 +293,7 @@ def run(self):
build.build.run(self)


class MyBuildSrc(build_src.build_src):
class MyBuildSrc(my_build_src_super):
"""Build hook to generate the TVTK ZIP files.
We do it here also because for editable installs, setup.py build is not
Expand All @@ -297,7 +302,7 @@ class MyBuildSrc(build_src.build_src):

def run(self):
build_tvtk_classes_zip()
build_src.build_src.run(self)
build_src_run(self)


class MyDevelop(develop.develop):
Expand Down

0 comments on commit eae3ec5

Please sign in to comment.