Skip to content

Commit 0a5a94c

Browse files
committed
release: 0.2.0 (#67)
2 parents b47781d + 341923f commit 0a5a94c

35 files changed

+7913
-857
lines changed

.commitlintrc.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
extends:
2+
- '@commitlint/config-conventional'
3+
4+
# https://commitlint.js.org/#/reference-rules
5+
rules:
6+
header-max-length: [ 2, 'always', 72 ]
7+
body-max-line-length: [ 1, 'always', 72 ]
8+
footer-max-line-length: [ 1, 'always', 72 ]
9+
footer-leading-blank: [ 1, 'always' ]
10+
type-enum: [
11+
2,
12+
'always',
13+
[
14+
'build',
15+
'ci',
16+
'docs',
17+
'feat',
18+
'fix',
19+
'perf',
20+
'refactor',
21+
'release',
22+
'revert',
23+
'style',
24+
'test',
25+
]
26+
]

.github/workflows/ci.yml

+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
push:
5+
branches: [ master, dev ]
6+
schedule: [ cron: "0 6 * * 4" ]
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
jobs:
12+
test:
13+
name: Tests pass
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Install stable Rust
18+
uses: actions-rs/toolchain@v1
19+
with:
20+
toolchain: stable
21+
profile: minimal
22+
23+
- name: Get Cargo version
24+
id: cargo_version
25+
run: echo "::set-output name=version::$(cargo -V | tr -d ' ')"
26+
shell: bash
27+
28+
- name: Download cache
29+
uses: actions/cache@v2
30+
with:
31+
path: |
32+
~/.cargo/registry/index/
33+
~/.cargo/registry/cache/
34+
~/.cargo/git/db/
35+
target/
36+
key: ${{ runner.os }}-${{ steps.cargo_version.outputs.version }}-${{ hashFiles('Cargo.toml') }}
37+
restore-keys: ${{ runner.os }}-${{ steps.cargo_version.outputs.version }}
38+
39+
- name: Build
40+
run: cargo build --verbose
41+
42+
- name: Run tests
43+
run: cargo test --features=serde --verbose
44+
45+
clippy:
46+
name: No warnings from Clippy
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v2
50+
- name: Install stable Rust
51+
uses: actions-rs/toolchain@v1
52+
with:
53+
toolchain: stable
54+
profile: minimal
55+
components: clippy
56+
57+
- name: Check Clippy lints
58+
env:
59+
RUSTFLAGS: -D warnings
60+
run: cargo clippy
61+
62+
check_formatting:
63+
name: Source code is formatted
64+
runs-on: ubuntu-latest
65+
steps:
66+
- uses: actions/checkout@v2
67+
- name: Install stable Rust
68+
uses: actions-rs/toolchain@v1
69+
with:
70+
toolchain: stable
71+
profile: minimal
72+
components: rustfmt
73+
74+
- name: Check formatting
75+
run: cargo fmt --all -- --check
76+
77+
check_documentation:
78+
name: Documentation builds successfully
79+
runs-on: ubuntu-latest
80+
steps:
81+
- uses: actions/checkout@v2
82+
- name: Install nightly Rust
83+
uses: actions-rs/toolchain@v1
84+
with:
85+
toolchain: nightly
86+
profile: minimal
87+
88+
- name: Download cache
89+
uses: actions/cache@v2
90+
with:
91+
path: |
92+
~/.cargo/registry/index/
93+
~/.cargo/registry/cache/
94+
~/.cargo/git/db/
95+
target/
96+
key: documentation
97+
98+
- name: Check documentation
99+
env:
100+
RUSTDOCFLAGS: -D warnings
101+
run: cargo +nightly doc --no-deps --document-private-items
102+
103+
check_commit_conventions:
104+
name: Commit messages follow project guidelines
105+
runs-on: ubuntu-latest
106+
steps:
107+
- uses: actions/checkout@v2
108+
with:
109+
fetch-depth: 0
110+
- name: Check commit conventions
111+
uses: wagoid/commitlint-github-action@v2
112+
with:
113+
configFile: .commitlintrc.yml
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Deploys the latest development documentation to Github Pages
2+
3+
name: Deploy documentation
4+
on:
5+
push:
6+
branches: [ dev ]
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
jobs:
12+
deploy_documentation:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Install nightly
17+
uses: actions-rs/toolchain@v1
18+
with:
19+
toolchain: nightly
20+
profile: minimal
21+
22+
- name: Download cache
23+
uses: actions/cache@v2
24+
with:
25+
path: |
26+
~/.cargo/registry/index/
27+
~/.cargo/registry/cache/
28+
~/.cargo/git/db/
29+
target/
30+
key: documentation
31+
32+
- name: Build documentation
33+
run: cargo +nightly doc --no-deps
34+
35+
- name: Deploy documentation
36+
uses: peaceiris/actions-gh-pages@v3
37+
with:
38+
github_token: ${{ secrets.GITHUB_TOKEN }}
39+
publish_dir: ./target/doc
40+
force_orphan: true

.github/workflows/pull-request.yml

-31
This file was deleted.

.github/workflows/push.yml

-41
This file was deleted.

CHANGELOG.md

+137
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
## Unreleased [(diff)][diff-unreleased]
6+
7+
## [0.2.0] - 2020-11-19 - [(diff with 0.1.0)][diff-0.2.0]
8+
9+
This release brings many important improvements to PubGrub.
10+
The gist of it is:
11+
12+
- A bug in the algorithm's implementation was [fixed](https://github.com/pubgrub-rs/pubgrub/pull/23).
13+
- The solver is now implemented in a `resolve` function taking as argument
14+
an implementer of the `DependencyProvider` trait,
15+
which has more control over the decision making process.
16+
- End-to-end property testing of large synthetic registries was added.
17+
- More than 10x performance improvement.
18+
19+
### Changes affecting the public API
20+
21+
#### Added
22+
23+
- Links to code items in the code documenation.
24+
- New `"serde"` feature that allows serializing some library types, useful for making simple reproducible bug reports.
25+
- New variants for `error::PubGrubError` which are `DependencyOnTheEmptySet`,
26+
`SelfDependency`, `ErrorChoosingPackageVersion` and `ErrorInShouldCancel`.
27+
- New `type_alias::Map` defined as `rustc_hash::FxHashMap`.
28+
- New `type_alias::SelectedDependencies<P, V>` defined as `Map<P, V>`.
29+
- The types `Dependencies` and `DependencyConstraints` were introduced to clarify intent.
30+
- New function `choose_package_with_fewest_versions` to help implement
31+
the `choose_package_version` method of a `DependencyProvider`.
32+
- Implement `FromStr` for `SemanticVersion`.
33+
- Add the `VersionParseError` type for parsing of semantic versions.
34+
35+
#### Changed
36+
37+
- The `Solver` trait was replaced by a `DependencyProvider` trait
38+
which now must implement a `choose_package_version` method
39+
instead of `list_available_versions`.
40+
So it now has the ability to choose a package in addition to a version.
41+
The `DependencyProvider` also has a new optional method `should_cancel`
42+
that may be used to stop the solver if needed.
43+
- The `choose_package_version` and `get_dependencies` methods of the
44+
`DependencyProvider` trait now take an immutable reference to `self`.
45+
Interior mutability can be used by implementor if mutability is needed.
46+
- The `Solver.run` method was thus replaced by a free function `solver::resolve`
47+
taking a dependency provider as first argument.
48+
- The `OfflineSolver` is thus replaced by an `OfflineDependencyProvider`.
49+
- `SemanticVersion` now takes `u32` instead of `usize` for its 3 parts.
50+
- `NumberVersion` now uses `u32` instead of `usize`.
51+
52+
#### Removed
53+
54+
- `ErrorRetrievingVersions` variant of `error::PubGrubError`.
55+
56+
### Changes in the internal parts of the API
57+
58+
#### Added
59+
60+
- `benches/large_case.rs` enables benchmarking of serialized registries of packages.
61+
- `examples/caching_dependency_provider.rs` an example dependency provider caching dependencies.
62+
- `PackageTerm<P, V> = (P, Term<V>)` new type alias for readability.
63+
- `Memory.term_intersection_for_package(&mut self, package: &P) -> Option<&Term<V>>`
64+
- New types were introduces for conflict resolution in `internal::partial_solution`
65+
to clarify the intent and return values of some functions.
66+
Those types are `DatedAssignment` and `SatisfierAndPreviousHistory`.
67+
- `PartialSolution.term_intersection_for_package` calling the same function
68+
from its `memory`.
69+
- New property tests for ranges: `negate_contains_opposite`, `intesection_contains_both`
70+
and `union_contains_either`.
71+
- A large synthetic test case was added in `test-examples/`.
72+
- A new test example `double_choices` was added
73+
for the detection of a bug (fixed) in the implementation.
74+
- Property testing of big synthetic datasets was added in `tests/proptest.rs`.
75+
- Comparison of PubGrub solver and a SAT solver
76+
was added with `tests/sat_dependency_provider.rs`.
77+
- Other regression and unit tests were added to `tests/tests.rs`.
78+
79+
#### Changed
80+
81+
- CI workflow was improved (`./github/workflows/`), including a check for [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) and [Clippy ](https://github.com/rust-lang/rust-clippy) for source code linting.
82+
- Using SPDX license identifiers instead of MPL-2.0 classic file headers.
83+
- `State.incompatibilities` is now wrapped inside a `Rc`.
84+
- `DecisionLevel(u32)` is used in place of `usize` for partial solution decision levels.
85+
- `State.conflict_resolution` now also returns the almost satisfied package
86+
to avoid an unnecessary call to `self.partial_solution.relation(...)` after conflict resolution.
87+
- `Kind::NoVersion` renamed to `Kind::NoVersions` and all other usage of `noversion`
88+
has been changed to `no_versions`.
89+
- Variants of the `incompatibility::Relation` enum have changed.
90+
- Incompatibility now uses a deterministic hasher to store packages in its hash map.
91+
- `incompatibility.relation(...)` now takes a function as argument to avoid computations
92+
of unnecessary terms intersections.
93+
- `Memory` now uses a deterministic hasher instead of the default one.
94+
- `memory::PackageAssignments` is now an enum instead of a struct.
95+
- Derivations in a `PackageAssignments` keep a precomputed intersection of derivation terms.
96+
- `potential_packages` method now returns a `Range`
97+
instead of a `Term` for the versions constraint of each package.
98+
- `PartialSolution.relation` now takes `&mut self` instead of `&self`
99+
to be able to store computation of terms intersection.
100+
- `Term.accept_version` was renamed `Term.contains`.
101+
- The `satisfied_by` and `contradicted_by` methods of a `Term`
102+
now directly takes a reference to the intersection of other terms.
103+
Same for `relation_with`.
104+
105+
#### Removed
106+
107+
- `term` field of an `Assignment::Derivation` variant.
108+
- `Memory.all_terms` method was removed.
109+
- `Memory.remove_decision` method was removed in favor of a check before using `Memory.add_decision`.
110+
- `PartialSolution` methods `pick_package` and `pick_version` have been removed
111+
since control was given back to the dependency provider to choose a package version.
112+
- `PartialSolution` methods `remove_last_decision` and `satisfies_any_of` were removed
113+
in favor of a preventive check before calling `add_decision`.
114+
- `Term.is_negative`.
115+
116+
#### Fixed
117+
118+
- Prior cause computation (`incompatibility::prior_cause`) now uses the intersection of package terms
119+
instead of their union, which was an implementation error.
120+
121+
## [0.1.0] - 2020-10-01
122+
123+
### Added
124+
125+
- `README.md` as the home page of this repository.
126+
- `LICENSE`, code is provided under the MPL 2.0 license.
127+
- `Cargo.toml` configuration of this Rust project.
128+
- `src/` containing all the source code for this first implementation of PubGrub in Rust.
129+
- `tests/` containing test end-to-end examples.
130+
- `examples/` other examples, not in the form of tests.
131+
- `.gitignore` configured for a Rust project.
132+
- `.github/workflows/` CI to automatically build, test and document on push and pull requests.
133+
134+
[0.2.0]: https://github.com/pubgrub-rs/pubgrub/releases/tag/v0.2.0
135+
[0.1.0]: https://github.com/pubgrub-rs/pubgrub/releases/tag/v0.1.0
136+
[diff-unreleased]: https://github.com/pubgrub-rs/pubgrub/compare/release...dev
137+
[diff-0.2.0]: https://github.com/mpizenberg/elm-pointer-events/compare/v0.1.0...v0.2.0

0 commit comments

Comments
 (0)