From 99377545186c93c27e1a72bf230ac11ef2102979 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Apr 28 2020 08:51:46 +0000 Subject: Rework and simplify installation of email_validator dependency Signed-off-by: Neal Gompa --- diff --git a/dev/containers/centos7-rpms-py2 b/dev/containers/centos7-rpms-py2 index 49f2314..391f5d6 100644 --- a/dev/containers/centos7-rpms-py2 +++ b/dev/containers/centos7-rpms-py2 @@ -50,7 +50,7 @@ RUN \ sed -i -e "s|;python_version<=\"2.7\"||" /pagure/requirements.txt && \ sed -i -e "s|python3-openid;python_version>=\"3.0\"||" \ /pagure/requirements.txt && \ - sed -i "/email_validator/d" /pagure/requirements.txt && \ + sed -i "/^email_validator.*/d" /pagure/requirements.txt && \ cd /pagure && python setup.py build diff --git a/files/pagure.spec b/files/pagure.spec index fecb314..963138f 100644 --- a/files/pagure.spec +++ b/files/pagure.spec @@ -45,7 +45,7 @@ Recommends: python%{python_pkgversion}-fedora-flask # We require OpenSSH 7.4+ for SHA256 support Requires: openssh >= 7.4 -%if 0%{?rhel} && 0%{?rhel} < 8 +%if %{undefined python_enable_dependency_generator} && %{undefined python_disable_dependency_generator} Requires: python%{python_pkgversion}-alembic Requires: python%{python_pkgversion}-arrow Requires: python%{python_pkgversion}-bcrypt @@ -56,6 +56,9 @@ Requires: python%{python_pkgversion}-celery Requires: python%{python_pkgversion}-chardet Requires: python%{python_pkgversion}-cryptography Requires: python%{python_pkgversion}-docutils +%if ! (0%{?rhel} && 0%{?rhel} < 8) +Requires: python%{python_pkgversion}-email-validator +%endif Requires: python%{python_pkgversion}-enum34 Requires: python%{python_pkgversion}-flask Requires: python%{python_pkgversion}-flask-wtf @@ -75,10 +78,6 @@ Requires: python%{python_pkgversion}-straight-plugin Requires: python%{python_pkgversion}-wtforms %endif -%if 0%{?rhel} && 0%{?rhel} >= 8 -Requires: python%{python_pkgversion}-email-validator -%endif - %if 0%{?rhel} && 0%{?rhel} < 8 Requires: mod_wsgi %else @@ -212,6 +211,8 @@ of this pagure instance. # Fix requirements.txt for EL7 setuptools ## Remove environment markers, as they're not supported sed -e "s/;python_version.*$//g" -i requirements.txt +## Drop email-validator requirement +sed -e "s/^email_validator.*//g" -i requirements.txt ## Drop python3-openid requirement sed -e "s/^python3-openid$//g" -i requirements.txt %endif diff --git a/requirements.txt b/requirements.txt index bca9f27..dcde36c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,8 @@ chardet cryptography docutils enum34;python_version<"3.4" -email_validator +# this is only needed with wtforms on py3 +email_validator;python_version>="3.0" flask flask-wtf kitchen