diff --git a/.travis.yml b/.travis.yml
index 15d6c5b24649fa358d99f0cba46c762b862e494a..c5d724c480410fa7eb1aefddb8b9977f3bcb21bb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -38,9 +38,11 @@ jobs:
     - stage: deploy
       python: "3.8"
       before_script:
+        - apt-get update
+        - apt-get install -y patchelf
         - pip install wheel twine doctor-wheel auditwheel snakehouse satella
       script:
-        - python setup.py bdist_wheel sdist
+        - RELEASE=1 python setup.py bdist_wheel sdist
         - cd dist
         - doctor-wheel *.whl
         - auditwheel repair --plat manylinux2014_x86_64 *.whl
@@ -48,9 +50,11 @@ jobs:
     - stage: deploy
       python: "3.9"
       before_script:
+        - apt-get update
+        - apt-get install -y patchelf
         - pip install wheel twine doctor-wheel auditwheel snakehouse satella
       script:
-        - python setup.py bdist_wheel
+        - RELEASE=1 python setup.py bdist_wheel
         - cd dist
         - doctor-wheel *.whl
         - auditwheel repair --plat manylinux2014_x86_64 *.whl
diff --git a/setup.py b/setup.py
index 45a8f8831cb4b214fba64df102337f98c2e8e287..a72b84dcaf937f4072afb049912bec246d32c16e 100644
--- a/setup.py
+++ b/setup.py
@@ -17,7 +17,7 @@ monkey_patch_parallel_compilation()
 directives = {'language_level': '3'}
 ext_kwargs = {}
 cythonize_kwargs = {}
-if 'CI' in os.environ:
+if 'CI' in os.environ and 'RELEASE' not in os.environ:
     ext_kwargs['define_macros'] = [("CYTHON_TRACE_NOGIL", "1")]
     directives.update(profile=True, linetrace=True, embedsignature=True)
     cythonize_kwargs['gdb_debug'] = True