GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - git-pkgs/dependents: Find and rank repositories that depend on a package

BranchesTags
Open more actions menu

Latest commit

 

History

22 Commits
22 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.gitignore
.gitignore
 
 
.golangci.yml
.golangci.yml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
analyze.go
analyze.go
 
 
analyze_test.go
analyze_test.go
 
 
candidate.go
candidate.go
 
 
candidate_test.go
candidate_test.go
 
 
checkout.go
checkout.go
 
 
doc.go
doc.go
 
 
filter.go
filter.go
 
 
filter_test.go
filter_test.go
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
rank.go
rank.go
 
 
rank_test.go
rank_test.go
 
 

Repository files navigation

dependents

Go library for finding and ranking repositories that depend on a package. It uses enrichment for dependent package metadata and clone for local checkouts. Candidates are deduplicated by repository while retaining the package-level dependency relationships. The package supports Go 1.26 or later.

Install

go get github.com/git-pkgs/dependents

Usage

client, err := enrichment.NewEcosystemsClient()
if err != nil {
    log.Fatal(err)
}

candidates, err := dependents.DiscoverRepository(ctx, client,
    "https://github.com/acme/library", dependents.DiscoverOptions{})
if err != nil {
    log.Fatal(err)
}

kept, rejected := dependents.Filter(candidates, dependents.FilterOptions{
    ExcludeForks:    true,
    ExcludeArchived: true,
    ExcludeMirrors:  true,
    MaxAge:          2 * 365 * 24 * time.Hour,
})
for _, rejection := range rejected {
    log.Printf("skip %s: %s", rejection.Candidate.Repository, rejection.Reason)
}
ranked := dependents.Rank(kept, 10, nil)

Build accepts the package's neutral Group type when the caller already has dependent data. BuildEnrichmentCandidates adapts enrichment.RepositoryDependents directly.

DefaultScore favors source references and tests after checkout analysis. Callers can pass another ScoreFunc to Rank, so security exposure and contract-test selection can use different policies.

Analyze accepts any Checkout. CloneCheckout uses a direct checkout and supports full history for Hyrum, while CacheCheckout copies from a persistent git-pkgs/clone cache for Scrutineer. A caller that supplies Workdir or sets Keep receives the checkout path on each analyzed candidate for follow-up work. Set DetectNativeExtensions to record native-extension toolchains and their build commands, including Maturin, napi-rs, Neon, rb-sys, Rustler, and setuptools-rust.

After analysis, FilterOptions.RequireTests and RequireImports reproduce the contract-test eligibility used by downstream. Scrutineer can require upstream references without excluding repositories that have no conventional test files.

License

MIT.

About

Find and rank repositories that depend on a package

git-pkgs.dev

Topics

dependenciesgitgit-pkgsgogolangpackages

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.