-
Notifications
You must be signed in to change notification settings - Fork 354
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
add python 3.12 to the build and drop python 3.8 #4716
Changes from all commits
4ccb200
2885b47
8530850
7695c5d
00b26ab
5f74135
8daba3d
15e7321
283472b
a887f5a
e90f2a6
583e124
8ff2e03
e2e5992
2206e4b
3848bf0
b52231b
46988c7
180f085
8a66dca
549ae44
6a3ace0
d94bd19
2b9b52b
2b25d21
b9d35b2
92bb4db
8cf57e4
319ec0b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,6 @@ a set of injection files. The *order* of the injection files *must* match the | |
bank files, and the number of injections in each must correspond one-to-one. | ||
""" | ||
|
||
import imp | ||
import argparse | ||
import numpy as np | ||
|
||
|
@@ -33,7 +32,7 @@ from pycbc import pnutils | |
from pycbc.waveform import TemplateBank | ||
from pycbc.io.ligolw import LIGOLWContentHandler | ||
from pycbc.io.hdf import HFile | ||
|
||
from pycbc import load_source | ||
|
||
__author__ = "Ian Harry <[email protected]>" | ||
__version__ = pycbc.version.git_verbose_msg | ||
|
@@ -137,7 +136,7 @@ for val in trig_par_list: | |
f['trig_params/{}'.format(val)] = trig_params[val] | ||
|
||
if options.filter_func_file: | ||
modl = imp.load_source('filter_func', options.filter_func_file) | ||
modl = load_source('filter_func', options.filter_func_file) | ||
func = modl.filter_injections | ||
bool_arr = func(inj_params['mass1'], inj_params['mass2'], | ||
inj_params['spin1z'], inj_params['spin2z']) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,6 @@ | ||
[build-system] | ||
requires = ["setuptools", | ||
"wheel", | ||
"cython>=3.0.0", | ||
"numpy==1.16.0; python_version <= '3.7'", | ||
"numpy==1.17.3; python_version == '3.8'", | ||
"numpy==1.19.3; python_version == '3.9'", | ||
"numpy==1.21.4; python_version =='3.10'", | ||
"numpy==1.23.4; python_version=='3.11'", | ||
"numpy; python_version >= '3.12'", | ||
"cython>=0.29.21", | ||
"numpy>=2.0.0", | ||
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. Should we change PR title to indicate that this now makes pycbc require numpy 2 as well as dropping python versions? 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 actually necessary to require Numpy 2? As far as I understood it was supposed to maintain some level of backward compatibility. 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. We don't require numpy 2.0. However, to work with 2.0 it must be built with 2.0. They have added in 2.0 the ability for ABI to be backwards compatible, so when it is built with 2.0 it will still work with 1.XX. See https://numpy.org/devdocs/dev/depending_on_numpy.html#numpy-2-0-specific-advice That's why i did not update the setup.py or requirements file at hte same time, only the pyproject.toml which dictates how the build itself is done. |
||
] | ||
|
||
# To ensure the best compatibility, try to match the numpy reqs | ||
# where possible to the following used by scipy and the minimum | ||
# of our normal numpy requirements in setup.py | ||
# https://github.com/scipy/oldest-supported-numpy/blob/master/setup.cfg |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# For LDG service access | ||
ligo-proxy-utils | ||
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. What is this needed for? 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. @spxiwh That's a question for you all actually. If it's not needed we can remove it. However, it was hard coded in the workflow whereas if it is needed it should be in the requirements rather than installed by hand. |
||
ciecplib[kerberos] >= 0.7.0 | ||
dqsegdb2 >= 1.1.4 | ||
amqplib | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,11 +20,9 @@ | |
""" | ||
|
||
import sys | ||
import os, subprocess, shutil | ||
import os, subprocess | ||
import platform | ||
|
||
from distutils.command.clean import clean as _clean | ||
|
||
from setuptools import Extension, setup, Command | ||
from setuptools.command.build_ext import build_ext as _build_ext | ||
from setuptools import find_packages | ||
|
@@ -83,27 +81,6 @@ def run(self): | |
|
||
_build_ext.run(self) | ||
|
||
|
||
# Add swig-generated files to the list of things to clean, so they | ||
# get regenerated each time. | ||
class clean(_clean): | ||
def finalize_options (self): | ||
_clean.finalize_options(self) | ||
self.clean_files = [] | ||
self.clean_folders = ['docs/_build'] | ||
def run(self): | ||
_clean.run(self) | ||
for f in self.clean_files: | ||
try: | ||
os.unlink(f) | ||
print('removed ' + f) | ||
except: | ||
pass | ||
|
||
for fol in self.clean_folders: | ||
shutil.rmtree(fol, ignore_errors=True) | ||
print('removed ' + fol) | ||
|
||
def get_version_info(): | ||
"""Get VCS info and write version info to version.py. | ||
""" | ||
|
@@ -192,7 +169,6 @@ def run(self): | |
cmdclass = { | ||
'build_docs': build_docs, | ||
'build_gh_pages': build_gh_pages, | ||
'clean': clean, | ||
'build_ext': cbuild_ext | ||
} | ||
|
||
|
@@ -209,12 +185,21 @@ def run(self): | |
# do the actual work of building the package | ||
VERSION = get_version_info() | ||
|
||
cythonext = ['waveform.spa_tmplt', | ||
'waveform.utils', | ||
'types.array', | ||
'filter.matchedfilter', | ||
'vetoes.chisq'] | ||
cythonext = ['pycbc.waveform.spa_tmplt_cpu', | ||
'pycbc.waveform.utils_cpu', | ||
'pycbc.types.array_cpu', | ||
'pycbc.filter.matchedfilter_cpu', | ||
'pycbc.vetoes.chisq_cpu', | ||
"pycbc.fft.fftw_pruned_cython", | ||
"pycbc.events.eventmgr_cython", | ||
"pycbc.events.simd_threshold_cython", | ||
"pycbc.filter.simd_correlate_cython", | ||
"pycbc.waveform.decompress_cpu_cython", | ||
"pycbc.inference.models.relbin_cpu", | ||
] | ||
ext = [] | ||
|
||
libraries = ['m'] # Some platforms / toolchains don't implicitly link this | ||
cython_compile_args = ['-O3', '-w', '-ffast-math', | ||
'-ffinite-math-only'] | ||
|
||
|
@@ -233,57 +218,18 @@ def run(self): | |
cython_compile_args += ["-stdlib=libc++"] | ||
cython_link_args += ["-stdlib=libc++"] | ||
|
||
|
||
for name in cythonext: | ||
e = Extension("pycbc.%s_cpu" % name, | ||
["pycbc/%s_cpu.pyx" % name.replace('.', '/')], | ||
fname = name.replace('.', '/') | ||
e = Extension(name, | ||
[f"{fname}.pyx"], | ||
language='c++', | ||
extra_compile_args=cython_compile_args, | ||
extra_link_args=cython_link_args, | ||
libraries=libraries, | ||
compiler_directives={'embedsignature': True}) | ||
ext.append(e) | ||
|
||
# Not all modules work like this: | ||
e = Extension("pycbc.fft.fftw_pruned_cython", | ||
["pycbc/fft/fftw_pruned_cython.pyx"], | ||
extra_compile_args=cython_compile_args, | ||
extra_link_args=cython_link_args, | ||
compiler_directives={'embedsignature': True}) | ||
ext.append(e) | ||
e = Extension("pycbc.events.eventmgr_cython", | ||
["pycbc/events/eventmgr_cython.pyx"], | ||
extra_compile_args=cython_compile_args, | ||
extra_link_args=cython_link_args, | ||
compiler_directives={'embedsignature': True}) | ||
ext.append(e) | ||
e = Extension("pycbc.events.simd_threshold_cython", | ||
["pycbc/events/simd_threshold_cython.pyx"], | ||
language='c++', | ||
extra_compile_args=cython_compile_args, | ||
extra_link_args=cython_link_args, | ||
compiler_directives={'embedsignature': True}) | ||
ext.append(e) | ||
e = Extension("pycbc.filter.simd_correlate_cython", | ||
["pycbc/filter/simd_correlate_cython.pyx"], | ||
language='c++', | ||
extra_compile_args=cython_compile_args, | ||
extra_link_args=cython_link_args, | ||
compiler_directives={'embedsignature': True}) | ||
ext.append(e) | ||
e = Extension("pycbc.waveform.decompress_cpu_cython", | ||
["pycbc/waveform/decompress_cpu_cython.pyx"], | ||
language='c++', | ||
extra_compile_args=cython_compile_args, | ||
extra_link_args=cython_link_args, | ||
compiler_directives={'embedsignature': True}) | ||
ext.append(e) | ||
e = Extension("pycbc.inference.models.relbin_cpu", | ||
["pycbc/inference/models/relbin_cpu.pyx"], | ||
language='c++', | ||
extra_compile_args=cython_compile_args, | ||
extra_link_args=cython_link_args, | ||
compiler_directives={'embedsignature': True}) | ||
ext.append(e) | ||
|
||
|
||
setup( | ||
name = 'PyCBC', | ||
version = VERSION, | ||
|
@@ -292,7 +238,7 @@ def run(self): | |
long_description_content_type='text/markdown', | ||
author = 'The PyCBC team', | ||
author_email = '[email protected]', | ||
url = 'http://www.pycbc.org/', | ||
url = 'http://pycbc.org/', | ||
download_url = f'https://github.com/gwastro/pycbc/tarball/v{VERSION}', | ||
keywords = [ | ||
'ligo', | ||
|
@@ -313,14 +259,13 @@ def run(self): | |
'pycbc.neutron_stars': find_files('pycbc/neutron_stars') | ||
}, | ||
ext_modules = ext, | ||
python_requires='>=3.7', | ||
python_requires='>=3.9', | ||
classifiers=[ | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 3.7', | ||
'Programming Language :: Python :: 3.8', | ||
'Programming Language :: Python :: 3.9', | ||
'Programming Language :: Python :: 3.10', | ||
'Programming Language :: Python :: 3.11', | ||
'Programming Language :: Python :: 3.12', | ||
'Intended Audience :: Science/Research', | ||
'Natural Language :: English', | ||
'Topic :: Scientific/Engineering', | ||
|
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.
Why are we dropping 3.9 from the basic tests as well?
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.
I'll add this back. 3.9 is past EOL, but we can remove later after the docker / venv images are also updated and pycbc live is moved to a newer python version. I believe those are the hangups for 3.9.