Skip to content

Commit

Permalink
Drop python 2 and python 3.6 support (gwastro#3775)
Browse files Browse the repository at this point in the history
* require python 37 or later

* update version

* try this

* verbose

* fixes

* fixes

* fixes

* fixes

* fixes

* test

* test

* test

* test

* test

* test
  • Loading branch information
ahnitz authored Aug 27, 2021
1 parent d57898a commit f583f4f
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/basic-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
max-parallel: 60
matrix:
os: [ubuntu-20.04]
python-version: [2.7, 3.6, 3.7, 3.8, 3.9]
python-version: [3.7, 3.8, 3.9]
test-type: [help, unittest, search, inference, docs]
steps:
- uses: actions/checkout@v1
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/build_venv.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
name: docker build
name: build the LVK virtualenv

on: [push]
on: [push, pull_request]

jobs:
build:
build:
runs-on: ubuntu-20.04
steps:
-
steps:
-
uses: actions/checkout@v1
-
-
name: "Set up Python"
uses: actions/setup-python@v1
with:
python-version: 2.7
-
with:
python-version: 3.8
-
env:
OSG_ACCESS: "${{secrets.OSG_ACCESS}}"
name: "Preparing ssh stuff"
run: "bash -e tools/docker_build_prepssh.sh"
-
-
env:
DOCKER_IMG: igwn/lalsuite-dev:el7
DOCKER_IMG: igwn/base:el8
PYCBC_CONTAINER: pycbc_rhel_virtualenv
DOCKER_SECURE_ENV_VARS: true
name: "Creating the virtual environment"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/distribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: cp27-* cp36-* cp37-* cp38-* cp39-*
CIBW_BUILD: cp37-* cp38-* cp39-*
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mac-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
max-parallel: 4
matrix:
os: [macos-10.15]
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: [3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tut-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
max-parallel: 60
matrix:
os: [ubuntu-20.04]
python-version: [2.7, 3.6, 3.7, 3.8, 3.9]
python-version: [3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
Expand Down
18 changes: 4 additions & 14 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
# requirements for most basic library use
astropy>=2.0.3,<3.0.0; python_version <= '2.7'
astropy>=2.0.3,!=4.2.1,!=4.0.5; python_version >= '3.0'
astropy>=2.0.3,!=4.2.1,!=4.0.5
Mako>=1.0.1
decorator>=3.4.2
scipy>=0.16.0; python_version >= '3.5'
scipy>=0.16.0,<1.3.0; python_version <= '3.4'
scipy>=0.16.0
matplotlib>=2.0.0
numpy>=1.16.0,!=1.19.0; python_version >= '3.5'
numpy>=1.16.0,<1.17.0; python_version <= '3.4'
numpy>=1.16.0,!=1.19.0
pillow
h5py>=2.5,<=3.1.0; python_version <= '3.6'
h5py>=2.5; python_version > '3.6'
h5py>=2.5
jinja2
mpld3>=0.3
requests>=1.2.1
Expand Down Expand Up @@ -42,9 +38,3 @@ htchirp >= 2.0
Sphinx>=1.5.0,<2.0.0
sphinx-rtd-theme
sphinxcontrib-programoutput>=0.11

# required due to ecosystem incompatibility with 2.7
# and several samplers which do depend on it
# REMOVE when we drop 2.7 support or corner has a new release
# and 2.2.0 is taken removed or samplers exclude its version
corner < 2.2.0; python_version < '3.6'
18 changes: 6 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,14 @@
install_requires = setup_requires + ['Mako>=1.0.1',
'cython>=0.29',
'decorator>=3.4.2',
'numpy>=1.16.0,!=1.19.0; python_version >= "3.5"',
'numpy>=1.16.0,<1.17.0; python_version <= "2.7"',
'scipy>=0.16.0; python_version >= "3.5"',
'scipy>=0.16.0,<1.3.0; python_version <= "3.4"',
'numpy>=1.16.0,!=1.19.0',
'scipy>=0.16.0',
'matplotlib>=1.5.1',
'pillow',
'h5py>=2.5,<=3.1.0; python_version <= "3.6"',
'h5py>=2.5; python_version > "3.6"',
'h5py>=2.5',
'jinja2',
'lalsuite',
'astropy>=2.0.3,<3.0.0; python_version <= "2.7"',
'astropy>=2.0.3,!=4.2.1,!=4.0.5; python_version > "3.0"',
'astropy>=2.0.3,!=4.2.1,!=4.0.5',
'mpld3>=0.3',
'lscsoft-glue>=1.59.3',
'requests>=1.2.1',
Expand Down Expand Up @@ -125,7 +121,7 @@ def __getattr__(self, attr):
vinfo = _version_helper.generate_git_version_info()
except:
vinfo = vdummy()
vinfo.version = '1.18.dev4'
vinfo.version = '2.0.dev0'
vinfo.release = 'False'

with open('pycbc/version.py', 'wb') as f:
Expand Down Expand Up @@ -301,11 +297,9 @@ def run(self):
'pycbc.results': find_files('pycbc/results'),
'pycbc.tmpltbank': find_files('pycbc/tmpltbank')},
ext_modules = ext,
python_requires='>=2.7',
python_requires='>=3.7',
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
Expand Down
30 changes: 13 additions & 17 deletions tools/docker_build_dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,22 @@ fi

if [ "x${PYCBC_CONTAINER}" == "xpycbc_rhel_virtualenv" ]; then

ENV_OS="x86_64_rhel_7"
yum -y install python2-pip python-setuptools which
yum -y install curl
curl http://download.pegasus.isi.edu/wms/download/rhel/7/pegasus.repo > /etc/yum.repos.d/pegasus.repo
ENV_OS="x86_64_rhel_8"
yum -y install python38 python38-devel
yum -y groupinstall "Development Tools"
yum -y install which
yum clean all
yum makecache
yum -y install openssl-devel openssl-static
yum -y install pegasus-4.9.3
yum -y install openssl-devel
yum -y install ligo-proxy-utils
yum -y install ecp-cookie-init
yum -y install python-virtualenv
yum -y install python3-virtualenv
yum -y install hdf5-static libxml2-static zlib-static libstdc++-static cfitsio-static glibc-static fftw-static gsl-static --skip-broken

CVMFS_PATH=/cvmfs/oasis.opensciencegrid.org/ligo/sw/pycbc/${ENV_OS}/virtualenv
mkdir -p ${CVMFS_PATH}

VENV_PATH=${CVMFS_PATH}/pycbc-${SOURCE_TAG}
virtualenv ${VENV_PATH}
virtualenv -p python3.8 ${VENV_PATH}
echo 'export PYTHONUSERBASE=${VIRTUAL_ENV}/.local' >> ${VENV_PATH}/bin/activate
echo "export XDG_CACHE_HOME=\${HOME}/cvmfs-pycbc-${SOURCE_TAG}/.cache" >> ${VENV_PATH}/bin/activate
source ${VENV_PATH}/bin/activate
Expand All @@ -62,8 +60,8 @@ if [ "x${PYCBC_CONTAINER}" == "xpycbc_rhel_virtualenv" ]; then
echo -e "[easy_install]\\nzip_ok = false\\n" > ${VIRTUAL_ENV}/.local/.pydistutils.cfg

echo -e "\\n>> [`date`] Upgrading pip and setuptools"
pip install --upgrade pip setuptools
pip install six packaging appdirs
pip install --upgrade pip setuptools pytest
pip install six packaging appdirs mkl

echo -e "\\n>> [`date`] Installing PyCBC dependencies from requirements.txt"
cd /pycbc
Expand All @@ -76,8 +74,12 @@ if [ "x${PYCBC_CONTAINER}" == "xpycbc_rhel_virtualenv" ]; then
echo -e "\\n>> [`date`] Installing ipython and jupyter"
pip install jupyter

echo -e "\\n>> [`date`] Running basic tests"
pytest

cat << EOF >> $VIRTUAL_ENV/bin/activate
# if a suitable MKL exists, set it up
if [ -f /opt/intel/composer_xe_2015/mkl/bin/mklvars.sh ] ; then
# location on syracuse cluster
Expand All @@ -99,12 +101,6 @@ EOF

deactivate

echo -e "\\n>> [`date`] Running test_coinc_search_workflow.sh"
mkdir -p /pycbc/workflow-test
pushd /pycbc/workflow-test
/pycbc/tools/test_coinc_search_workflow.sh ${VENV_PATH} ${SOURCE_TAG}
popd

if [ "x${DOCKER_SECURE_ENV_VARS}" == "xtrue" ] ; then
echo -e "\\n>> [`date`] Setting virtual environment permissions for deployment"
find ${VENV_PATH} -type d -exec chmod go+rx {} \;
Expand Down

0 comments on commit f583f4f

Please sign in to comment.