Skip to content

Commit

Permalink
Fix #410 Export all names in __all__ variable
Browse files Browse the repository at this point in the history
* Export all semver names in `__all__` variable.
* Fix linting issues
  • Loading branch information
Soneji committed Jun 14, 2023
1 parent 9227686 commit 17bc257
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog.d/410.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Export functions properly using `__all__` in `__init__.py`.
35 changes: 34 additions & 1 deletion src/semver/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
semver package major release 3.
Semver package major release 3.
A Python module for semantic versioning. Simplifies comparing versions.
"""
Expand Down Expand Up @@ -37,3 +37,36 @@
__maintainer_email__,
SEMVER_SPEC_VERSION,
)

__all__ = [
"bump_build",
"bump_major",
"bump_minor",
"bump_patch",
"compare",
"bump_prerelease",
"finalize_version",
"format_version",
"match",
"max_ver",
"min_ver",
"parse",
"parse_version_info",
"replace",
"cmd_bump",
"cmd_compare",
"cmd_nextver",
"cmd_check",
"createparser",
"process",
"main",
"Version",
"VersionInfo",
"__version__",
"__author__",
"__maintainer__",
"__author_email__",
"__description__",
"__maintainer_email__",
"SEMVER_SPEC_VERSION",
]
2 changes: 1 addition & 1 deletion src/semver/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def cmd_check(args: argparse.Namespace) -> None:

def cmd_compare(args: argparse.Namespace) -> str:
"""
Subcommand: Compare two versions
Subcommand: Compare two versions.
Synopsis: compare <VERSION1> <VERSION2>
Expand Down
4 changes: 2 additions & 2 deletions src/semver/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ class Version:
See specification at https://semver.org.
:param major: version when you make incompatible API changes.
:param minor: version when you add functionality in
a backwards-compatible manner.
:param minor: version when you add functionality in a backwards-
compatible manner.
:param patch: version when you make backwards-compatible bug fixes.
:param prerelease: an optional prerelease string
:param build: an optional build string
Expand Down

0 comments on commit 17bc257

Please sign in to comment.