Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

note an alternative for running src packages locally. #1661

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions source/discussions/src-layout-vs-flat-layout.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,22 @@ 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>`
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:
interface can not be run directly from the :term:`source tree <Project Source Tree>`.

To run a command-line interface directly, you can install the package in
:doc:`Development Mode <setuptools:userguide/development_mode>` for testing purposes.

Since this can be unpractical in some situations, you can also either:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Since this can be unpractical in some situations, you can also either:
Since this can be impractical in some situations, you can also either:


Run :file:`__main__.py` via:

.. code-block:: bash

cd src/
python -m awesome_package

Or prepend the package folder to Python's :py:data:`sys.path` when called via its
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these are options, they should probably be bullet points. It's weird to have two consequent paragraphs ending with a colon.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:file:`__main__.py` file:

.. code-block:: python

Expand Down
Loading