Deprecate missing module-level functions (like semver.compare, semver.match, ...)
See original GitHub issueSituation
We deprecated most of our module-level functions, but it seems, I forgot semver.match
.
Proposal
I assume, this function should also be added to the list of deprecated function. It also should be moved to the semver.VersionInfo
class.
@python-semver/reviewers Any objections?
There are some other module-level functions:
semver.compare
semver.max_ver
semver.min_ver
@gsakkis: What should we do with these? Deprecate them too and move them to the semver.VersionInfo
class?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Using semver — python-semver 2.13.0 documentation
Module level functions are marked as deprecated in version 2.10.0 now. ... fine-grained approach of comparing two versions, use the semver.match() function.
Read more >python-semver Documentation - Read the Docs
module level functions are marked as deprecated since version 2. ... approach of comparing two versions, use the semver.match() function.
Read more >Semantic Versioning 2.0.0 | Semantic Versioning
Given a version number MAJOR.MINOR.PATCH, increment the: MAJOR version when you make incompatible API changes; MINOR version when you add functionality in a ......
Read more >Reference — python-semanticversion 2.1.0 documentation
Provides comparison methods with other Version objects. The rules are: For non-partial versions, compare using the SemVer scheme. If any compared object is ......
Read more >draft-verdt-netmod-yang-semver-00 - IETF Datatracker
YANG Semantic Versioning for Modules (Internet-Draft, 2019) ... 'status' statement to allow additional documentation as to why a node is being deprecated, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No objection. Python is not Julia. So let’s prefer methods instead over functions.
As someone who contributes to a project that uses this library I have to say that I disagree with these deprecations. Replacing
semver.compare(version1, version2)
withsemver.VersionInfo.parse(version1).compare(version2)
is just an ugly solution. The first one is clean, easy to read and easy to understand. The second one is ugly, and unnecessarily verbose.I think your refactor to use
VersionInfo
under the hood is a great solution, but I don’t see why thecompare
convenience function needs to become deprecated in the process. I would guess that most use cases of this library are fairly simple, as is the case for my project, and for those use casessemver.compare
is objectively better.Let me counter @scls19fr 's comment with this:
Python is not Java. You do not need to make everything a class.