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

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

Open
rhubarb opened this issue Dec 5, 2023 · 0 comments

Comments

@rhubarb
Copy link

rhubarb commented Dec 5, 2023

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?

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant