Skip to content
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

Python3 migration: drop py2-cython and only built it for py3 #7092

Merged
merged 4 commits into from Jul 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontier_client.spec
Expand Up @@ -6,7 +6,7 @@
%define branch cms/%{realversion}
%define github_user cms-externals
Source: git+https://github.com/%{github_user}/%{n}.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}-%{tag}.tgz
Requires: expat pacparser python zlib
Requires: expat pacparser zlib

%prep
%setup -n %{n}-%{realversion}
Expand Down
2 changes: 1 addition & 1 deletion gosam.spec
Expand Up @@ -7,7 +7,7 @@ Source: git+https://github.com/%{github_user}/%{n}.git?obj=%{branch}/%{tag}&expo
Requires: qgraf
Requires: form
Requires: gosamcontrib
Requires: python3 py2-cython
Requires: python3 py3-cython

%prep
%setup -q -n %{n}-%{realversion}
Expand Down
2 changes: 1 addition & 1 deletion lhapdf.spec
Expand Up @@ -14,7 +14,7 @@ Source6: https://www.hepforge.org/archive/lhapdf/pdfsets/6.1/MMHT2014nlo68cl.tar
Source7: lhapdf_pdfsetsindex

Requires: python3
BuildRequires: py2-cython
BuildRequires: py3-cython

%define keep_archives true

