-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Poly command fails when source has non-seq import items #73
Comments
Hi @futuro Thanks for taking time to open an issue. I have explained the rationale behind this behaviour in this issue. Using sequences in import and require statements is a best practice explained in detail here. Although, I agree that the error message should be more descriptive and there should be a section in the documentation explaining this. |
Hi @furkan3ayraktar :) Thanks for taking the time to respond. I read your response in the other issue, and it sounds like the impetus for the current behavior is because supporting the same forms of libspecs/import forms as clojure.core is non-trivial; is that an accurate read? Relatedly, if I put together a PR that could handle all valid forms to define requires and imports, is that in line with the project goals/would you be interested in that? How about a PR to detect forms that don't follow the how-to-ns suggestions and throw a more informative error? Semi-related, after a little testing, I've discovered the current code silently does the wrong thing if you use namespace prefixes and the leaf-nodes point to different libraries. For example, if you have the following map in your deps.edn :ns-to-lib {com.a library-a
com.a.b library-b
com.a.c library-c} And the following require form (ns ,,,
(:require [com.a b c]))
I'm not sure exactly how prevalent this is, but it came to mind after I was re-reading the how-to-ns post and contemplating how I would parse the ns forms accepted by clojure.core. |
Hi there! Thanks for pointing out this problem. The Each brick will have its own The poly tool will at that point support visualising both the old (current) and the new project format Hope that answered your question. |
That's good to know about the Will that change also mean that |
I will continue reading namespaces from disk. |
I close this issue now, since #74 is merged. |
Describe the bug
Having an import that isn't in a seq causes polylith cli to throw an exception. If you wrap your import in a vector or list, poly works as expected. This is also true for requires.
To Reproduce
Steps to reproduce the behavior:
poly info
Don't know how to create ISeq from: clojure.lang.Symbol
Expected behavior
To see the poly info output, and not an exception string.
Screenshots
N/A
Workspace Attachment
I'm pretty sure this isn't applicable, but let me know if you need it.
Operating System (please complete the following information):
Versions (please complete the following information):
ec38a83db7597e6f6f33dfbc1e4da665807ab091
Additional context
Stacktrace:
The text was updated successfully, but these errors were encountered: