-
Notifications
You must be signed in to change notification settings - Fork 108
Implement test/executable specific dependencies #85
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
Implement test/executable specific dependencies #85
Conversation
- with the possibility of them being "circular", meaning if one of them depends on the current library, it will still work
My use case for this is that vegetables depends on both iso_varying_string and strff, but I want to be able to use vegetables to test them. This way that will work. I still need to try to migrate these to using fpm to be sure that it will work, but I'll try that over the next day or two. The test I added suggests it will. |
Yes, we need this feature. However, let's follow the Cargo's syntax? Or do you have reasons why that's not a good idea in this case? https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#development-dependencies It has Currently you have: [[test]]
name = "test"
source-dir = "tests"
main = "main.f90"
[test.dependencies]
circular_test = { path = "../circular_test" } Let's instead do: [dev-dependencies]
circular_test = { path = "../circular_test" }
[[test]]
name = "test"
source-dir = "tests"
main = "main.f90" And finally [dev-dependencies]
circular_test = { path = "../circular_test" } In Cargo you can specify also dependencies for a particular target only. But it seems this |
My other comment is that instead of adding tests in the root directory as examples, let's move them in the tests directory? |
I'm not opposed to also having I can move the tests into the |
I was able to try this out converting a few of my libraries to using fpm, and it works great. This will make it possible for me to convert (almost) all of my packages to fpm. |
I am not sure about the executables --- I would expect that In your use case, you have to have special dependencies for executables? |
I don't personally have a project with special dependencies for an executable, but I could envision one. Somebody develops and tool, and there's a library that goes along with it, but the executable has dependencies that user's of the library don't necessarily need. The use case is probably rare enough, and covered by the executable/test specific dependencies I've already implemented that having |
Yes, I think that's precisely the approach that Cargo took also. For this rare case, you just specify the dependency for the executable that needs it. Otherwise the dependencies and dev-dependencies cover over 90% of use cases.
Thanks for all the work you are doing on this.
…On Sun, May 31, 2020, at 5:21 PM, Brad Richardson wrote:
I don't personally have a project with special dependencies for an
executable, but I could envision one. Somebody develops and tool, and
there's a library that goes along with it, but the executable has
dependencies that user's of the library don't necessarily need. The use
case is probably rare enough, and covered by the executable/test
specific dependencies I've already implemented that having
`dev-dependencies` only for tests is probably fine. I'll get that
implemented.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#85 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAFAWCG44ZNP5I7MSX2U3LRULQ6BANCNFSM4NOQBL6A>.
|
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.
I think this looks good to me to merge.
The [dev-dependencies]
is working, tests are added, so we can improve upon this with subsequent PRs.
Thank you Brad! I think we are getting very close to make fpm
usable in real projects.
I'll try this myself on my projects soon.
Sorry, I don't have time to review this but please go forward with it and I will play with it at a later time. |
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.
I reviewed the examples and the addition to the guide, all looks good to me.
At this point it's kind of a terrible, ugly, hacked together prototype, but it works. And allows for "semi"-circular dependencies. If one of your test or executable dependencies depends on your library, it will still work.