-
-
Notifications
You must be signed in to change notification settings - Fork 590
get_distribution() not working in __init__.py #500
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
Comments
Hi -- it's way more likely it's a bug in cx_freeze/pyinstaller/the way you're using them unfortunately. Those tools aren't "supported" in the sense that What jsonschema is doing is perfectly reasonable on that line there, and what you're doing to hard code the version is essentially stripping out the useful thing :), which is that jsonschema's version is automatically managed (by a project called That's not safe to do for any package unfortunately, so it's not really doing the right thing there, but yeah I don't know too much more about it. So, TL;DR if you have both a test and a patch I'm happy to review them :), but otherwise yeah, it's those tools that are doing something funny, which I'm not quite sure how to help you get past but they likely might be able to! |
@Julian Simply wrap the I've seen this handled similarly in other projects and it seems like a good practice in general rather than facilitating a initialization-time crash of the interpreter. For example:
From what I can see, you only ever reference I hope you'll consider adding this relatively harmless mitigation. Cheers. |
@mikedarcy I'm happy to take PRs for that, though my position still is it needs to come with adding CI for ensuring that cx_freeze continues to function -- I can't promise something is supported unless it's under test. (And FWIW, |
@Julian I'm not saying that you actually need to support it (be it cx_freeze or whatever environment that might get into trouble on this method call), I am just saying allow for a graceful degradation that avoids an init-time crash of python for whatever reason. Maybe even make the fallback string "Unsupported Version" 😉 . Anyway, just trying to offer up something simple that I perceive as having little downside. In the short term I can work around this by pinning to |
Due to python-jsonschema/jsonschema#500 and related concerns pyinstaller doesn't play nice with later versions of jsonschema. We may need to find another way to build this post py3.8
fd0aa9f8 Merge pull request #500 from anexia-it/master d0107804 Extend if/then/else tests on unevaluated properties 017d4e56 Merge pull request #499 from json-schema-org/ether/dynamic-scope-enter-leave aa621ed4 test that dynamic scopes are not always in scope git-subtree-dir: json git-subtree-split: fd0aa9f8e2497d9048e17f071abb8fa409f5cb52
I use pyinstaller/cx_freeze for my app. Recently I started using jsonschema and I ran into errors when using the above programs. On Ubuntu env when I ran the binary build by pyinstaller and cx_freeze I got the following issues. Iam using python 3.6.
It seems to work when I run it directly using #python sslscanner.py.
On further investigation, I ran into this code in site-packages/jsonschema/init.py +33
I commented out the get_distribution code and copied the version directly. This solves the problem and the binaries work. Is this a bug on your end? I did not investigate this further.
The text was updated successfully, but these errors were encountered: