Skip to content

Commit 17bc257

Browse files
authored
Fix #410 Export all names in __all__ variable
* Export all semver names in `__all__` variable. * Fix linting issues
1 parent 9227686 commit 17bc257

File tree

4 files changed

+38
-4
lines changed

4 files changed

+38
-4
lines changed

changelog.d/410.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Export functions properly using `__all__` in `__init__.py`.

src/semver/__init__.py

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
semver package major release 3.
2+
Semver package major release 3.
33
44
A Python module for semantic versioning. Simplifies comparing versions.
55
"""
@@ -37,3 +37,36 @@
3737
__maintainer_email__,
3838
SEMVER_SPEC_VERSION,
3939
)
40+
41+
__all__ = [
42+
"bump_build",
43+
"bump_major",
44+
"bump_minor",
45+
"bump_patch",
46+
"compare",
47+
"bump_prerelease",
48+
"finalize_version",
49+
"format_version",
50+
"match",
51+
"max_ver",
52+
"min_ver",
53+
"parse",
54+
"parse_version_info",
55+
"replace",
56+
"cmd_bump",
57+
"cmd_compare",
58+
"cmd_nextver",
59+
"cmd_check",
60+
"createparser",
61+
"process",
62+
"main",
63+
"Version",
64+
"VersionInfo",
65+
"__version__",
66+
"__author__",
67+
"__maintainer__",
68+
"__author_email__",
69+
"__description__",
70+
"__maintainer_email__",
71+
"SEMVER_SPEC_VERSION",
72+
]

src/semver/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def cmd_check(args: argparse.Namespace) -> None:
6161

6262
def cmd_compare(args: argparse.Namespace) -> str:
6363
"""
64-
Subcommand: Compare two versions
64+
Subcommand: Compare two versions.
6565
6666
Synopsis: compare <VERSION1> <VERSION2>
6767

src/semver/version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ class Version:
6464
See specification at https://semver.org.
6565
6666
:param major: version when you make incompatible API changes.
67-
:param minor: version when you add functionality in
68-
a backwards-compatible manner.
67+
:param minor: version when you add functionality in a backwards-
68+
compatible manner.
6969
:param patch: version when you make backwards-compatible bug fixes.
7070
:param prerelease: an optional prerelease string
7171
:param build: an optional build string

0 commit comments

Comments
 (0)