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

Use packaging instead of pkg_resources for parsing version #12560

Merged
merged 1 commit into from
Aug 15, 2022

Conversation

fridex
Copy link
Contributor

@fridex fridex commented Jul 21, 2022

What does this PR do?

datadog-checks-downloader should use packaging to parse Python package versions.

@fridex fridex requested a review from a team as a code owner July 21, 2022 08:20
Copy link
Member

@cedricvanrompay-datadog cedricvanrompay-datadog left a comment

Choose a reason for hiding this comment

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

Isn't setuptools already in build_system.requires (line 4)?

@@ -37,6 +37,7 @@ deps = [
"securesystemslib[crypto,pynacl]==0.20.1",
"tuf==0.17.0; python_version < '3.0'",
"tuf==0.19.0; python_version > '3.0'",
"setuptools",

Choose a reason for hiding this comment

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

Shouldn't we pin the version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure if there should be pinned a specific version. What is the expected version range here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, we should pin the version. The current latest version, for example.

@codecov
Copy link

codecov bot commented Jul 21, 2022

Codecov Report

Merging #12560 (d588fae) into master (f29d304) will decrease coverage by 0.05%.
The diff coverage is n/a.

❗ Current head d588fae differs from pull request most recent head ae1721f. Consider uploading reports for the commit ae1721f to get more accurate results

Flag Coverage Δ
datadog_checks_downloader 81.12% <ø> (+0.78%) ⬆️
ddev ?
postgres ?

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

@fridex
Copy link
Contributor Author

fridex commented Jul 22, 2022

Isn't setuptools already in build_system.requires (line 4)?

That is a requirement for build system to build a package out of sources. This PR adds runtime dependency that needs to be installed when the integration is installed.

Copy link
Contributor

@ofek ofek left a comment

Choose a reason for hiding this comment

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

We should not be using that. Can you please switch to: https://packaging.pypa.io/en/latest/version.html

datadog-checks-downloader should use packaging to parse Python package versions.
@fridex fridex force-pushed the datadog-checks-downloader-setuptools branch from d588fae to ae1721f Compare August 15, 2022 10:07
@fridex
Copy link
Contributor Author

fridex commented Aug 15, 2022

Thanks for suggestions. Adjusted to use packaging in the most recent version.

@fridex fridex changed the title Add missing setuptools dependency to datadog-checks-downloader Use packaging instead of pkg_resources for parsing version Aug 15, 2022
@ofek ofek merged commit 421d5f6 into DataDog:master Aug 15, 2022
@fridex fridex deleted the datadog-checks-downloader-setuptools branch August 16, 2022 07:13
steveny91 pushed a commit that referenced this pull request Aug 18, 2022
datadog-checks-downloader should use packaging to parse Python package versions.
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.

4 participants