Bump crates version from the latest crates.io version#12
Merged
Conversation
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
jsdw
reviewed
May 30, 2023
src/crate_details.rs
Outdated
| // If so, we need to bump the current version. | ||
| let known_versions = external::crates_io::get_known_crate_versions(&self.name)?; | ||
| Ok(known_versions.contains(&self.version)) | ||
| self.known_versions = external::crates_io::get_known_crate_versions(&self.name)?; |
Collaborator
There was a problem hiding this comment.
Personally I'd prob just call this in CrateDetails::load, prob just with a little interface like:
pub struct CrateVersions {
name: String
versions: RefCell<Option<HashSet<Version>>>
}
impl CrateVersions {
pub fn new(crate_name: String) -> Self { ... }
pub fn get(&self) -> &HashSet<Versions> {
// get from cache or load from crates.io if not obtained yet)
}
}That way the bump version function isn't dependant on this one running first or whatever in order to work properly :)
Collaborator
|
Looks great to me; just a wee suggestion for tidiness so that the order that we call functions in doesn't matter :) |
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
jsdw
approved these changes
May 31, 2023
niklasad1
reviewed
May 31, 2023
niklasad1
approved these changes
May 31, 2023
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR guarantees that when preparing for publication on crates.io, the latest version of the crate is obtained directly from crates.io.
By doing so, any differences in versions between the local repository, which might contain an outdated version and the versions on crates.io are avoided.
While at it, fixed clippy and applied cargo fmt
Testing Done
// @paritytech/subxt-team