question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use packaging.version for comparing versions

See original GitHub issue

Because distutils.Version is deprecated, we have our own _compare_version function (https://github.com/mne-tools/mne-python/blob/main/mne/fixes.py#L32-L55). However, I was wondering (1) why this is in fixes and (2) why we do not use packaging.version.Version instead (which according to the DeprecationWarning is the recommended replacement). I’m happy to implement the changes (and probably move it back to utils?) if you think it makes sense. @hoechenberger WDYT?

Edit: Then we could also remove the corresponding warning filter.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:18 (18 by maintainers)

github_iconTop GitHub Comments

1reaction
cbrnrcommented, Jan 12, 2022

Yes, we should require a comment for every new filter warning! Maybe someone has the time to check which of these filters are not even necessary anymore?

I’d also try to vendor as few packages as possible, especially when we’re talking about core packages provided by pypa.

1reaction
agramfortcommented, Jan 12, 2022

no opinion

Message ID: @.***>

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I compare version numbers in Python? - Stack Overflow
Use packaging.version.parse . >>> # pip install packaging >>> from packaging import version >>> version.parse("2.3.1") ...
Read more >
Version Handling - Packaging
This class abstracts handling of a project's versions. A Version instance is comparison aware and can be compared and sorted using the standard...
Read more >
Compare two Version numbers - GeeksforGeeks
Implement a method to compare the two versions. If there are more than two versions, then the below versionCompare method can be used...
Read more >
Comparing package versions | Puppet Cookbook - Third Edition
Package version numbers are odd things. ... Comparing package versions ... And a numeric comparison won't work because they're not valid numbers.
Read more >
compare-versions - npm
Compare semver version strings to find greater, equal or lesser. Runs in the browser as well as Node.js/React Native etc. Has no dependencies ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found