Closed antazoey closed 11 months ago
idk what is going on
(Pdb) inspect.getfile(module)
*** TypeError: <module 'scripts' (namespace)> is a built-in module
(Pdb) module.__path__
_NamespacePath(['/Users/jules/ApeProjects/ApePay/scripts'])
why does it think ApePay.scripts
is a builtin module
Yo that's wild lmao
@antazoey is this solved with https://github.com/ApeWorX/ape/pull/1478?
@antazoey is this solved with ApeWorX/ape#1478?
That was my fix in Ape when this happened. But also it no longer seems like it is happening here for maybe different reasons?
Nevermind, when ApePay is installed, if I do import scripts; scripts.__path__
, it will work and point to ApePay no matter what I am... kinda odd
one potential fix is make a src
folder, move apepay
in that, and make that the place to look for python modules instead of the root
I tried both:
packages = [{ include = "apepay" }]
and
exclude = [{ path = "scripts" }]
to no avail
Can't you do exclude=["tests/"]
?
Can't you do
exclude=["tests/"]
?
I spent like over an hour trying everything I possible could like that yesterday and could not get anything to work.
When I have a chance, I will re-try that specific case right there, but I am pretty sure that include
and exclude
only include / exclude file glob patterns within the packages it finds. packages
is the key to control which packages it finds. That is what the doc says too, but I noticed Vyper lang seems to be making this same mistake right now in that you can import Vyper's tests anywhere on your whole OS if you have it installed. I don't see any evidence that include
and exclude
work the way they are being used in our repos but I am so new at Poetry that is all a bit confusing for me
exclude=["tests/", "scripts/"]
Just tried, does not work.
(from home dir)
(yoko) ➜ ~ python -c "import scripts; print(scripts.__path__)"
_NamespacePath(['/Users/jules/ApeProjects/ApePay/scripts'])
(yoko) ➜ ~
I moved the py-sdk to sdk/py/apepay/
I wonder if this is still an issue
correct, it is no longer an issue because the root of the project is no longer treated as a package
What Happened
I installed ApePay and
scripts.
became a python module i can important anywhere in my python environment. Can excludescripts
from the package install here? This has highlighted a bug in Core whereape run
will run the wrong module in this situation... I am runningape run deploy
but no matter what project I am in, it usesApePay
.