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

Fix deprecation warnings with semver #12967

Merged
merged 1 commit into from
Oct 14, 2022

Conversation

FlorentClarret
Copy link
Member

@FlorentClarret FlorentClarret commented Sep 19, 2022

What does this PR do?

Switch from semver.parse_version_info to VersionInfo.parse.

Motivation

https://datadoghq.atlassian.net/browse/AI-2507

semver.parse_version_info is deprecated and we have warnings in the CI

@deprecated(replace="semver.VersionInfo.parse", version="2.10.0")
def parse_version_info(version):
    """
    Parse version string to a VersionInfo instance.

    .. deprecated:: 2.10.0
       Use :func:`semver.VersionInfo.parse` instead.

    .. versionadded:: 2.7.2
       Added :func:`semver.parse_version_info`

    :param version: version string
    :return: a :class:`VersionInfo` instance
    :rtype: :class:`VersionInfo`

    >>> version_info = semver.VersionInfo.parse("3.4.5-pre.2+build.4")
    >>> version_info.major
    3
    >>> version_info.minor
    4
    >>> version_info.patch
    5
    >>> version_info.prerelease
    'pre.2'
    >>> version_info.build
    'build.4'
    """
    return VersionInfo.parse(version)

Additional Notes

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • PR title must be written as a CHANGELOG entry (see why)
  • Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
  • PR must have changelog/ and integration/ labels attached

@codecov
Copy link

codecov bot commented Sep 19, 2022

Codecov Report

Merging #12967 (4ac3663) into master (d6414d3) will not change coverage.
The diff coverage is 90.90%.

Flag Coverage Δ
ambari 85.75% <ø> (ø)
arangodb 98.21% <ø> (ø)
avi_vantage 92.50% <ø> (ø)
calico 83.33% <ø> (ø)
cert_manager 77.41% <ø> (ø)
datadog_cluster_agent 90.00% <ø> (ø)
ddev 97.99% <ø> (ø)
ibm_i 81.58% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Contributor

@alopezz alopezz left a comment

Choose a reason for hiding this comment

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

Great!

@FlorentClarret FlorentClarret merged commit e3577e2 into master Oct 14, 2022
@FlorentClarret FlorentClarret deleted the florentclarret/semver-deprecation branch October 14, 2022 12:54
steveny91 pushed a commit that referenced this pull request Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants