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 2162c0c
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 17 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
8 changes: 4 additions & 4 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,6 @@ filterwarnings = [

[[tool.mypy.overrides]]
module = [
"pbr",
"restructuredtext_lint",
"stevedore",
]
Expand Down Expand Up @@ -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"
6 changes: 6 additions & 0 deletions src/doc8/__init__.py
@@ -1 +1,7 @@
"""doc8 - A docutils linter."""
from __future__ import annotations
from .main import doc8 # noqa

from doc8.version import __version__

__all__ = ("__version__",)
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 2162c0c

Please sign in to comment.