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

Deprecate hash function from FileDependency #535

Merged
merged 1 commit into from
Dec 7, 2022

Conversation

dunkmann00
Copy link
Contributor

@dunkmann00 dunkmann00 commented Nov 30, 2022

This will enable URLDependency to compute the hash for the file at the temporary path. The temporary path should be the path to the downloaded file from URLDependency.url.

Relates-to: python-poetry/poetry#7121

  • Added tests for changed code.
  • Updated documentation for changed code.

@dimbleby
Copy link
Contributor

dimbleby commented Nov 30, 2022

Given the way that python-poetry/poetry#7121 is going, this wants to become an MR that deprecates or removes the hash() method on the file dependency

@dunkmann00 dunkmann00 changed the title Add hash function to URLDependency Remove hash function from FileDependency Nov 30, 2022
@dunkmann00
Copy link
Contributor Author

I removed the hash function from URLDependency and the tests that went with it, so I think this should be good pending python-poetry/poetry#7121.

@dunkmann00 dunkmann00 marked this pull request as ready for review December 1, 2022 02:39
@radoering
Copy link
Member

Please don't remove but deprecate it. See

def normalize_version(version: str) -> str:
warnings.warn(
"normalize_version() is deprecated. Use Version.parse().to_string() instead.",
DeprecationWarning,
stacklevel=2,
)
return PEP440Version.parse(version).to_string()
for an example.

In the tests, please add a with pytest.warns(DeprecationWarning):

@sonarcloud
Copy link

sonarcloud bot commented Dec 1, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@dunkmann00
Copy link
Contributor Author

Okay, added it back with the deprecation warnings.

@radoering radoering changed the title Remove hash function from FileDependency Deprecate hash function from FileDependency Dec 7, 2022
@radoering radoering merged commit c42f5a2 into python-poetry:main Dec 7, 2022
@dunkmann00 dunkmann00 deleted the urldeps-hash branch December 7, 2022 16:32
@radoering radoering mentioned this pull request Jan 24, 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.

3 participants