-
Notifications
You must be signed in to change notification settings - Fork 25
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
build python 3.10 #101
Merged
Merged
build python 3.10 #101
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
fd0034b
add py310 req and setup
akaszynski 7db0d4d
add back missing CI
akaszynski 6fb5395
fix build_wheels.sh
akaszynski b7976f4
correct terms
akaszynski 1ee1dff
upgrade numpy for py 3.10
akaszynski 786cf68
do not use req_build
akaszynski 9c3fa42
add back in req_build
akaszynski c52f11a
use req in build
akaszynski 7d9e9a8
attempt to run all tests
akaszynski 0196de0
fix install req
akaszynski 373820a
disable plot testing for 3.10
akaszynski 28b14b7
check version correctly
akaszynski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[build-system] | ||
requires = [ | ||
"setuptools>=41.0.0", | ||
"wheel>=0.33.0", | ||
"numpy<=1.22.1", | ||
"cython==0.29.24", | ||
] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
setuptools>=41.0.0 | ||
wheel>=0.33.0 | ||
numpy<1.20.0 | ||
numpy<1.20.0;python_version<"3.10" | ||
numpy==1.22.1;python_version>="3.10" | ||
cython==0.29.24 | ||
matplotlib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,15 @@ | ||
"""Installation file for ansys-mapdl-reader""" | ||
from io import open as io_open | ||
from setuptools import setup, Extension | ||
from setuptools.command.build_ext import build_ext as _build_ext | ||
import os | ||
import platform | ||
import re | ||
import subprocess | ||
import struct | ||
import os | ||
import subprocess | ||
import sys | ||
from io import open as io_open | ||
|
||
from setuptools import setup, Extension | ||
from setuptools.command.build_ext import build_ext as _build_ext | ||
|
||
try: | ||
import numpy as np | ||
except ImportError: | ||
raise Exception('Please install numpy first with "pip install numpy"') | ||
|
||
import numpy as np | ||
|
||
# Facilities to install properly on Mac using clang | ||
def is_clang(bin): | ||
|
@@ -24,33 +19,8 @@ def is_clang(bin): | |
return not re.search(r'clang', output) is None | ||
|
||
|
||
def check_cython(): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it OK to delete this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, because we now check build requirements with pyproject.toml |
||
"""Check if binaries exist and if not check if Cython is installed""" | ||
has_binary_reader = False | ||
for filename in os.listdir('ansys/mapdl/reader'): | ||
if '_binary_reader' in filename: | ||
has_binary_reader = True | ||
|
||
if not has_binary_reader: | ||
# ensure cython is installed before trying to build | ||
try: | ||
import cython | ||
except ImportError: | ||
raise ImportError('\n\n\nTo build pyansys please install Cython with:\n\n' | ||
'pip install cython\n\n') from None | ||
|
||
|
||
check_cython() | ||
|
||
|
||
class build_ext(_build_ext): | ||
""" build class that includes numpy directory """ | ||
def finalize_options(self): | ||
_build_ext.finalize_options(self) | ||
# Prevent numpy from thinking it is still in its setup process: | ||
__builtins__.__NUMPY_SETUP__ = False | ||
import numpy | ||
self.include_dirs.append(numpy.get_include()) | ||
|
||
def build_extensions(self): | ||
if os.name != 'nt': | ||
|
@@ -77,7 +47,7 @@ def build_extensions(self): | |
_build_ext.build_extensions(self) | ||
|
||
|
||
def compilerName(): | ||
def compiler_name(): | ||
""" Check compiler and assign compile arguments accordingly """ | ||
import re | ||
import distutils.ccompiler | ||
|
@@ -104,7 +74,7 @@ def compilerName(): | |
|
||
|
||
# Assign arguments based on compiler | ||
compiler = compilerName() | ||
compiler = compiler_name() | ||
if compiler == 'unix': | ||
cmp_arg = ['-O3', '-w'] | ||
else: | ||
|
@@ -119,24 +89,39 @@ def compilerName(): | |
# execute file from raw string | ||
exec(fd.read()) | ||
|
||
install_requires = ['numpy>=1.16.0', | ||
'pyvista>=0.32.0', | ||
'appdirs>=1.4.0', | ||
'matplotlib>=3.0.0', | ||
'tqdm>=4.45.0'] | ||
install_requires = [ | ||
'numpy>=1.16.0', | ||
'pyvista>=0.32.0', | ||
'appdirs>=1.4.0', | ||
'matplotlib>=3.0.0', | ||
'tqdm>=4.45.0' | ||
] | ||
|
||
# perform python version checking | ||
# this is necessary to avoid the new pip package checking as vtk does | ||
# not support Python 32-bit as of 17 June 2021. | ||
if not struct.calcsize("P")*8 == 64: | ||
is64 = struct.calcsize("P") * 8 == 64 | ||
if not is64: | ||
try: | ||
import vtk | ||
except ImportError: | ||
raise RuntimeError('\n\n``ansys-mapdl-reader`` requires 64-bit Python due to vtk.\n' | ||
'Please check the version of Python installed at\n' | ||
'%s' % sys.executable) | ||
|
||
# Actual setup | ||
|
||
if sys.version_info.minor == 10 and is64: | ||
# use pip to check if vtk is available or installed | ||
sys_name = platform.system() | ||
if sys_name == 'Linux': | ||
install_requires.append( | ||
'vtk @ https://github.com/pyvista/pyvista-wheels/raw/main/vtk-9.1.0.dev0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', | ||
) | ||
elif sys_name == 'Windows': | ||
install_requires.append( | ||
'vtk @ https://github.com/pyvista/pyvista-wheels/raw/main/vtk-9.1.0.dev0-cp310-cp310-win_amd64.whl', | ||
) | ||
|
||
setup( | ||
name='ansys-mapdl-reader', | ||
packages=['ansys.mapdl.reader', 'ansys.mapdl.reader.examples'], | ||
|
@@ -157,11 +142,13 @@ def compilerName(): | |
'Programming Language :: Python :: 3.7', | ||
'Programming Language :: Python :: 3.8', | ||
'Programming Language :: Python :: 3.9', | ||
'Programming Language :: Python :: 3.10', | ||
], | ||
url='https://github.com/pyansys/pymapdl-reader', | ||
|
||
# Build cython modules | ||
cmdclass={'build_ext': build_ext}, | ||
include_dirs=[np.get_include()], | ||
ext_modules=[ | ||
Extension('ansys.mapdl.reader._archive', | ||
['ansys/mapdl/reader/cython/_archive.pyx', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So no VTK for Python 3.10?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There isn’t anything official at the moment. There are pyvista wheels compiled for 3.10 and a discussion about it here:
pyvista/pyvista#2064