Expand Down
1 change: 0 additions & 1 deletion pip/cython.file
@@ -1,2 +1 @@
%define pip_name Cython
%define RelocatePython %{i}/bin/*
2 changes: 1 addition & 1 deletion pip/h5py.file
@@ -1,3 +1,3 @@
Requires: py2-numpy py3-numpy hdf5 py2-six
Requires: py2-cython py3-pkgconfig openmpi
Requires: py3-cython py3-pkgconfig openmpi
%define PipPreBuild export HDF5_DIR=${HDF5_ROOT} CC="mpicc"
2 changes: 1 addition & 1 deletion pip/pandas.file
@@ -1 +1 @@
Requires: py2-six py3-python-dateutil py3-pytz py2-numpy py3-numpy py2-cython
Requires: py2-six py3-python-dateutil py3-pytz py2-numpy py3-numpy py3-cython
4 changes: 2 additions & 2 deletions pip/py2-scipy.file
@@ -1,3 +1,3 @@
Requires: py2-numpy py2-cython
Requires: py2-numpy py3-cython
%define PipPreBuild\
if [[ `gcc --version | head -1 | cut -d' ' -f3 | cut -d. -f1,2,3 | tr -d .` -gt 1000 ]] ; then export FFLAGS="${FFLAGS_OPT} -fallow-argument-mismatch -fPIC" ; fi \
if [[ `gcc --version | head -1 | cut -d' ' -f3 | cut -d. -f1,2,3 | tr -d .` -gt 1000 ]] ; then export FFLAGS="${FFLAGS_OPT} -fallow-argument-mismatch -fPIC" ; fi \
2 changes: 1 addition & 1 deletion pip/py3-numpy.file
@@ -1,2 +1,2 @@
Requires: py2-cython
Requires: py3-cython

2 changes: 1 addition & 1 deletion pip/py3-scipy.file
@@ -1,4 +1,4 @@
Requires: py3-numpy py2-cython py2-wheel py3-pybind11
Requires: py3-numpy py3-cython py2-wheel py3-pybind11

%define PipPreBuild\
if [[ `gcc --version | head -1 | cut -d' ' -f3 | cut -d. -f1,2,3 | tr -d .` -gt 1000 ]] ; then export FFLAGS="${FFLAGS_OPT} -fallow-argument-mismatch -fPIC" ; fi \
2 changes: 1 addition & 1 deletion pip/requirements.txt
Expand Up @@ -63,7 +63,7 @@ contextvars==2.4 ; python_version>'3.0'
coverage==5.5; python_version>'3.0'
cx-Oracle==7.3.0; python_version>'3.0'
cycler==0.10.0; python_version>'3.0'
cython==0.29.22
cython==0.29.23; python_version>'3.0'
decorator==4.4.2; python_version>'3.0'
defusedxml==0.6.0; python_version>'3.0'
deprecation==2.1.0 ; python_version>'3.0'
Expand Down
2 changes: 1 addition & 1 deletion professor2.spec
Expand Up @@ -3,7 +3,7 @@

Source: http://www.hepforge.org/archive/professor/Professor-%{realversion}.tar.gz
Requires: py2-numpy py3-matplotlib root yoda eigen
BuildRequires: py2-cython
BuildRequires: py3-cython

Patch0: professor2-ppc64-flag-change

Expand Down
2 changes: 1 addition & 1 deletion python_tools.spec
Expand Up @@ -140,7 +140,7 @@ Requires: py3-pip
%ifarch x86_64
Requires: py3-cx-Oracle
%endif
Requires: py2-cython
Requires: py3-cython
Requires: py2-future
Requires: py3-pybind11-toolfile
Requires: py3-histbook
Expand Down
4 changes: 3 additions & 1 deletion rivet.spec
Expand Up @@ -5,7 +5,7 @@
Source: git+https://gitlab.com/hepcedar/rivet.git?obj=master/%{n}-%{realversion}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}.tgz

Requires: hepmc fastjet fastjet-contrib yoda
BuildRequires: python py2-cython py2-setuptools autotools
BuildRequires: python3 py3-cython autotools

Patch0: rivet-140-313

Expand Down Expand Up @@ -46,6 +46,7 @@ CXXFLAGS="-std=c++17"
CXXFLAGS="${CXXFLAGS} -msse3"
%endif

PYTHON=$(which python3) \
./configure --disable-silent-rules --prefix=%{i} --with-hepmc=${HEPMC_ROOT} \
--with-fastjet=${FASTJET_ROOT} --with-fjcontrib=${FASTJET_CONTRIB_ROOT} --with-yoda=${YODA_ROOT} \
--disable-doxygen --disable-pdfmanual --with-pic \
Expand All @@ -57,6 +58,7 @@ perl -p -i -e "s|LIBS = $|LIBS = -lHepMC|g" bin/Makefile
make %{makeprocesses} all
%install
make install
sed -i -e 's|^#!.*python.*|#!/usr/bin/env python3|' %{i}/bin/*

%post
%{relocateConfig}bin/rivet-config
Expand Down
2 changes: 1 addition & 1 deletion tensorflow-requires.file
@@ -1,5 +1,5 @@
Requires: python3 py2-numpy py3-mock py2-wheel py3-typing py3-typing_extensions
Requires: py3-keras-applications py3-keras-preprocessing py2-setuptools py2-future py3-wrapt py3-gast py3-setuptools
Requires: py2-cython py2-googlePackages py3-astor py2-six py3-termcolor py3-absl-py
Requires: py3-cython py2-googlePackages py3-astor py2-six py3-termcolor py3-absl-py
Requires: py3-opt-einsum py3-flatbuffers
Requires: eigen protobuf zlib libpng libjpeg-turbo curl pcre giflib sqlite grpc flatbuffers
7 changes: 3 additions & 4 deletions yoda.spec
Expand Up @@ -5,7 +5,7 @@ Source: git+https://gitlab.com/hepcedar/yoda.git?obj=master/%{n}-%{realversion}&
Patch0: yoda_pyroot

Requires: python3 root
BuildRequires: py2-cython autotools
BuildRequires: py3-cython autotools

%prep
%setup -q -n %{n}-%{realversion}
Expand All @@ -17,9 +17,8 @@ autoreconf -fiv

sed -i -e "s|lPyROOT|lcppyyX.X|" ./pyext/setup.py.in

export PYTHON_VERSION=$(python3 --version 2>&1 | sed 's|.* ||' | cut -d. -f1,2)
sed -i -e "s|lcppyy...|lcppyy$(echo ${PYTHON_VERSION} | tr . _)|" ./pyext/setup.py.in
./configure --prefix=%i --enable-root
sed -i -e "s|lcppyy...|lcppyy$(echo %{cms_python3_major_minor_version} | tr . _)|" ./pyext/setup.py.in
PYTHON=$(which python3) ./configure --prefix=%i --enable-root
sed -i "s|env python|env python3|" bin/*
make %{makeprocesses} all
make install
Expand Down