Repository: pyccel/pyccel (language: python)

Issue:
Allow the user to do `from pyccel import epyccel`
### Describe the feature
I would like to be able to import `epyccel` directly from Pyccel.

### Test Code
Provide code which does not currently work but which should do when this issue is fixed:
```python
from pyccel import epyccel

def func():
     return 1

new_func = epyccel(func)
```

### Proposed Solution
The file `epyccel.py` should be moved to `pyccel/commands/epyccel.py` and `pyccel/__init__.py` should be modified to allow importing `epyccel` directly

### Pitfalls
This change will make the old code `from pyccel.epyccel import epyccel` invalid. Unfortunately it is not possible for the 2 syntaxes to exist. This change should therefore be made in the new major version (which is in preparation).


Discussion / hints:

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b6803082eb..b6631d2353 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -41,6 +41,7 @@ All notable changes to this project will be documented in this file.
 
 ### Changed
 
+-   #1836 : Move `epyccel` module to `pyccel.commands.epyccel` and add support for shortcut import `from pyccel import epyccel`.
 -   #1720 : functions with the `@inline` decorator are no longer exposed to Python in the shared library.
 -   #1720 : Error raised when incompatible arguments are passed to an `inlined` function is now fatal.
 -   \[TESTS\] Filter out cast warnings in cast tests.
diff --git a/docs/quickstart.md b/docs/quickstart.md
index 8abc7d0420..ccdf786c04 100644
--- a/docs/quickstart.md
+++ b/docs/quickstart.md
@@ -393,7 +393,7 @@ end module mod
 In addition to the `pyccel` command, the Pyccel library provides the `epyccel` Python function, whose name stands for "embedded Pyccel": given a pure Python function `f` with type annotations, `epyccel` returns a "pyccelised" function `f_fast` that can be used in the same Python session.
 For example:
 ```python
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 from mod import f
 
 f_fast = epyccel(f)
@@ -434,7 +434,7 @@ Finally we compare the timings obtained on an Intel Core 3 architecture.
 ```bash
 In [1]: from numpy.random import random
 In [2]: from mod import quicksort
-In [3]: from pyccel.epyccel import epyccel
+In [3]: from pyccel import epyccel
 
 In [4]: quicksort_fast = epyccel(quicksort)
 In [5]: x = random(100)
diff --git a/pyccel/__init__.py b/pyccel/__init__.py
index ecc56a0380..4703d5cd51 100644
--- a/pyccel/__init__.py
+++ b/pyccel/__init__.py
@@ -1,2 +1,3 @@
 from .version import __version__
+from .commands.epyccel import epyccel
 from .commands.lambdify import lambdify
diff --git a/pyccel/epyccel.py b/pyccel/commands/epyccel.py
similarity index 95%
rename from pyccel/epyccel.py
rename to pyccel/commands/epyccel.py
index 88861a26e3..e18a467c6f 100644
--- a/pyccel/epyccel.py
+++ b/pyccel/commands/epyccel.py
@@ -3,7 +3,8 @@
 # This file is part of Pyccel which is released under MIT License. See the LICENSE file or #
 # go to https://github.com/pyccel/pyccel/blob/master/LICENSE for full license details.     #
 #------------------------------------------------------------------------------------------#
-
+""" File containing functions for calling Pyccel interactively (epyccel and epyccel_seq)
+"""
 
 import inspect
 import importlib
@@ -24,23 +25,37 @@
 
 #==============================================================================
 def get_source_function(func):
+    """
+    Get the source code from a function.
+
+    Get a string containing the source code of a function from a function
+    object. Excessive indenting is stripped away.
+
+    Parameters
+    ----------
+    func : Function
+        A Python function.
+
+    Returns
+    -------
+    str
+        A string containing the source code.
+
+    Raises
+    ------
+    TypeError
+        A type error is raised if the object passed to the function is not
+        callable.
+    """
     if not callable(func):
         raise TypeError('Expecting a callable function')
 
-    lines = inspect.getsourcelines(func)
-    lines = lines[0]
+    lines, _ = inspect.getsourcelines(func)
     # remove indentation if the first line is indented
     a = lines[0]
     leading_spaces = len(a) - len(a.lstrip())
