From 0ed585fd515b8b150567b6d93a88981b7b828a04 Mon Sep 17 00:00:00 2001 From: Linlang <30293408+SunsetWolf@users.noreply.github.com> Date: Fri, 9 Aug 2024 12:05:45 +0800 Subject: [PATCH] docs: Add badge (#186) * add badge * fix docs version * fix docs error * fix docs version --- README.md | 8 ++++++-- docs/conf.py | 8 +++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index afeb01e2..43cc21ef 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,15 @@ [![Lint PR Title](https://github.com/microsoft/RD-Agent/actions/workflows/pr.yml/badge.svg)](https://github.com/microsoft/RD-Agent/actions/workflows/pr.yml) [![Readthedocs Preview](https://github.com/microsoft/RD-Agent/actions/workflows/readthedocs-preview.yml/badge.svg)](https://github.com/microsoft/RD-Agent/actions/workflows/readthedocs-preview.yml) [![Release.yml](https://github.com/microsoft/RD-Agent/actions/workflows/release.yml/badge.svg)](https://github.com/microsoft/RD-Agent/actions/workflows/release.yml) -[![Release](https://img.shields.io/github/v/release/microsoft/RD-Agent)](https://github.com/microsoft/RD-Agent/releases) +[![PyPI](https://img.shields.io/pypi/v/rdagent)](https://pypi.org/project/rdagent/) +[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/rdagent)](https://pypi.org/project/rdagent/) [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit) [![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) - + + + + # 📰 News | 🗞️News | 📝Description | diff --git a/docs/conf.py b/docs/conf.py index 6222a046..ebe1378c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -6,7 +6,9 @@ # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information -import importlib.metadata +import subprocess + +latest_tag = subprocess.check_output(["git", "describe", "--tags", "--abbrev=0"], text=True).strip() project = "RDAgent" copyright = "2024, Microsoft" @@ -33,8 +35,8 @@ # built documents. # # The short X.Y version. -version = importlib.metadata.version("rdagent") -release = importlib.metadata.version("rdagent") +version = latest_tag +release = latest_tag # The language for content autogenerated by Sphinx. Refer to documentation for # a list of supported languages.