-
Notifications
You must be signed in to change notification settings - Fork 132
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
Allow to publish packages with test dependencies not in the registry #1270
Conversation
c468e84
to
91e05be
Compare
bf8a0c9
to
a1657e5
Compare
1b00fcd
to
4fe7ce3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brilliant refactoring of the new caching code in Fetch
- @finnhodgkin could you test this code to see if the perf still holds up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stellar work! Thanks 👏
Awesome! Could you cut a new version soon so I can use it to publish |
Yeah I will merge #1275 now then cut a new version! |
@fsoikin 0.93.39 is out 🚀 |
Description of the change
The primary motivation for this is allowing circular dependencies between packages for testing only. In this scenario one of the packages is added to
extra_packages
section of the other with a patcheddependencies
property. For example:This scenario was actually working fine for the most part, and the only obstacle was publishing the package. Because the
extra_packages
dependency is not in the package registry, Spago refuses to publish. This change makes it so that Spago will only apply this rule to "core" dependencies, but not to "test" ones. See also this Discord discussion.To achieve this, the following changes have been made:
Fetch.run
no longer returns a single list of dependencies for every package, but instead returns them in two buckets - "core" and "test".{ dependencies, build_plan, test_dependencies }
{ core: { dependencies, build_plan }, test: { dependencies, build_plan } }
Fetch.run
ultimately calltoAllDependencies
, which flattens the whole tree and combinescore
withtest
.Publish.run
specifically picks onlycore
and dropstest
, so as not to perform all the rigorous checks for the test dependencies.Build.getBuildGlobs
no longer adds test globs (i.e.test/**/*.purs
) for all workspace packages, but only for the "selected" ones. This is because only "selected" packages will have their test dependencies added to the build plan.Checklist:
[ ] Added some example of the new feature to theREADME