Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add major/minor/micro for Version #9

Merged
merged 2 commits into from
May 6, 2023
Merged

Add major/minor/micro for Version #9

merged 2 commits into from
May 6, 2023

Conversation

ischaojie
Copy link
Contributor

@ischaojie ischaojie commented May 5, 2023

Like packaging: https://packaging.pypa.io/en/stable/version.html#packaging.version.Version.major, add major/ minor / micro property.

@ischaojie ischaojie marked this pull request as ready for review May 5, 2023 03:33
Copy link
Owner

@konstin konstin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please change those to getters and @property as packaging does?

src/version.rs Outdated
Comment on lines 354 to 367
#[getter]
pub fn major(&self) -> usize {
self.0.major
}
/// The second item of release or 0 if unavailable.
#[getter]
pub fn minor(&self) -> usize {
self.0.minor
}
/// The third item of release or 0 if unavailable.
#[getter]
pub fn micro(&self) -> usize {
self.0.micro
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean this?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, but don't make them fields of the object (they are duplicate with the release vec), but get them dynamically from the vec

@konstin
Copy link
Owner

konstin commented May 6, 2023

thank you!

@konstin konstin merged commit a692fd7 into konstin:main May 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants