Skip to content

How to get the pathpath / sys.path correct with doit when using a src directory  #465

@rhubarb

Description

@rhubarb

I don't have a setup.py but I do organize under top-level src/ and test/ directories.
This means to run pytest from my project base, I need to add "src" to my pythonpath.
I solved that with a setting in pyproject.toml using a feature of pytest described in the answer to this problem: https://stackoverflow.com/questions/50155464/using-pytest-with-a-src-layer

This is enough for "doit test" to run a simple test task for me.

But I want other imports from my code base - Settings, etc - that require the system path to have ./src in it (where . is the doit's base directory - where dodo.py lives)
I've searched for dodo.py examples and haven't seen anyone with this.
I'm forced to set PYTHONPATH before running doit every time.

Perhaps we could have a feature where doit's configuration can include a pythonpath dir, like the aforementioned pytest feature?
Or is there a better way?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions