Skip to content

Golang native dependency resolver with full semver 2 support.

Notifications You must be signed in to change notification settings

btab/semver_solver

Repository files navigation

SEMVER SOLVER

A golang native dependency resolver with full semver 2 support. Depends on https://github.com/blang/semver.

Built to prove out the algorithm before building https://github.com/btab/pony-semver. No current intention to backport improvements from that library to this.

USAGE

Install...

go get github.com/btab/semver_solver

Implement an ArtifactSource (or use the MockArtifactSource), create a solver and solve for a set of constraints...

package main

import (
	ss "github.com/btab/semver_solver"
)

func main() {
	source := ss.MockArtifactSource{}
	source.AddArtifact("foo", "1.0.0")

	solver := ss.Solver{source}

	constraint, _ := ss.NewConstraint("foo", "<2.0.0")
	constraints := []*ss.Constraint{constraint}

	artifacts, err := solver.Solve(constraints)
}

SCENARIO TESTING

From the root of the project...

go run tester/main.go

TODO

  1. find some really nasty-complex real-world examples to smoke test this thing
  2. look at apt, yum, bundler (molinillo), npm, cargo, maven, brew
  3. generalize to a SAT(-3) solver (minisat / other DLL solver)?

About

Golang native dependency resolver with full semver 2 support.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages