Skip to content

Conversation

@lucymukh
Copy link
Contributor

@lucymukh lucymukh commented Jul 5, 2018

The code in pull request allows to conveniently add dependencies from Git and GitHub.
Paket .Net API currently doesn't support HTTP dependencies yet.

GitHub dependency usage example:
Paket.GitHub ["user/repo:version file"]
, where version and file are optional
Sample:
http://nbviewer.ipython.org/github/lucymukh/IfSharp/blob/ad04dc50560c8bdd45263330b38ac88437ce957e/docs/files/notebooks/GitHub%20dependencies%20sample.ipynb

Git dependency usage example:
Paket.Git ["repo version"]
, where version is optional

Maybe the functionality sample is worth adding to the FSharp Jupyter Notebook?

@lucymukh lucymukh force-pushed the gitHubDependencies branch from 00a6e3d to f0d9b2e Compare July 5, 2018 12:45
@cgravill
Copy link
Member

cgravill commented Jul 6, 2018

This looks great. Sure, please do add to the sample documentation. As a small suggestion, instead of using:

#r "packages/Angara.Table/lib/net452/Angara.Table.dll"
#r "packages/Angara.Statistics/lib/net452/Angara.Statistics.dll"

it should be possible to

#load "Paket.Generated.Refs.fsx"

and avoid embedding the framework versions into the notebook - that causes issues when the NuGets themselves update.

@cgravill
Copy link
Member

cgravill commented Jul 6, 2018

@evelinag would this syntax address work for you? #146 (comment)

@lucymukh
Copy link
Contributor Author

lucymukh commented Jul 9, 2018

Thank you for the remarks, Colin. I've changed the sample accordingly and added it at the end of the FSharp_Jupyter_Notebooks notebook

@cgravill
Copy link
Member

cgravill commented Jul 9, 2018

Great, looks good.

I saw you're having to do quite a lot of the work of breaking up the string with a regular expression before passing it to Paket. Presumably Paket has to do something similar itself. Is that functionality not available in the PaketCore API?

@lucymukh
Copy link
Contributor Author

@cgravill the parsing code exists, but is not exposed as public. To avoid obscure RegExp validation I can propose the following combinator-based alternative:

let npzDep =
    Paket.gitHubRepo "predictionmachines/Angara.Chart"
    |> Paket.chooseBranch "gh-pages"
    |> Paket.singleFile "data/npz.csv"
let siteDep =
    Paket.gitHubRepo "predictionmachines/Angara.Chart"
    |> Paket.chooseBranch "gh-pages"
    |> Paket.singleFile "data/site.csv"
Paket.Git [npzDep; siteDep]

The pull request is updated

@cgravill
Copy link
Member

Oh, I didn't mean to request changing just wanted to make sure we weren't duplicating functionality in Paket.

Maintaining the style and interoperability with https://fsprojects.github.io/Paket/github-dependencies.html seems like a good idea. If the regular expression approach turned out to have issues we could always request the Paket folks expose the functionality.

The combinator approach looks a lot more explicit and safe but people might find it a bit much in practice.

@lucymukh
Copy link
Contributor Author

@cgravill, ok, I've reverted the last commit.
Did I understand you correctly that my regExp check works for now?

@cgravill
Copy link
Member

Yes, that's great for now. I'll merge.

@cgravill cgravill merged commit d4eac3d into fsprojects:master Jul 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants