Paket icon indicating copy to clipboard operation
Paket copied to clipboard

paket install --excludeversion

Open ilkerde opened this issue 12 years ago • 25 comments

I want to bootstrap FAKE with Paket. In order to do this easily, I'd like to install FAKE without any version attached in path.

Right now I do:

NUGET=./.nuget/nuget.exe
FAKE=./packages/FAKE.Core/tools/FAKE.exe

[ ! -e $FAKE ] && mono $NUGET install FAKE.Core -ExcludeVersion -NonInteractive -OutputDirectory ./packages
mono $FAKE ./build.fsx "$@"

But I want to do:

FAKE=./packages/FAKE.Core/tools/FAKE.exe

[ ! -e $FAKE ] && paket install FAKE.Core --excludeversion
mono $FAKE ./build.fsx "$@"

Food for thought (optional considerations)

Maybe it makes sense to reword the --excludeversion flag to --bare, since I do not want Paket to track the package anywhere (no paket.deps / paket.lock entries). Example:

paket install FAKE.Core --bare

Another option would be to do this as a complete separate command, since it is a very distinct use-case. It just downloads and extracts the package, no more no less. I can imagine to name this command download or fetch. The resulting command would be

paket fetch FAKE.Core

Just recommendations, naming and implementation is up to you anyway. I'd be happy about this feature since it would allow me to completely ditch nuget.exe on FAKE-enabled repos.

(Thanks @bartelink for pointing out the two exclusive options)

ilkerde avatar Sep 21 '14 12:09 ilkerde

Isn't bare/excludeVersion the Paket default anyway?

Hence paket fetch with no args would seem the most natural way of expressing it ?

paket fetch NuGet.CommandLine ....

I guess this might also address notion of #116

bartelink avatar Sep 21 '14 12:09 bartelink

@bartelink Yes, sorry, I should have better expressed that the two options are mutually exclusive.

ilkerde avatar Sep 21 '14 12:09 ilkerde

another option is to use shell multi-line strings to send an inline file and/or have a build.paket.dependencies which has nuget NuGet.CommandLine \n nuget Fake.Core

bartelink avatar Sep 21 '14 12:09 bartelink

Getting rid of Nuget.exe is already possible today. Just add "nuget FAKE" to the dependencies file and run paket update and do a paket install in the build.

Paket will never add versions into the path.

I still think a fetch command is needed. It will have to do the following:

  • if the version is specified we download exactly that version
  • of the lock file contains a requested version we download this
  • if we can not find a requested version we download latest

forki avatar Sep 21 '14 12:09 forki

:thumbsup: sounds perfect

bartelink avatar Sep 21 '14 13:09 bartelink

Will paket fetch automatically add me an entry into paket.deps if not existent? This would be a nice CLI convenience rather than

  • adding it myself to paket.deps
  • run paket update (install)

Would be great!

ilkerde avatar Sep 21 '14 14:09 ilkerde

mhm this would be much more than just fetch.

forki avatar Sep 21 '14 14:09 forki

Just to make sure we are talking about the same thing. Instead of the discussed fetch you want a command x which does:

paket x FAKE

  • Add FAKE to deps file
  • run paket update (which reresolves and downloads everything)

forki avatar Sep 21 '14 14:09 forki

:thumbsup: Even better !

How about paket add nuget FAKE with the nuget bit being optional. And if the file is not there and/or , generate a template one with some samples and options commented out in a comment

bartelink avatar Sep 21 '14 14:09 bartelink

I think this new thing would actually be much easier to implement.

forki avatar Sep 21 '14 14:09 forki

I wonder if this task should ask for all found projects if we want to add to the coresponding paket.references?

--no-projects could skip this

forki avatar Sep 21 '14 14:09 forki

Could we do this the other way around for paket.refs? I mean the following:

paket add nuget FAKE

