This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-19
Channels
- # announcements (1)
- # asami (75)
- # beginners (16)
- # calva (14)
- # cider (4)
- # clj-kondo (11)
- # cljs-dev (3)
- # clojure (110)
- # clojure-australia (1)
- # clojure-china (1)
- # clojure-europe (38)
- # clojure-hk (1)
- # clojure-indonesia (1)
- # clojure-japan (1)
- # clojure-korea (1)
- # clojure-my (1)
- # clojure-nl (1)
- # clojure-sg (1)
- # clojure-spec (1)
- # clojure-taiwan (1)
- # clojure-uk (2)
- # clojurescript (34)
- # conjure (1)
- # data-science (9)
- # datahike (7)
- # datalevin (1)
- # datascript (1)
- # datomic (5)
- # etaoin (1)
- # fulcro (23)
- # graalvm (50)
- # helix (4)
- # hyperfiddle (8)
- # introduce-yourself (1)
- # jobs (3)
- # kaocha (10)
- # malli (8)
- # mid-cities-meetup (1)
- # minecraft (1)
- # off-topic (13)
- # pathom (14)
- # polylith (38)
- # reitit (1)
- # releases (1)
- # sci (65)
- # shadow-cljs (28)
- # specter (12)
- # tools-deps (8)
- # vim (1)
- # vscode (11)
- # xtdb (31)
HI guys, I am coming back to using polylith after some time and trying to remember what I am missing that might be causing a dependency issue. I have a component with some extra deps in the test alias. When I start a repl in for the dev project/test in vscode that dependency is not being seen. I have added the component to the extra paths in the test profile in the root deps.edn file as well. What may I be missing ?
What do you mean by not being seen
? You try to require one of its namespaces in the repl and it cannot be found?
@U096GDTLL How exactly are you starting your REPL? Are you supplying both :dev:test
aliases, or just :dev
?
@U096GDTLL I would verify that by starting a REPL outside VS Code, using the :dev:test
alias combo, and making sure you can require/import those test-only dependencies.
If that works, then I double-check exactly how VS Code is starting a REPL.
(FWIW, I always start my REPL outside VS Code because it tends to run for days or weeks whereas I'm restarting VS Code a lot more often)
clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version,"0.9.0"},cider/cider-nrepl {:mvn/version,"0.27.4"}}}' -M:dev:test -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"
If you are using profiles, then you should also give +default
(or the alias/profile you want to activate).
:test {:extra-paths ["components/the-component/test"
]
:extra-deps {poly/the-component {:local/root "components/the-component"}}}
you are referring to the-component there, but tools.deps will only pull in the-component's top-level (non-aliased) deps via such a reference
I thought @U096GDTLL said this was already in "the test profile in the root deps.edn file" but re-reading it I think he just had the test
path, not the extra dependency?
i only defined the dependency in the components dep.edn
workspace/components/the-component/deps.edn
if you want to follow the poly convention, you'd do this in your top level deps.edn:
:dev {:extra-paths ["components/the-component/src"] ;; cursive workaround
:extra-deps {poly/the-component {:local/root "components/the-component"}}}
:test {:extra-paths ["components/the-component/test"] ;; tools deps workaround
:extra-deps {that-test-dependency-you-are-missing { ...coordinates...}}}
I suspect this would be less of a foot-gun if poly test
constructed the dependencies for :dev:test
the same way it does for projects
? It reads all of the bricks' :test
deps to build the classpath when running tests for projects
I think? Or am I misremembering?
Hmm, no, looking at our projects
deps.edn
files, we have deps in :test
that are duplicated from bricks' deps.edn
:test
aliases it seems...
(our setup is slightly complicated by the fact that we're in the process of migrating legacy stuff to Polylith, so our bricks are used by legacy subprojects for dev/test/build as well as from projects
😕 )
@U04V70XH6 I think you remember right. The difference is that you rarely if ever dev-repl into a project that is not the development project