File tree 6 files changed +26
-20
lines changed
6 files changed +26
-20
lines changed Original file line number Diff line number Diff line change @@ -51,8 +51,4 @@ coverage.xml
51
51
52
52
# Sphinx documentation
53
53
doc /build /
54
-
55
- # pbr stuff
56
- AUTHORS
57
- ChangeLog
58
- .eggs
54
+ src /doc8 /_version.py
Original file line number Diff line number Diff line change 1
- pbr # Apache
2
1
sphinx >= 1.8.0 # BSD
3
2
sphinx_rtd_theme >= 0.4.0 # MIT
Original file line number Diff line number Diff line change @@ -7,9 +7,6 @@ requires = [
7
7
]
8
8
build-backend = " setuptools.build_meta"
9
9
10
- [tool .setuptools_scm ]
11
- local_scheme = " no-local-version"
12
-
13
10
[project ]
14
11
name = " doc8"
15
12
description = " Style checker for Sphinx (or other) RST documentation"
@@ -75,7 +72,7 @@ filterwarnings = [
75
72
76
73
[[tool .mypy .overrides ]]
77
74
module = [
78
- " pbr " ,
75
+ " doc8._version " ,
79
76
" restructuredtext_lint" ,
80
77
" stevedore" ,
81
78
]
@@ -91,7 +88,6 @@ disable = [
91
88
" missing-class-docstring" ,
92
89
" missing-function-docstring" ,
93
90
" missing-module-docstring" ,
94
- " no-self-use" ,
95
91
" too-few-public-methods" ,
96
92
" too-many-arguments" ,
97
93
" too-many-branches" ,
@@ -117,3 +113,7 @@ license-files = ["LICENSE"]
117
113
[tool .setuptools .packages .find ]
118
114
where = [" src" ]
119
115
namespaces = false
116
+
117
+ [tool .setuptools_scm ]
118
+ local_scheme = " no-local-version"
119
+ write_to = " src/doc8/_version.py"
Original file line number Diff line number Diff line change 1
- from .main import doc8 # noqa
1
+ """doc8 - A docutils linter."""
2
+ from __future__ import annotations
3
+ from doc8 .version import __version__
4
+ from doc8 .main import doc8 # noqa
5
+
6
+
7
+ __all__ = ("__version__" ,)
Original file line number Diff line number Diff line change @@ -522,7 +522,7 @@ def main():
522
522
)
523
523
args = vars (parser .parse_args ())
524
524
if args .get ("version" ):
525
- print (version .version_string )
525
+ print (version .__version__ )
526
526
return 0
527
527
528
528
result = doc8 (args )
Original file line number Diff line number Diff line change 14
14
# License for the specific language governing permissions and limitations
15
15
# under the License.
16
16
17
+ """doc8 version information."""
17
18
try :
18
- from pbr import version as pbr_version
19
+ from ._version import version as __version__
20
+ except ImportError : # pragma: no branch
19
21
20
- _version_info = pbr_version .VersionInfo ("doc8" )
21
- version_string = _version_info .version_string ()
22
- except ImportError :
23
- import pkg_resources
22
+ try :
23
+ import pkg_resources
24
24
25
- _version_info = pkg_resources .get_distribution ("doc8" )
26
- version_string = _version_info .version
25
+ __version__ = pkg_resources .get_distribution ("doc8" ).version
26
+ except Exception : # pylint: disable=broad-except
27
+ # this is the fallback SemVer version picked by setuptools_scm when tag
28
+ # information is not available.
29
+ __version__ = "0.1.dev1"
30
+
31
+ __all__ = ("__version__" ,)
You can’t perform that action at this time.
0 commit comments