Skip to content

Add an option to paket pack (or paket.template) to depend on current versions of packages #901

Closed

Description

@dmitryvk

Currently, when I have paket.template file like this:

type project

then paket pack command will use version requirements from paket.dependencies. I would like to also be able to use versions from paket.lock.

E.g., I'd like something like this:

# paket.dependencies
Foo >= 1.0 < 3.0
# paket.lock
Foo (1.1)
# paket.references
Foo
# paket.template
type project
use-locked-versions >=

then paket pack would produce package with the following version requirement: Foo >= 1.1 < 3.0.

The new directive use-locked-versions specifies how to combine version from paket.lock with version requirement from paket.dependencies. In this case, it combines >= 1.0 < 3.0 with >= 1.1. It might be useful to be able to use this on per-package basis.

Do you think that this would be useful feature?

Activity

  1. dmitryvk commented on Jun 24, 2015

    @dmitryvk
    Author

    This proposal is different than specifying e.g.

    # paket.template
    type project
    dependencies
      Foo >= CURRENTVERSION
    

    because currently I'd have to enumerate all referenced packages in dependencies list.

    Another option would be to allow wildcards in dependencies, e.g.,

    # paket.template
    type project
    dependencies
      Bar >= 1.1
      Baz >= CURRENTVERSION
      Foo.* < 3.0
      * >= CURRENTVERSION
    
  2. forki commented on Jun 24, 2015

    @forki
    Member

    I think the second proposition with dependency wildcards would make sense.

  3. dmitryvk commented on Jun 25, 2015

    @dmitryvk
    Author

    I gave some more thought to this at noticed that CURRENTVERSION refers to the version of package being packed; we should probably add some more tokens that refer to version of a dependency, e.g.:

    CURRENT_DEP_VERSION # version of a dependency from paket.lock (e.g., 1.2.3 or 1.2.3-alpha)
    CURRENT_DEP_VERSION_MAJOR # trimmed to major version (1 or 1-alpha)   
    CURRENT_DEP_VERSION_MINOR # trimmed to minor (1.2, 1.2-alpha)
    
  4. forki commented on Jun 25, 2015

    @forki
    Member

    Yep that sounds reasonable
    On Jun 25, 2015 9:16 AM, "Kalyanov Dmitry" [email protected] wrote:

    I gave some more thought to this at noticed that CURRENTVERSION refers to
    the version of package being packed; we should probably add some more
    tokens that refer to version of a dependency, e.g.:

    CURRENT_DEP_VERSION # version of a dependency from paket.lock (e.g., 1.2.3 or 1.2.3-alpha)
    CURRENT_DEP_VERSION_MAJOR # trimmed to major version (1 or 1-alpha)
    CURRENT_DEP_VERSION_MINOR # trimmed to minor (1.2, 1.2-alpha)

    —
    Reply to this email directly or view it on GitHub
    #901 (comment).

  5. inosik commented on Jun 25, 2015

    @inosik
    Contributor

    I would prefer a simple $ paket pack [...] use-locked-versions or something like that, which would tell Paket to take the version infos from paket.lock instead of paket.dependencies. Actually that's what I wanted to suggest, too 😁 And I think this would only make sense for paket.template-Files with type project.

    On the other side, I don't see the benefit of things like Baz >= CURRENT_DEP_VERSION, since this is what's actually paket.dependencies is for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions