Blame SOURCES/macros.python39

93a1c0
%__python3 /usr/bin/python3.9
93a1c0
%python3_pkgversion 39
88b00c
%__pytest /usr/bin/pytest-3.9
93a1c0
93a1c0
# The following are macros from macros.python3 in Fedora that are newer/different than those in the python3-rpm-macros package in RHEL.
93a1c0
# These macros overwrite/supercede some of the macros in the python3-rpm-macros package in RHEL.
93a1c0
93a1c0
%python3_version %(%{__python3} -Ic "import sys; sys.stdout.write('{0.major}.{0.minor}'.format(sys.version_info))")
93a1c0
%python3_version_nodots %(%{__python3} -Ic "import sys; sys.stdout.write('{0.major}{0.minor}'.format(sys.version_info))")
93a1c0
93a1c0
%py3_install() %{expand:\\\
93a1c0
  CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
93a1c0
  %{__python3} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}
93a1c0
  rm -rfv %{buildroot}%{_bindir}/__pycache__
93a1c0
}
93a1c0
93a1c0
%py3_install_egg() %{expand:\\\
93a1c0
  mkdir -p %{buildroot}%{python3_sitelib}
93a1c0
  CFLAGS="%{optflags}" %{__python3} -m easy_install -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{python3_version}.egg %{?*}
93a1c0
  rm -rfv %{buildroot}%{_bindir}/__pycache__
93a1c0
}
93a1c0
93a1c0
%py3_install_wheel() %{expand:\\\
93a1c0
  CFLAGS="%{optflags}" %{__python3} -m pip install -I dist/%{1} --root %{buildroot} --no-deps --no-index --no-warn-script-location
93a1c0
  rm -rfv %{buildroot}%{_bindir}/__pycache__
93a1c0
  for distinfo in %{buildroot}%{python3_sitelib}/*.dist-info %{buildroot}%{python3_sitearch}/*.dist-info; do
93a1c0
    if [ -f ${distinfo}/direct_url.json ]; then
93a1c0
      rm -fv ${distinfo}/direct_url.json
93a1c0
      sed -i '/direct_url.json/d' ${distinfo}/RECORD
93a1c0
    fi
93a1c0
  done
93a1c0
}