Repository navigation
Fix create basis package resolution #43
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
Merged
julienvincent
merged 1 commit into
kepler16:master
from
itai-spiritt:fix-create-basis-package-resolution
Mar 8, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| (ns k16.kmono.build-test | ||
| (:require | ||
| [clojure.test :refer [deftest is testing use-fixtures]] | ||
| [clojure.tools.build.api :as b] | ||
| [k16.kmono.build :as kmono.build] | ||
| [k16.kmono.core.config :as core.config] | ||
| [k16.kmono.core.packages :as core.packages] | ||
| [k16.kmono.test.helpers.repo :refer [*repo* with-test-repo]] | ||
| [matcher-combinators.test])) | ||
|
|
||
| (use-fixtures :once with-test-repo) | ||
|
|
||
| (defn- load-packages [] | ||
| (let [config (core.config/resolve-workspace-config *repo*) | ||
| packages (core.packages/resolve-packages *repo* config)] | ||
| packages)) | ||
|
|
||
| (deftest create-basis-replaces-local-deps-with-mvn-version-test | ||
| (testing "replaces :local/root workspace libs with :mvn/version" | ||
| (let [packages (load-packages) | ||
| packages (assoc-in packages ['com.kepler16/a :version] "1.2.3") | ||
| pkg-b (get packages 'com.kepler16/b)] | ||
| (b/with-project-root (:absolute-path pkg-b) | ||
| (let [basis (kmono.build/create-basis packages pkg-b)] | ||
| (is (match? {'com.kepler16/a {:deps/manifest :mvn | ||
| :mvn/version "1.2.3"}} | ||
| (:libs basis)))))))) | ||
|
|
||
| (deftest create-basis-after-filter-by-test | ||
| (testing "works when :depends-on has been cleared by filter-by" | ||
| (let [packages (load-packages) | ||
| packages (assoc-in packages ['com.kepler16/a :version] "1.2.3") | ||
| pkg-b (assoc (get packages 'com.kepler16/b) :depends-on #{})] | ||
| (b/with-project-root (:absolute-path pkg-b) | ||
| (let [basis (kmono.build/create-basis packages pkg-b)] | ||
| (is (match? {'com.kepler16/a {:deps/manifest :mvn | ||
| :mvn/version "1.2.3"}} | ||
| (:libs basis))))))) | ||
|
|
||
| (testing "leaves non-workspace libs unchanged" | ||
| (let [packages (load-packages) | ||
| packages (assoc-in packages ['com.kepler16/a :version] "1.2.3") | ||
| pkg-b (get packages 'com.kepler16/b)] | ||
| (b/with-project-root (:absolute-path pkg-b) | ||
| (let [basis (kmono.build/create-basis packages pkg-b)] | ||
| (is (match? {'org.clojure/clojure {:deps/manifest :mvn | ||
| :mvn/version "1.12.0"}} | ||
| (:libs basis))))))) | ||
|
|
||
| (testing "leaves workspace libs with no version unchanged" | ||
| (let [packages (load-packages) | ||
| pkg-b (get packages 'com.kepler16/b)] | ||
| (b/with-project-root (:absolute-path pkg-b) | ||
| (let [basis (kmono.build/create-basis packages pkg-b)] | ||
| (is (match? {'com.kepler16/a {:deps/manifest :deps}} | ||
| (:libs basis))) | ||
| (is (nil? (get-in basis [:libs 'com.kepler16/a :mvn/version])))))))) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.