-    code = ''
-    for a in lines:
-        if leading_spaces > 0:
-            line = a[leading_spaces:]
-        else:
-            line = a
-        code = '{code}{line}'.format(code=code, line=line)
 
-    return code
+    return ''.join(a[leading_spaces:] for a in lines)
 
 #==============================================================================
 def get_unique_name(prefix, path):
diff --git a/pyccel/commands/lambdify.py b/pyccel/commands/lambdify.py
index 4d60c8318b..510bb1ae5b 100644
--- a/pyccel/commands/lambdify.py
+++ b/pyccel/commands/lambdify.py
@@ -5,7 +5,7 @@
 import sympy as sp
 from packaging import version
 
-from pyccel.epyccel import epyccel
+from pyccel.commands.epyccel import epyccel
 from pyccel.utilities.strings import random_string
 
 if version.parse(sp.__version__) >= version.parse('1.8'):


Test patch:
diff --git a/tests/epyccel/recognised_functions/test_cmath_funcs.py b/tests/epyccel/recognised_functions/test_cmath_funcs.py
index 6558424fab..51b40fa9d6 100644
--- a/tests/epyccel/recognised_functions/test_cmath_funcs.py
+++ b/tests/epyccel/recognised_functions/test_cmath_funcs.py
@@ -7,7 +7,7 @@
 from numpy.random import rand, uniform
 from numpy import isclose
 
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 from pyccel.decorators import template
 
 RTOL = sys.float_info.epsilon*1000
diff --git a/tests/epyccel/recognised_functions/test_epyccel_pyc_math.py b/tests/epyccel/recognised_functions/test_epyccel_pyc_math.py
index 56728d1e5d..a73155c0fa 100644
--- a/tests/epyccel/recognised_functions/test_epyccel_pyc_math.py
+++ b/tests/epyccel/recognised_functions/test_epyccel_pyc_math.py
@@ -4,7 +4,7 @@
 from numpy.random import randint, uniform
 from numpy import isclose
 
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 RTOL = 2e-14
 ATOL = 1e-15
diff --git a/tests/epyccel/recognised_functions/test_math_funcs.py b/tests/epyccel/recognised_functions/test_math_funcs.py
index c2b6e43792..c49453aa37 100644
--- a/tests/epyccel/recognised_functions/test_math_funcs.py
+++ b/tests/epyccel/recognised_functions/test_math_funcs.py
@@ -6,7 +6,7 @@
 from numpy.random import rand, randint, uniform
 from numpy import isclose
 
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 from pyccel.decorators import template
 
 
diff --git a/tests/epyccel/recognised_functions/test_numpy_funcs.py b/tests/epyccel/recognised_functions/test_numpy_funcs.py
index 930f48e30b..2642ff227b 100644
--- a/tests/epyccel/recognised_functions/test_numpy_funcs.py
+++ b/tests/epyccel/recognised_functions/test_numpy_funcs.py
@@ -7,7 +7,7 @@
 import numpy as np
 
 from pyccel.decorators import template, types
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 min_int8 = iinfo('int8').min
 max_int8 = iinfo('int8').max
diff --git a/tests/epyccel/recognised_functions/test_numpy_types.py b/tests/epyccel/recognised_functions/test_numpy_types.py
index 01a285320e..0a410a3912 100644
--- a/tests/epyccel/recognised_functions/test_numpy_types.py
+++ b/tests/epyccel/recognised_functions/test_numpy_types.py
@@ -10,7 +10,7 @@
 from test_numpy_funcs import matching_types
 
 from pyccel.decorators import template
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 numpy_basic_types_deprecated = tuple(int(v) for v in np.version.version.split('.'))>=(1,24,0)
 
diff --git a/tests/epyccel/test_array_as_func_args.py b/tests/epyccel/test_array_as_func_args.py
index 879eadb9ef..0b651933e6 100644
--- a/tests/epyccel/test_array_as_func_args.py
+++ b/tests/epyccel/test_array_as_func_args.py
@@ -6,7 +6,7 @@
 import numpy as np
 from numpy.random import randint, uniform
 
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 from pyccel.decorators import template
 
 int_types = ['int8', 'int16', 'int32', 'int64']
