Skip to content

Commit

Permalink
Release v0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
konstin committed Feb 12, 2025
2 parents 717289b + a23d64f commit 086d70b
Show file tree
Hide file tree
Showing 50 changed files with 6,498 additions and 2,233 deletions.
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
artifacts:
# Group upload/download artifact updates, the versions are dependent
patterns:
- "actions/*-artifact"

- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "monthly"
29 changes: 29 additions & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Benchmarks (CodSpeed)

on:
push:
branches:
- dev
pull_request:
workflow_dispatch:

jobs:
benchmarks:
name: Run benchmarks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup rust toolchain, cache and cargo-codspeed binary
uses: moonrepo/setup-rust@v1
with:
channel: stable
cache-target: release
bins: cargo-codspeed

- name: Build the benchmark target(s)
run: cargo codspeed build --features serde

- name: Run the benchmarks
uses: CodSpeedHQ/action@v3
with:
run: cargo codspeed run
19 changes: 3 additions & 16 deletions .github/workflows/cargo_publish_dry_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ name: Check crate publishing works
on:
pull_request:
branches: [ release ]
workflow_dispatch:

env:
CARGO_TERM_COLOR: always
Expand All @@ -13,28 +14,14 @@ jobs:
name: Publishing works
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install stable Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
uses: dtolnay/rust-toolchain@stable

- name: Get Cargo version
id: cargo_version
run: echo "::set-output name=version::$(cargo -V | tr -d ' ')"
shell: bash

- name: Download cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ steps.cargo_version.outputs.version }}-${{ hashFiles('Cargo.toml') }}
restore-keys: ${{ runner.os }}-${{ steps.cargo_version.outputs.version }}

- name: Run `cargo publish --dry-run`
run: cargo publish --dry-run
99 changes: 25 additions & 74 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: CI
on:
pull_request:
merge_group:
push:
branches: [ release, dev ]
schedule: [ cron: "0 6 * * 4" ]
Expand All @@ -10,104 +11,54 @@ env:

jobs:
test:
name: Tests pass
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install stable Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal

- name: Get Cargo version
id: cargo_version
run: echo "::set-output name=version::$(cargo -V | tr -d ' ')"
shell: bash

- name: Download cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ steps.cargo_version.outputs.version }}-${{ hashFiles('Cargo.toml') }}
restore-keys: ${{ runner.os }}-${{ steps.cargo_version.outputs.version }}

- name: Build
run: cargo build --verbose

- name: Run tests
run: cargo test --features=serde --verbose
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --workspace
- run: cargo test --all-features --workspace

clippy:
name: No warnings from Clippy
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install stable Rust
uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
profile: minimal
components: clippy

- name: Check Clippy lints
env:
RUSTFLAGS: -D warnings
run: cargo clippy
run: cargo clippy --workspace

check_formatting:
name: Source code is formatted
name: Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install stable Rust
uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
profile: minimal
components: rustfmt

- name: Check formatting
run: cargo fmt --all -- --check
- run: cargo fmt --all -- --check

check_documentation:
name: Documentation builds successfully
name: Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install nightly Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal

- name: Download cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: documentation

- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Check documentation
env:
RUSTDOCFLAGS: -D warnings
run: cargo +nightly doc --no-deps --document-private-items
run: cargo doc --workspace --no-deps --document-private-items

check_commit_conventions:
name: Commit messages follow project guidelines
minimal-versions:
name: Minimal versions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Check commit conventions
uses: wagoid/commitlint-github-action@v2
with:
configFile: .commitlintrc.yml
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- run: cargo +nightly update -Zminimal-versions
- run: cargo +nightly build --workspace
- run: cargo +nightly test --all-features --workspace
24 changes: 6 additions & 18 deletions .github/workflows/deploy_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ name: Deploy documentation
on:
push:
branches: [ dev ]
workflow_dispatch:

env:
CARGO_TERM_COLOR: always
Expand All @@ -12,28 +13,15 @@ jobs:
deploy_documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal

