ApeWorX / ApePay

A smart contract payment system built for automated service management
https://apeworx.io/apepay
Apache License 2.0
18 stars 6 forks source link

fix: issue causing `scripts/` to be importable outside of this project [SBK-151] #18

Closed antazoey closed 1 year ago

antazoey commented 1 year ago

fixes: #14 Fixes: SBK-151

To test, run:

python -c "import scripts; print(scripts.__path__)"

from your home directory or somewhere else that is not this repo

I tried everything I could think of for like an hour to avoid having to make a separate src/ dir. I tried using package, include, and exclude to make it so it would not include scripts or tests. It never happened! I don't know why.

But the second i made it look for packages only in the src directory, things were fine.

antazoey commented 1 year ago

@fubuloubu any other ideas or do we just count this as a behavior of poetry? They don't see it as an issue it seems even though the equivalent fix on setup.py projects works. We either have to change the project structure or not use Poetry or accept that tests and scripts will always be added to sys.path

fubuloubu commented 1 year ago

@fubuloubu any other ideas or do we just count this as a behavior of poetry? They don't see it as an issue it seems even though the equivalent fix on setup.py projects works. We either have to change the project structure or not use Poetry or accept that tests and scripts will always be added to sys.path

I think it's okay (and even somewhat desirable in the case of scripts/) since those are unlikely to be real packages:

antazoey commented 1 year ago

I think it's okay (and even somewhat desirable in the case of scripts/) since those are unlikely to be real packages:

Because of the issues it caused in Ape and the increase of complexity that followed, I am inclined to dislike this behavior. Nonetheless, we "fixed" it in Ape so it is okay.

antazoey commented 1 year ago

closing but be warned.