diff --git a/tests/epyccel/test_arrays.py b/tests/epyccel/test_arrays.py
index 37bab0f153..fdac39bbad 100644
--- a/tests/epyccel/test_arrays.py
+++ b/tests/epyccel/test_arrays.py
@@ -4,7 +4,7 @@
 from numpy import iinfo, finfo
 from numpy.random import randint, uniform
 
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 from modules        import arrays
 
 RTOL = 1e-12
diff --git a/tests/epyccel/test_arrays_multiple_assignments.py b/tests/epyccel/test_arrays_multiple_assignments.py
index b7be052a85..264b2234bb 100644
--- a/tests/epyccel/test_arrays_multiple_assignments.py
+++ b/tests/epyccel/test_arrays_multiple_assignments.py
@@ -4,7 +4,7 @@
 import warnings
 import pytest
 
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 from pyccel.decorators import stack_array
 from pyccel.errors.errors import Errors, PyccelSemanticError
 from pyccel.errors.messages import (ARRAY_REALLOCATION,
diff --git a/tests/epyccel/test_bitwise.py b/tests/epyccel/test_bitwise.py
index aa37294d50..f90cdee5d4 100644
--- a/tests/epyccel/test_bitwise.py
+++ b/tests/epyccel/test_bitwise.py
@@ -1,7 +1,7 @@
 # pylint: disable=missing-function-docstring, missing-module-docstring
 import pytest
 
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 from modules import bitwise
 
 @pytest.mark.parametrize("a, b",[(True, False),(True, True)])
diff --git a/tests/epyccel/test_builtins.py b/tests/epyccel/test_builtins.py
index 6acab05ffa..bf3f583b95 100644
--- a/tests/epyccel/test_builtins.py
+++ b/tests/epyccel/test_builtins.py
@@ -4,7 +4,7 @@
 from numpy import iinfo, finfo
 import numpy as np
 
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 from pyccel.decorators import template
 
 ATOL = 1e-15
diff --git a/tests/epyccel/test_class_expressions.py b/tests/epyccel/test_class_expressions.py
index 09bb42431b..f89d75a472 100644
--- a/tests/epyccel/test_class_expressions.py
+++ b/tests/epyccel/test_class_expressions.py
@@ -2,7 +2,7 @@
 import numpy as np
 import pytest
 from numpy.random import randint
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 def test_complex_imag(language):
     def f():
diff --git a/tests/epyccel/test_default_precision_template.py b/tests/epyccel/test_default_precision_template.py
index 222f101970..e6325f0202 100644
--- a/tests/epyccel/test_default_precision_template.py
+++ b/tests/epyccel/test_default_precision_template.py
@@ -4,7 +4,7 @@
 from numpy import isclose
 import numpy as np
 
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 from pyccel.decorators import template
 
 RTOL = 1e-12
diff --git a/tests/epyccel/test_docstrings.py b/tests/epyccel/test_docstrings.py
index 54a6e0c83b..8e990d7c4a 100644
--- a/tests/epyccel/test_docstrings.py
+++ b/tests/epyccel/test_docstrings.py
@@ -1,5 +1,5 @@
 # pylint: disable=missing-function-docstring, missing-module-docstring
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 def pad_docstrings(python_doc, pyccel_doc):
     # Remove empty lines as ast does not preserve them
diff --git a/tests/epyccel/test_epyccel_IfTernaryOperator.py b/tests/epyccel/test_epyccel_IfTernaryOperator.py
index 1b55a62781..6bf564805f 100644
--- a/tests/epyccel/test_epyccel_IfTernaryOperator.py
+++ b/tests/epyccel/test_epyccel_IfTernaryOperator.py
@@ -2,7 +2,7 @@
 
 import pytest
 
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 # wp suffix means With Parentheses
 #------------------------------------------------------------------------------
 def test_f1(language):
diff --git a/tests/epyccel/test_epyccel_augassign.py b/tests/epyccel/test_epyccel_augassign.py
index 931f75e27d..66b5fd479d 100644
--- a/tests/epyccel/test_epyccel_augassign.py
+++ b/tests/epyccel/test_epyccel_augassign.py
@@ -4,7 +4,7 @@
 import pytest
 
 import modules.augassign as mod
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 # += tests
 RTOL = 1e-12
diff --git a/tests/epyccel/test_epyccel_classes.py b/tests/epyccel/test_epyccel_classes.py
index bbca99c2a3..39098a24c6 100644
--- a/tests/epyccel/test_epyccel_classes.py
+++ b/tests/epyccel/test_epyccel_classes.py
@@ -2,7 +2,7 @@
 import pytest
 import numpy as np
 import modules.expose_classes as mod
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 RTOL = 2e-14
 ATOL = 1e-15
diff --git a/tests/epyccel/test_epyccel_complex_func.py b/tests/epyccel/test_epyccel_complex_func.py
index bc2fbd0b4d..cf037ca373 100644
--- a/tests/epyccel/test_epyccel_complex_func.py
+++ b/tests/epyccel/test_epyccel_complex_func.py
@@ -5,7 +5,7 @@
 from numpy.random import rand, randint
 
 import modules.complex_func as mod
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 ATOL = 1e-15
 RTOL = 2e-14
diff --git a/tests/epyccel/test_epyccel_decorators.py b/tests/epyccel/test_epyccel_decorators.py
index dd5f70576f..2fe345c29e 100644
--- a/tests/epyccel/test_epyccel_decorators.py
+++ b/tests/epyccel/test_epyccel_decorators.py
@@ -3,7 +3,7 @@
 
 import pytest
 import numpy as np
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 from pyccel.decorators import private, inline, template
 
 @pytest.mark.parametrize( 'lang', (
diff --git a/tests/epyccel/test_epyccel_default_args.py b/tests/epyccel/test_epyccel_default_args.py
index 40ae26a794..256dc8b9f3 100644
--- a/tests/epyccel/test_epyccel_default_args.py
+++ b/tests/epyccel/test_epyccel_default_args.py
@@ -3,7 +3,7 @@
 import pytest
 import numpy as np
 
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 #------------------------------------------------------------------------------
 def test_f1(language):
diff --git a/tests/epyccel/test_epyccel_division.py b/tests/epyccel/test_epyccel_division.py
index 4fc468060a..11aec7a20c 100644
--- a/tests/epyccel/test_epyccel_division.py
+++ b/tests/epyccel/test_epyccel_division.py
@@ -2,7 +2,7 @@
 from numpy.random import randint, uniform
 from numpy import isclose
 
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 RTOL = 2e-14
 ATOL = 1e-15
diff --git a/tests/epyccel/test_epyccel_functions.py b/tests/epyccel/test_epyccel_functions.py
index bdc8bd1db0..1860bc2bbc 100644
--- a/tests/epyccel/test_epyccel_functions.py
+++ b/tests/epyccel/test_epyccel_functions.py
@@ -5,7 +5,7 @@
 import pytest
 import numpy as np
 
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 RTOL = 2e-14
 ATOL = 1e-15
diff --git a/tests/epyccel/test_epyccel_garbage_collection.py b/tests/epyccel/test_epyccel_garbage_collection.py
index fcb0d3557c..3340cf612e 100644
--- a/tests/epyccel/test_epyccel_garbage_collection.py
+++ b/tests/epyccel/test_epyccel_garbage_collection.py
@@ -2,7 +2,7 @@
 import gc
 import sys
 import numpy as np
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 def test_return_pointer(language):
     def return_pointer(x : 'float[:]'):
diff --git a/tests/epyccel/test_epyccel_generators.py b/tests/epyccel/test_epyccel_generators.py
index b8ab776985..15f352dc29 100644
--- a/tests/epyccel/test_epyccel_generators.py
+++ b/tests/epyccel/test_epyccel_generators.py
@@ -3,7 +3,7 @@
 import numpy as np
 from numpy.random import randint, rand
 
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 def test_sum_range(language):
     def f(a0 : 'int[:]'):
diff --git a/tests/epyccel/test_epyccel_headers.py b/tests/epyccel/test_epyccel_headers.py
index 08dfb54f58..8fdb86c6ee 100644
--- a/tests/epyccel/test_epyccel_headers.py
+++ b/tests/epyccel/test_epyccel_headers.py
@@ -6,7 +6,7 @@
 
 import pytest
 
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 from pyccel.errors.errors import PyccelSemanticError, Errors
 from pyccel.decorators import allow_negative_index, stack_array
 
diff --git a/tests/epyccel/test_epyccel_lists.py b/tests/epyccel/test_epyccel_lists.py
index 5fe655cdb2..50d1a75327 100644
--- a/tests/epyccel/test_epyccel_lists.py
+++ b/tests/epyccel/test_epyccel_lists.py
@@ -1,7 +1,7 @@
 # pylint: disable=missing-function-docstring, missing-module-docstring
 import pytest
 import numpy as np
-from  pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 @pytest.fixture( params=[
         pytest.param("fortran", marks = [
diff --git a/tests/epyccel/test_epyccel_mod.py b/tests/epyccel/test_epyccel_mod.py
index c7a5f72f8b..d84ec1743a 100644
--- a/tests/epyccel/test_epyccel_mod.py
+++ b/tests/epyccel/test_epyccel_mod.py
@@ -4,7 +4,7 @@
 from numpy.random import randint, uniform
 from numpy import allclose
 
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 # Relative and absolute tolerances for array comparisons in the form
 # numpy.isclose(a, b, rtol, atol). Windows has larger round-off errors.
diff --git a/tests/epyccel/test_epyccel_modules.py b/tests/epyccel/test_epyccel_modules.py
index 963219e6d4..445e8dc457 100644
--- a/tests/epyccel/test_epyccel_modules.py
+++ b/tests/epyccel/test_epyccel_modules.py
@@ -1,6 +1,6 @@
 # pylint: disable=missing-function-docstring, missing-module-docstring
 import numpy as np
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 RTOL = 2e-14
 ATOL = 1e-15
diff --git a/tests/epyccel/test_epyccel_multi_rank.py b/tests/epyccel/test_epyccel_multi_rank.py
index 49959a31dc..ccad90c407 100644
--- a/tests/epyccel/test_epyccel_multi_rank.py
+++ b/tests/epyccel/test_epyccel_multi_rank.py
@@ -4,7 +4,7 @@
 from numpy.random import rand, randint
 
 from modules        import multi_rank
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 @pytest.mark.parametrize('f1',[multi_rank.add_mixed_order,
     multi_rank.mul_mixed_order,
diff --git a/tests/epyccel/test_epyccel_openmp.py b/tests/epyccel/test_epyccel_openmp.py
index d7b2b8fd85..5da3446a17 100644
--- a/tests/epyccel/test_epyccel_openmp.py
+++ b/tests/epyccel/test_epyccel_openmp.py
@@ -8,7 +8,7 @@
 
 from numpy import random
 from numpy import matmul
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 #==============================================================================
 
 
diff --git a/tests/epyccel/test_epyccel_optional_args.py b/tests/epyccel/test_epyccel_optional_args.py
index a0f5071dc7..8836a965d0 100644
--- a/tests/epyccel/test_epyccel_optional_args.py
+++ b/tests/epyccel/test_epyccel_optional_args.py
@@ -3,7 +3,7 @@
 import pytest
 import numpy as np
 
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 RTOL = 2e-14
 ATOL = 1e-15
diff --git a/tests/epyccel/test_epyccel_pow.py b/tests/epyccel/test_epyccel_pow.py
index f0a55056b7..6cfda797b5 100644
--- a/tests/epyccel/test_epyccel_pow.py
+++ b/tests/epyccel/test_epyccel_pow.py
@@ -3,7 +3,7 @@
 from numpy.random import rand, randint, uniform
 from numpy import isclose
 
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 from pyccel.decorators import template
 
 RTOL = 2e-14
diff --git a/tests/epyccel/test_epyccel_python_annotations.py b/tests/epyccel/test_epyccel_python_annotations.py
index dfe2915f22..85a40ed256 100644
--- a/tests/epyccel/test_epyccel_python_annotations.py
+++ b/tests/epyccel/test_epyccel_python_annotations.py
@@ -2,7 +2,7 @@
 import numpy as np
 from numpy.random import randint
 
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 from modules import python_annotations
 
 def test_array_int32_1d_scalar_add(language):
diff --git a/tests/epyccel/test_epyccel_return_arrays.py b/tests/epyccel/test_epyccel_return_arrays.py
index 9038002669..08bb06db6b 100644
--- a/tests/epyccel/test_epyccel_return_arrays.py
+++ b/tests/epyccel/test_epyccel_return_arrays.py
@@ -6,7 +6,7 @@
 from recognised_functions.test_numpy_funcs import (min_int, max_int, min_int8, max_int8,
                                 min_int16, max_int16, min_int32, max_int32, max_int64, min_int64)
 from recognised_functions.test_numpy_funcs import max_float, min_float, max_float32, min_float32,max_float64, min_float64
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 from pyccel.decorators import template
 
 
diff --git a/tests/epyccel/test_epyccel_sets.py b/tests/epyccel/test_epyccel_sets.py
index d467e9bdef..ecae59a87e 100644
--- a/tests/epyccel/test_epyccel_sets.py
+++ b/tests/epyccel/test_epyccel_sets.py
@@ -1,6 +1,6 @@
 # pylint: disable=missing-function-docstring, missing-module-docstring
 import pytest
-from  pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 @pytest.fixture( params=[
         pytest.param("fortran", marks = [
diff --git a/tests/epyccel/test_epyccel_sign.py b/tests/epyccel/test_epyccel_sign.py
index da23555cfb..f9976cb6e5 100644
--- a/tests/epyccel/test_epyccel_sign.py
+++ b/tests/epyccel/test_epyccel_sign.py
@@ -3,7 +3,7 @@
 import numpy as np
 import modules.numpy_sign as mod
 
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 def test_sign_complex(language):
     f_nul = mod.complex_nul
diff --git a/tests/epyccel/test_epyccel_transpose.py b/tests/epyccel/test_epyccel_transpose.py
index e01f007e34..023fa9f3fe 100644
--- a/tests/epyccel/test_epyccel_transpose.py
+++ b/tests/epyccel/test_epyccel_transpose.py
@@ -2,7 +2,7 @@
 from numpy import empty, array_equal
 from numpy.random import randint
 
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 
 def test_transpose_shape(language):
diff --git a/tests/epyccel/test_epyccel_types.py b/tests/epyccel/test_epyccel_types.py
index 1f4b2a9969..eb8dd330a5 100644
--- a/tests/epyccel/test_epyccel_types.py
+++ b/tests/epyccel/test_epyccel_types.py
@@ -4,7 +4,7 @@
 from numpy.random import randint, uniform
 
 from modules import types
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 def test_int_default(language):
     f1 = types.test_int_default
diff --git a/tests/epyccel/test_epyccel_variable_annotations.py b/tests/epyccel/test_epyccel_variable_annotations.py
index 52a3991808..5927f58373 100644
--- a/tests/epyccel/test_epyccel_variable_annotations.py
+++ b/tests/epyccel/test_epyccel_variable_annotations.py
@@ -6,7 +6,7 @@
 
 import pytest
 
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 from pyccel.errors.errors import PyccelSemanticError, Errors
 from pyccel.decorators import allow_negative_index, stack_array
 
diff --git a/tests/epyccel/test_external_functions.py b/tests/epyccel/test_external_functions.py
index 42e8e9d5f6..e96f29de3b 100644
--- a/tests/epyccel/test_external_functions.py
+++ b/tests/epyccel/test_external_functions.py
@@ -4,7 +4,7 @@
 import numpy as np
 import scipy.linalg.blas as sp_blas
 import modules.external_functions as mod
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 # ==============================================================================
 @pytest.mark.fortran
diff --git a/tests/epyccel/test_function_call_before_definition.py b/tests/epyccel/test_function_call_before_definition.py
index 8f3a12b7db..a35116daf3 100644
--- a/tests/epyccel/test_function_call_before_definition.py
+++ b/tests/epyccel/test_function_call_before_definition.py
@@ -3,7 +3,7 @@
 import modules.function_call_before_definition as mod1
 import modules.function_call_before_definition_2 as mod2
 
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 @pytest.mark.parametrize( 'language', (
         pytest.param("fortran", marks = pytest.mark.fortran),
diff --git a/tests/epyccel/test_functionals.py b/tests/epyccel/test_functionals.py
index 81c9381fc5..f30c7d2279 100644
--- a/tests/epyccel/test_functionals.py
+++ b/tests/epyccel/test_functionals.py
@@ -2,7 +2,7 @@
 from numpy.random import randint
 from numpy import equal
 
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 from modules import functionals
 
 def compare_epyccel(f, language, *args):
diff --git a/tests/epyccel/test_generic_functions.py b/tests/epyccel/test_generic_functions.py
index 6031cc7eee..f751964be4 100644
--- a/tests/epyccel/test_generic_functions.py
+++ b/tests/epyccel/test_generic_functions.py
@@ -3,7 +3,7 @@
 import numpy as np
 import modules.generic_functions as mod
 import modules.generic_functions_2 as mod2
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 @pytest.fixture(scope="module")
 def modnew(language):
diff --git a/tests/epyccel/test_higherorder_functions.py b/tests/epyccel/test_higherorder_functions.py
index e0b002b45e..9b1a5c1f4b 100644
--- a/tests/epyccel/test_higherorder_functions.py
+++ b/tests/epyccel/test_higherorder_functions.py
@@ -2,7 +2,7 @@
 import pytest
 import numpy as np
 import modules.highorder_functions as mod
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 @pytest.fixture(scope="module")
 def modnew(language):
diff --git a/tests/epyccel/test_imports.py b/tests/epyccel/test_imports.py
index 5ff8dc5755..364d29b157 100644
--- a/tests/epyccel/test_imports.py
+++ b/tests/epyccel/test_imports.py
@@ -3,7 +3,7 @@
 import pytest
 from numpy import ones
 
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 #------------------------------------------------------------------------------
 @pytest.fixture(params=[
diff --git a/tests/epyccel/test_kind.py b/tests/epyccel/test_kind.py
index b5ee1c5d94..d3e7f1e1c8 100644
--- a/tests/epyccel/test_kind.py
+++ b/tests/epyccel/test_kind.py
@@ -1,6 +1,6 @@
 # pylint: disable=missing-function-docstring, missing-module-docstring
 import platform
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 def test_or_boolean(language):
     def or_bool(a : 'bool', b : 'bool'):
diff --git a/tests/epyccel/test_loops.py b/tests/epyccel/test_loops.py
index 85987a196c..3b24578f3f 100644
--- a/tests/epyccel/test_loops.py
+++ b/tests/epyccel/test_loops.py
@@ -2,8 +2,9 @@
 import pytest
 import numpy as np
 
-from pyccel.epyccel import epyccel
-from modules        import loops
+from modules import loops
+
+from pyccel import epyccel
 
 #==============================================================================
 
diff --git a/tests/epyccel/test_mpi_collective.py b/tests/epyccel/test_mpi_collective.py
index eb4bd58d9d..0f3a81407d 100644
--- a/tests/epyccel/test_mpi_collective.py
+++ b/tests/epyccel/test_mpi_collective.py
@@ -3,7 +3,7 @@
 import numpy as np
 import pytest
 
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 from modules        import mpi_collective as pmod
 
 #==============================================================================
diff --git a/tests/epyccel/test_mpi_point_to_point.py b/tests/epyccel/test_mpi_point_to_point.py
index ad8c786dd6..bbd2bf4421 100644
--- a/tests/epyccel/test_mpi_point_to_point.py
+++ b/tests/epyccel/test_mpi_point_to_point.py
@@ -3,8 +3,9 @@
 import numpy as np
 import pytest
 
-from pyccel.epyccel import epyccel
-from modules        import mpi_point_to_point as pmod
+from modules import mpi_point_to_point as pmod
+
+from pyccel import epyccel
 
 #==============================================================================
 # IMPORT MODULE TO BE TESTED, EPYCCELIZE IT, AND MAKE IT AVAILABLE TO ALL PROCS
diff --git a/tests/epyccel/test_multiple_results.py b/tests/epyccel/test_multiple_results.py
index 4ed797c8ff..175964b412 100644
--- a/tests/epyccel/test_multiple_results.py
+++ b/tests/epyccel/test_multiple_results.py
@@ -1,6 +1,6 @@
 # pylint: disable=missing-function-docstring, missing-module-docstring
 from pyccel.decorators import pure
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 #==============================================================================
 def compare_epyccel(f1, *args, language):
diff --git a/tests/epyccel/test_parallel_epyccel.py b/tests/epyccel/test_parallel_epyccel.py
index 0711fb8c5f..403f4c6e34 100644
--- a/tests/epyccel/test_parallel_epyccel.py
+++ b/tests/epyccel/test_parallel_epyccel.py
@@ -3,7 +3,7 @@
 import pytest
 import numpy as np
 
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 RTOL = 2e-14
 ATOL = 1e-15
diff --git a/tests/epyccel/test_pointers.py b/tests/epyccel/test_pointers.py
index 2778fe9fb0..27fdc65d41 100644
--- a/tests/epyccel/test_pointers.py
+++ b/tests/epyccel/test_pointers.py
@@ -5,7 +5,7 @@
 
 from modules import pointers as pointers_module
 from modules import return_pointers
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 pointers_funcs = [(f, getattr(pointers_module,f)) for f in pointers_module.__all__ if inspect.isfunction(getattr(pointers_module,f))]
 
diff --git a/tests/epyccel/test_return.py b/tests/epyccel/test_return.py
index eb5c7fd4ce..ce0300b660 100644
--- a/tests/epyccel/test_return.py
+++ b/tests/epyccel/test_return.py
@@ -1,6 +1,6 @@
 # pylint: disable=missing-function-docstring, missing-module-docstring, reimported
 import numpy as np
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 def test_single_return_var_assign(language):
     def single_return_var_assign():
diff --git a/tests/epyccel/test_strings.py b/tests/epyccel/test_strings.py
index de642438a1..3e06bd59fa 100644
--- a/tests/epyccel/test_strings.py
+++ b/tests/epyccel/test_strings.py
@@ -2,7 +2,7 @@
 import inspect
 import pytest
 
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 from modules import strings as strings_module
 
 string_funcs = [(f, getattr(strings_module,f)) for f in strings_module.__all__ if inspect.isfunction(getattr(strings_module,f))]
diff --git a/tests/epyccel/test_tuples.py b/tests/epyccel/test_tuples.py
index 29b889aa4e..33a2bf83b5 100644
--- a/tests/epyccel/test_tuples.py
+++ b/tests/epyccel/test_tuples.py
@@ -3,7 +3,7 @@
 import pytest
 import numpy as np
 
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 from modules import tuples as tuples_module
 
 def is_func_with_0_args(f):
diff --git a/tests/epyccel/utilities.py b/tests/epyccel/utilities.py
index f714a14fcd..ee4a9e7931 100644
--- a/tests/epyccel/utilities.py
+++ b/tests/epyccel/utilities.py
@@ -1,6 +1,6 @@
 # pylint: disable=missing-function-docstring, missing-module-docstring
 import numpy as np
-from pyccel.epyccel import epyccel
+from pyccel import epyccel
 
 
 #==============================================================================
diff --git a/tests/warnings/test_warnings.py b/tests/warnings/test_warnings.py
index 8ce9b89532..fd0b6e4300 100644
--- a/tests/warnings/test_warnings.py
+++ b/tests/warnings/test_warnings.py
@@ -14,7 +14,7 @@
 from pyccel.parser.parser   import Parser
 from pyccel.codegen.codegen import Codegen
 from pyccel.errors.errors   import Errors
-from pyccel.epyccel         import epyccel
+from pyccel                 import epyccel
 
 def get_files_from_folder(foldername):
     base_dir = os.path.dirname(os.path.realpath(__file__))