Skip to content

Commit

Permalink
Remove use of pbr
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Dec 21, 2022
1 parent 1f194f7 commit 7366c5d
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 20 deletions.
6 changes: 1 addition & 5 deletions .gitignore
Expand Up @@ -51,8 +51,4 @@ coverage.xml

# Sphinx documentation
doc/build/

# pbr stuff
AUTHORS
ChangeLog
.eggs
src/doc8/_version.py
1 change: 0 additions & 1 deletion doc/requirements.txt
@@ -1,3 +1,2 @@
pbr # Apache
sphinx>=1.8.0 # BSD
sphinx_rtd_theme>=0.4.0 # MIT
10 changes: 5 additions & 5 deletions pyproject.toml
Expand Up @@ -7,9 +7,6 @@ requires = [
]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
local_scheme = "no-local-version"

[project]
name = "doc8"
description = "Style checker for Sphinx (or other) RST documentation"
Expand Down Expand Up @@ -75,7 +72,7 @@ filterwarnings = [

[[tool.mypy.overrides]]
module = [
"pbr",
"doc8._version",
"restructuredtext_lint",
"stevedore",
]
Expand All @@ -91,7 +88,6 @@ disable = [
"missing-class-docstring",
"missing-function-docstring",
"missing-module-docstring",
"no-self-use",
"too-few-public-methods",
"too-many-arguments",
"too-many-branches",
Expand All @@ -117,3 +113,7 @@ license-files = ["LICENSE"]
[tool.setuptools.packages.find]
where = ["src"]
namespaces = false

[tool.setuptools_scm]
local_scheme = "no-local-version"
write_to = "src/doc8/_version.py"
8 changes: 7 additions & 1 deletion src/doc8/__init__.py
@@ -1 +1,7 @@
from .main import doc8 # noqa
"""doc8 - A docutils linter."""
from __future__ import annotations
from doc8.version import __version__
from doc8.main import doc8 # noqa


__all__ = ("__version__",)
2 changes: 1 addition & 1 deletion src/doc8/main.py
Expand Up @@ -522,7 +522,7 @@ def main():
)
args = vars(parser.parse_args())
if args.get("version"):
print(version.version_string)
print(version.__version__)
return 0

result = doc8(args)
Expand Down
19 changes: 12 additions & 7 deletions src/doc8/version.py
Expand Up @@ -14,13 +14,18 @@
# License for the specific language governing permissions and limitations
# under the License.

"""doc8 version information."""
try:
from pbr import version as pbr_version
from ._version import version as __version__
except ImportError: # pragma: no branch

_version_info = pbr_version.VersionInfo("doc8")
version_string = _version_info.version_string()
except ImportError:
import pkg_resources
try:
import pkg_resources

_version_info = pkg_resources.get_distribution("doc8")
version_string = _version_info.version
__version__ = pkg_resources.get_distribution("doc8").version
except Exception: # pylint: disable=broad-except
# this is the fallback SemVer version picked by setuptools_scm when tag
# information is not available.
__version__ = "0.1.dev1"

__all__ = ("__version__",)

0 comments on commit 7366c5d

Please sign in to comment.