Paket icon indicating copy to clipboard operation
Paket copied to clipboard

Only have dependencies in `paket.dependencies`

Open ilkerde opened this issue 12 years ago • 5 comments

Or: Proposal to conceptually introduce a paket.configuration file.

Currently, the paket.dependencies file not only contains dependencies. As per #38, it may contain modal statements as well (see #104). Apart of that, the state relation which is imposed on both the source and nuget commands are blurry and limit the conceptual integrity / flexibility of the file. We can see the first issues coming around the corner (see #89 #111 #114).

This document proposes a conceptual shift in that sense, as it suggests to strictly have the paket.dependencies only dependency declaractions and aside introduce the concept of dependency configuration with a new file.

Dependency Declarations

The paket.dependencies file only contains dependency declarations. A dependency declaration currently is as simple as a reference to a dependency from a given source:

nuget NUnit.Runners >= 2.6
github forki/FsUnit FsUnit.fs

whereas the first symbol in a line is the source identifier, followed by the dependency identifier and one or more constraints.

Dependency configuration

Sources as well as dependencies can be attributed with additional metadata. In particular, sources have to be configured with respect to their protocol and location. Moreover, other configuration may be of interest on other levels as well, such as on repository level or even application level.

All repository, source and dependency level configuration are defined in a separate file called paket.configuration (alt: .paket?). As of today, this configuration file may contain

  1. source declaration
  2. reference list mode
Source Declarations

A source declaration within paket.configuration must contain the following information:

  • identifier
  • type
  • location

Examples:

nuget   nugetv2   http://nuget.org/api/v2
github  github    https://github.com
myget   nugetv2   https://www.myget.org
fssnip  fssnip    http://www.fssnip.net
intern  nugetv2   http://acme-corp.local/nugetserver

Referring to the last line of above example,

  • intern is the source identifier
  • nugetv2 is the source type
  • http://acme-corp.local/nugetserver is the source location
Reference List Mode

The reference list mode is used the same way as implemented in #104). However, the mode is defined in paket.configuration, not paket.dependencies.

Example

references strict

The above line would leave all references (direct and indirect) from a project in paket.references (as opposed to the default behavior, references loose, where only direct references are listed within paket.references).

Relation between dependencies and configuration

Any source declaration exposes a source identifier to be used in paket.references. Example:

paket.configuration

gh  github    https://github.com
nu  nugetv2   http://nuget.org/api/v2

paket.dependencies

nu NUnit.Runners >= 2.6
gh forki/FsUnit FsUnit.fs

would be valid. If an unknown source identifier is found in paket.dependencies, Paket will complain.

Configuration file scopes

For the very first start, Paket wll support only a paket.configuration on repository level. That is, Paket will look for a paket.configuration in the root of your repository, right beside the paket.dependency file. This scope is referred to as local configuration scope.

Future versions of Paket may or may not support the following scopes as well:

  • global scope: a .paket user-specific configuration file in the user home directory
  • system scope: a .paket configuration file in the application directory containing machine-level configuration defaults

Default source identifiers

For the sake of consistency and transparency, Paket may have a set of preconfigured source identifiers. With regards to this, the best practice is to not change this predefined set and establish them as a common convention. The preliminary preconfiguration is:

nuget   nugetv2   http://nuget.org/api/v2
github  github    https://github.com
Notes

Closing note: this is just a proposal. The purpose is to strengthen flexibility on source selection and extendability for Paket. In particular, but not limited to, the support of github, git and fssnip sources. Feedback and discussion very welcome.

ilkerde avatar Sep 19 '14 16:09 ilkerde

sounds reasonable.

@agross ?

forki avatar Sep 19 '14 17:09 forki

Mulling over this - have an idea for a composable set of features addressing source downloads / source caching / source downloads being able to indicate framework assembly references / source-referencing / NuGet Source packages / meta-packages which will break out into 3-4 mini-features Hopefully I'll get that typed up later...

bartelink avatar Sep 21 '14 12:09 bartelink

Also, as well as a strict mode, potentially a package restore mode flag needs to be somewhere.

bartelink avatar Sep 21 '14 12:09 bartelink

@ilkerde #154 is heavily 'inspired' by this.

Key diffs are:

  • No complexity in references -> PaketIds all the way with no syntax implications from the dependencies/lock files

.. will think about this a bit more and might say more later...

bartelink avatar Sep 23 '14 15:09 bartelink

@ilkerde In light of #154:

  • can you comment on key bits of your sources scheme it doesnt address (in #154)
  • Could you decide whether in light of #154 and #166 literally having a separate file makes sense

Would it perhaps make sense to close this and express any thoughts you feel are not addressed elsehwere in a new issue?

Or if I have completely missed points of your proposal and the answer to the above us Mu, can you explain a bit please?

(Trying to control issue bloat caused by me recently!)

bartelink avatar Sep 28 '14 08:09 bartelink