Skip to content

Commit

Permalink
Get version number from bare gitverse command
Browse files Browse the repository at this point in the history
Release ``v2.7.1``
  • Loading branch information
dormant-user committed Oct 22, 2023
1 parent e9abedf commit c66d052
Show file tree
Hide file tree
Showing 9 changed files with 106 additions and 9 deletions.
5 changes: 5 additions & 0 deletions changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Commit History
==============

0.4.9 (10/22/2023)
------------------
- Get version number from bare ``gitverse`` command
- Release ``v2.7.1``

0.4.8 (09/25/2023)
------------------
- Release ``v2.7``
Expand Down
21 changes: 18 additions & 3 deletions docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ <h2 id="G">G</h2>
<li><a href="index.html#gitverse.commits.get_commits">get_commits() (in module gitverse.commits)</a>
</li>
<li><a href="index.html#gitverse.releases.get_dates">get_dates() (in module gitverse.releases)</a>
</li>
<li><a href="index.html#gitverse.commits.get_gitlog">get_gitlog() (in module gitverse.commits)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#gitverse.commits.get_gitlog">get_gitlog() (in module gitverse.commits)</a>
<li><a href="index.html#gitverse.utils.rst.get_release_notes">get_release_notes() (in module gitverse.utils.rst)</a>
</li>
<li><a href="index.html#gitverse.releases.get_releases">get_releases() (in module gitverse.releases)</a>
</li>
Expand All @@ -79,6 +81,13 @@ <h2 id="G">G</h2>

<ul>
<li><a href="index.html#module-gitverse.releases">module</a>
</li>
</ul></li>
<li>
gitverse.utils.rst

<ul>
<li><a href="index.html#module-gitverse.utils.rst">module</a>
</li>
</ul></li>
</ul></td>
Expand All @@ -94,22 +103,28 @@ <h2 id="M">M</h2>
<li><a href="index.html#module-gitverse.commits">gitverse.commits</a>
</li>
<li><a href="index.html#module-gitverse.releases">gitverse.releases</a>
</li>
<li><a href="index.html#module-gitverse.utils.rst">gitverse.utils.rst</a>
</li>
</ul></li>
</ul></td>
</tr></table>

<h2 id="R">R</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#gitverse.utils.rst.rst2dict">rst2dict() (in module gitverse.utils.rst)</a>
</li>
<li><a href="index.html#gitverse.utils.rst.rst2html">rst2html() (in module gitverse.utils.rst)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#gitverse.commits.run">run() (in module gitverse.commits)</a>