- name: Download cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: documentation
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable

- name: Build documentation
run: cargo +nightly doc --no-deps
run: cargo doc --no-deps

- name: Deploy documentation
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.event_name == 'branches' }}
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/doc
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/target
Cargo.lock

56 changes: 54 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,57 @@

All notable changes to this project will be documented in this file.

## Unreleased [(diff)][unreleased-diff]
## [0.3.0] - 2025-02-12 - [(diff with 0.2.1)][0.2.1-diff]

PubGrub 0.3 has a more flexible interface and speeds resolution significantly. The public API is very different now, we
recommend starting the migration by implementing the new `DependencyProvider` interface following the
[Guide](https://pubgrub-rs.github.io/pubgrub/pubgrub/).

All public interfaces are now in the root of the crate.

In the main interface, `DependencyProvider`, `choose_package_version` was split into two methods: `prioritize`
for choosing which package to decide next by assigning a priority to each package, and `choose_version`. The generic
parameters became associated types. The version set is configurable by an associated type.

`Dependencies` gained a generic parameter for custom incompatibility type outside version conflicts, such as packages
not available for the current platform or permission errors. This type is on `DependencyProvider` as
`DependencyProvider::M`.

`pubgrub::range::Range` now lives in its own crate as [`version_ranges::Ranges`](https://docs.rs/version-ranges/0.1/version_ranges/struct.Ranges.html). A `Version` can be almost any
ordered type now, it only needs to support set operations through `VersionSet`.

At a glance, this is the new `DependencyProvider` interface:

```rust
pub trait DependencyProvider {
type P: Package;
type V: Debug + Display + Clone + Ord;
type VS: VersionSet<V = Self::V>;
type M: Eq + Clone + Debug + Display;
type Priority: Ord + Clone;
type Err: Error + 'static;

fn prioritize(
&self,
package: &Self::P,
range: &Self::VS,
package_conflicts_counts: &PackageResolutionStatistics,
) -> Self::Priority;

fn choose_version(
&self,
package: &Self::P,
range: &Self::VS,
) -> Result<Option<Self::V>, Self::Err>;

fn get_dependencies(
&self,
package: &Self::P,
version: &Self::V,
) -> Result<Dependencies<Self::P, Self::VS, Self::M>, Self::Err>;

}
```

## [0.2.1] - 2021-06-30 - [(diff with 0.2.0)][0.2.0-diff]

Expand Down Expand Up @@ -48,7 +98,7 @@ The gist of it is:

#### Added

- Links to code items in the code documenation.
- Links to code items in the code documentation.
- New `"serde"` feature that allows serializing some library types, useful for making simple reproducible bug reports.
- New variants for `error::PubGrubError` which are `DependencyOnTheEmptySet`,
`SelfDependency`, `ErrorChoosingPackageVersion` and `ErrorInShouldCancel`.
Expand Down Expand Up @@ -161,10 +211,12 @@ The gist of it is:
- `.gitignore` configured for a Rust project.
- `.github/workflows/` CI to automatically build, test and document on push and pull requests.

[0.3.0]: https://github.com/pubgrub-rs/pubgrub/releases/tag/v0.3.0
[0.2.1]: https://github.com/pubgrub-rs/pubgrub/releases/tag/v0.2.1
[0.2.0]: https://github.com/pubgrub-rs/pubgrub/releases/tag/v0.2.0
[0.1.0]: https://github.com/pubgrub-rs/pubgrub/releases/tag/v0.1.0

[unreleased-diff]: https://github.com/pubgrub-rs/pubgrub/compare/release...dev
[0.2.1-diff]: https://github.com/pubgrub-rs/pubgrub/compare/v0.2.1...v0.3.0
[0.2.0-diff]: https://github.com/pubgrub-rs/pubgrub/compare/v0.2.0...v0.2.1
[0.1.0-diff]: https://github.com/pubgrub-rs/pubgrub/compare/v0.1.0...v0.2.0
Loading

0 comments on commit 086d70b

Please sign in to comment.