indygreg / PyOxidizer

A modern Python application packaging and distribution tool
Mozilla Public License 2.0
5.51k stars 239 forks source link

import raven fails #63

Open gjcarneiro opened 5 years ago

gjcarneiro commented 5 years ago
yacron-app packaged into /home/gjc/projects/yacron-app/build/apps/yacron-app/debug
Traceback (most recent call last):
  File "yacron.__main__", line 8, in <module>
  File "yacron.cron", line 10, in <module>
  File "yacron.job", line 11, in <module>
  File "raven", line 44, in <module>
  File "raven", line 30, in get_revision
NameError: name '__file__' is not defined
SystemError
error: cargo run failed
TxBillbr commented 5 years ago

I was able to use the work-around in the documentation for the keyring package with success in dealing with file in 3rd-party packages. You might try that as a method. It does mean that you end up with a lib directory carry along with the .exe in windows. (I haven't tried it in Mac or Linux, but would think that you get a shared lib there.)

gjcarneiro commented 5 years ago

Ah, I missed the doc section about this. Maybe I should open a bug in raven, instead.

indygreg commented 5 years ago

See also #69. I encourage people to create issues against 3rd party projects when those projects require __file__. If someone files an issue against Raven, please link to #69, as that issue contains all the details.

jayvdb commented 5 years ago

fwiw, raven is deprecated and replaced with sentry, and it looks like https://github.com/getsentry/sentry-python still uses __file__ but it degrades gracefully if it doesnt exist.