<ul>
<li><a href="index.html#gitverse.releases.run">(in module gitverse.releases)</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#gitverse.releases.run_git_cmd">run_git_cmd() (in module gitverse.releases)</a>
</li>
</ul></td>
Expand Down
66 changes: 63 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,68 @@ <h1>AuthBearer<a class="headerlink" href="#authbearer" title="Permalink to this
<section id="debugger">
<h1>Debugger<a class="headerlink" href="#debugger" title="Permalink to this heading"></a></h1>
</section>
<section id="rst-parser">
<h1>RST Parser<a class="headerlink" href="#rst-parser" title="Permalink to this heading"></a></h1>
<section id="module-gitverse.utils.rst">
<span id="rst-parser"></span><h1>RST Parser<a class="headerlink" href="#module-gitverse.utils.rst" title="Permalink to this heading"></a></h1>
<dl class="py function">
<dt class="sig sig-object py" id="gitverse.utils.rst.get_release_notes">
<span class="sig-prename descclassname"><span class="pre">gitverse.utils.rst.</span></span><span class="sig-name descname"><span class="pre">get_release_notes</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Union</span><span class="p"><span class="pre">[</span></span><span class="pre">PathLike</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">version</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Iterable</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#gitverse.utils.rst.get_release_notes" title="Permalink to this definition"></a></dt>
<dd><p>Get release notes from an RST file. Tested for files generated by this module.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>filename</strong> – Name of the source file.</p></li>
<li><p><strong>version</strong> – Version number to get release notes of a particular version.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Returns an iterable string.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>Iterable</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="gitverse.utils.rst.rst2dict">
<span class="sig-prename descclassname"><span class="pre">gitverse.utils.rst.</span></span><span class="sig-name descname"><span class="pre">rst2dict</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Union</span><span class="p"><span class="pre">[</span></span><span class="pre">PathLike</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">regular_dict</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Union</span><span class="p"><span class="pre">[</span></span><span class="pre">OrderedDict</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">Dict</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#gitverse.utils.rst.rst2dict" title="Permalink to this definition"></a></dt>
<dd><p>Converts RST file to a python dictionary.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>filename</strong> – Source filename or filepath.</p></li>
<li><p><strong>regular_dict</strong> – Boolean flag to return as regular dict. Defaults to <code class="docutils literal notranslate"><span class="pre">OrderedDict</span></code></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Output as regular dict or ordered dict based on arg passed.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>Union[OrderedDict, Dict]</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="gitverse.utils.rst.rst2html">
<span class="sig-prename descclassname"><span class="pre">gitverse.utils.rst.</span></span><span class="sig-name descname"><span class="pre">rst2html</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">src</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Union</span><span class="p"><span class="pre">[</span></span><span class="pre">PathLike</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dst</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Union</span><span class="p"><span class="pre">[</span></span><span class="pre">PathLike</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#gitverse.utils.rst.rst2html" title="Permalink to this definition"></a></dt>
<dd><p>Converts RST files to HTML.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>src</strong> – Source filename or filepath.</p></li>
<li><p><strong>dst</strong> – Destination filename or filepath.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>A boolean flag if conversion was successful.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
</dd></dl>

</section>
<section id="indices-and-tables">
<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this heading"></a></h1>
Expand All @@ -261,7 +321,7 @@ <h3><a href="#">Table of Contents</a></h3>
<li><a class="reference internal" href="#module-gitverse.commits">CommitHistory</a></li>
<li><a class="reference internal" href="#authbearer">AuthBearer</a></li>
<li><a class="reference internal" href="#debugger">Debugger</a></li>
<li><a class="reference internal" href="#rst-parser">RST Parser</a></li>
<li><a class="reference internal" href="#module-gitverse.utils.rst">RST Parser</a></li>
<li><a class="reference internal" href="#indices-and-tables">Indices and tables</a></li>
</ul>

Expand Down
Binary file modified docs/objects.inv
Binary file not shown.
5 changes: 5 additions & 0 deletions docs/py-modindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ <h1>Python Module Index</h1>
<td>&#160;&#160;&#160;
<a href="index.html#module-gitverse.releases"><code class="xref">gitverse.releases</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
<a href="index.html#module-gitverse.utils.rst"><code class="xref">gitverse.utils.rst</code></a></td><td>
<em></em></td></tr>
</table>


Expand Down
2 changes: 1 addition & 1 deletion docs/searchindex.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gitverse/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "2.7"
version = "2.7.1"
10 changes: 9 additions & 1 deletion gitverse/help.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import click

import gitverse


@click.command()
def main(*args) -> None:
@click.pass_context
@click.option("-V", "-v", "--version", required=False, is_flag=True, help="Get version of the package")
def main(*args, version: bool = False) -> None:
"""Generate a reStructuredText/Markdown file using GitHub releases or commit history.
Run 'gitverse-release --help' to get release notes' specific information.
Run 'gitverse-commit --help' to get commit history specific information.
Run 'gitverse -V' or 'gitverse --v' to get the version information.
"""
if version:
click.secho(click.style("v" + gitverse.version, fg='green'))
4 changes: 4 additions & 0 deletions release_notes.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Release Notes
=============

2.7.1 (10/22/2023)
------------------
- Include version number option for bare ``gitverse`` command

2.7 (09/25/2023)
----------------
- Includes a bug fix to honor deleted tags in ``gitverse-release``
Expand Down

0 comments on commit c66d052

Please sign in to comment.