Skip to content

Commit

Permalink
note an alternative for running src packages locally.
Browse files Browse the repository at this point in the history
  • Loading branch information
ekohilas committed Nov 25, 2024
1 parent 80ba369 commit bc6377c
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions source/discussions/src-layout-vs-flat-layout.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,18 @@ Running a command-line interface from source with src-layout
============================================================

Due to the firstly mentioned specialty of the src layout, a command-line
interface can not be run directly from the :term:`source tree <Project Source Tree>`,
but requires installation of the package in
:doc:`Development Mode <setuptools:userguide/development_mode>`
interface can not be run directly from the :term:`source tree <Project Source Tree>`.

To run a command-line interface directly, you can either:

Run :file:`__main__.py` via:

.. code-block:: bash
cd src/
python -m awesome_package
Or install the package in :doc:`Development Mode <setuptools:userguide/development_mode>`
for testing purposes. Since this can be unpractical in some situations,
a workaround could be to prepend the package folder to Python's
:py:data:`sys.path` when called via its :file:`__main__.py` file:
Expand Down

0 comments on commit bc6377c

Please sign in to comment.