just adds the entry to paket.deps and downloads FAKE (via paket update. Q: Isn't paket install sufficient enough here?). Nothing else. It's up to the user to decide where and how the package is going to be used. However, if we run

paket add nuget FAKE --interactive

Paket will ask for every project if it should add a ref to it (and the corresponding paket.refs).

Would this fit into the picture?

ilkerde avatar Sep 21 '14 15:09 ilkerde

Yes changing defaults is also ok. I think --interactive (-i) is a good idea.

But I think we should run update in order to reflect the addition in the lockfile. It would also verify that dependencies are OK. Otherwise we could easily introduce conflicts. On Sep 21, 2014 5:33 PM, "ilkerde" [email protected] wrote:

Could we do this the other way around for paket.refs? I mean the following:

paket add nuget FAKE

just adds the entry to paket.deps and downloads FAKE (via paket update. Q: Isn't paket install sufficient enough here?). Nothing else. It's up to the user to decide where and how the package is going to be used. However, if we run

paket add nuget FAKE --interactive

Paket will ask for every project if it should add a ref to it (and the corresponding paket.refs).

Would this fit into the picture?

— Reply to this email directly or view it on GitHub https://github.com/fsprojects/Paket/issues/143#issuecomment-56302352.

forki avatar Sep 21 '14 16:09 forki

I assume the cli with CommardArgParser would look like this:

paket add --nuget FAKE paket add --nuget FAKE --version 3.5 paket add --nuget FAKE --interactive

So we have additional -- before nuget. Ok? On Sep 21, 2014 6:00 PM, "Steffen Forkmann" [email protected] wrote:

Yes changing defaults is also ok. I think --interactive (-i) is a good idea.

But I think we should run update in order to reflect the addition in the lockfile. It would also verify that dependencies are OK. Otherwise we could easily introduce conflicts. On Sep 21, 2014 5:33 PM, "ilkerde" [email protected] wrote:

Could we do this the other way around for paket.refs? I mean the following:

paket add nuget FAKE

just adds the entry to paket.deps and downloads FAKE (via paket update. Q: Isn't paket install sufficient enough here?). Nothing else. It's up to the user to decide where and how the package is going to be used. However, if we run

paket add nuget FAKE --interactive

Paket will ask for every project if it should add a ref to it (and the corresponding paket.refs).

Would this fit into the picture?

— Reply to this email directly or view it on GitHub https://github.com/fsprojects/Paket/issues/143#issuecomment-56302352.

forki avatar Sep 21 '14 16:09 forki

Fine with me. Not the most CLI-friendly line, but very doable.

ilkerde avatar Sep 21 '14 19:09 ilkerde

@eiriktsarpalis do we have other option?

forki avatar Sep 21 '14 19:09 forki

Hmm, depends on what particular alternative you have in mind.

eiriktsarpalis avatar Sep 21 '14 22:09 eiriktsarpalis

@eiriktsarpalis Can we get UnionArgParser to understand

paket add nuget FAKE

instead of

paket add --nuget=FAKE

? Maybe using an attribute on the nuget argument?

ilkerde avatar Sep 22 '14 18:09 ilkerde

Yep, try using this: http://nessos.github.io/UnionArgParser/reference/nessos-unionargparser-equalsassignmentattribute.html

On Mon, Sep 22, 2014 at 8:10 PM, ilkerde [email protected] wrote:

@eiriktsarpalis https://github.com/eiriktsarpalis Can we get UnionArgParser to understand

paket add nuget FAKE

instead of

paket add --nuget=FAKE

? Maybe using an attribute on the nuget argument?

— Reply to this email directly or view it on GitHub https://github.com/fsprojects/Paket/issues/143#issuecomment-56414830.

eiriktsarpalis avatar Sep 22 '14 18:09 eiriktsarpalis

Note that this requires parameters to have arity precisely 1.

On Mon, Sep 22, 2014 at 8:27 PM, Eirik George Tsarpalis < [email protected]> wrote:

Yep, try using this: http://nessos.github.io/UnionArgParser/reference/nessos-unionargparser-equalsassignmentattribute.html

On Mon, Sep 22, 2014 at 8:10 PM, ilkerde [email protected] wrote:

@eiriktsarpalis https://github.com/eiriktsarpalis Can we get UnionArgParser to understand

paket add nuget FAKE

instead of

paket add --nuget=FAKE

? Maybe using an attribute on the nuget argument?

— Reply to this email directly or view it on GitHub https://github.com/fsprojects/Paket/issues/143#issuecomment-56414830.

eiriktsarpalis avatar Sep 22 '14 18:09 eiriktsarpalis