From 754f2ecd42c4b9b059fd95ee2524825484e9025f Mon Sep 17 00:00:00 2001 From: thevickypedia Date: Wed, 30 Aug 2023 23:30:45 -0500 Subject: [PATCH] Restructure version naming in output files Set return type to None from NoReturn Upgrade to latest flake8 and isort Bump version --- .pre-commit-config.yaml | 10 +++--- changelog.rst | 6 ++++ docs/genindex.html | 19 ++--------- docs/index.html | 70 +++------------------------------------- docs/objects.inv | Bin 488 -> 459 bytes docs/py-modindex.html | 5 --- docs/searchindex.js | 2 +- gitverse/__init__.py | 2 +- gitverse/commits.py | 4 +-- gitverse/releases.py | 6 ++-- release_notes.rst | 41 ++++++++++++----------- 11 files changed, 47 insertions(+), 118 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b0f28e8..09bae1d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,18 +1,18 @@ repos: - - repo: https://github.com/pycqa/flake8 - rev: '3.9.2' + repo: https://github.com/PyCQA/flake8 + rev: '6.1.0' hooks: - id: flake8 additional_dependencies: - flake8-docstrings - flake8-sfs - args: [--max-line-length=120, --extend-ignore=SFS3 D107 SFS301 D100 D104 D401 SFS201 SFS101] + args: [--max-line-length=120, --extend-ignore=SFS3 D107 SFS301 D100 D104 D401 SFS101 SFS201] - - repo: https://github.com/pre-commit/mirrors-isort - rev: 'v5.8.0' + repo: https://github.com/PyCQA/isort + rev: '5.12.0' hooks: - id: isort diff --git a/changelog.rst b/changelog.rst index eed75fc..0f28498 100644 --- a/changelog.rst +++ b/changelog.rst @@ -1,6 +1,12 @@ Commit History ============== +0.4.5 (08/30/2023) +------------------ +- Set return type to None from NoReturn +- Upgrade to latest flake8 and isort +- Bump version + 0.4.4 (08/19/2023) ------------------ - Add ``BearerAuth`` object to authenticate request diff --git a/docs/genindex.html b/docs/genindex.html index e002fdd..d78d438 100644 --- a/docs/genindex.html +++ b/docs/genindex.html @@ -91,8 +91,6 @@

G

  • get_dates() (in module gitverse.releases)
  • get_gitlog() (in module gitverse.commits) -
  • -
  • get_release_notes() (in module gitverse.utils.rst)
  • get_releases() (in module gitverse.releases)
  • @@ -124,13 +122,6 @@

    G

    -
  • - gitverse.utils.rst - -
  • @@ -158,8 +149,6 @@

    M

  • gitverse.debugger
  • gitverse.releases -
  • -
  • gitverse.utils.rst
  • @@ -167,12 +156,6 @@

    M

    R

    - + diff --git a/docs/index.html b/docs/index.html index b504bd5..e2b9dd1 100644 --- a/docs/index.html +++ b/docs/index.html @@ -118,7 +118,7 @@

    Welcome to GitVerse’s documentation!
    -gitverse.releases.run(filename: str, title: str) NoReturn
    +gitverse.releases.run(filename: str, title: str) None

    Handler for generator functions that writes the release notes into a file.

    Parameters:
    @@ -214,7 +214,7 @@

    Welcome to GitVerse’s documentation!
    -gitverse.commits.run(branch: str, filename: str, title: str) NoReturn
    +gitverse.commits.run(branch: str, filename: str, title: str) None

    Handler for generator functions that writes the commit history into a file.

    Parameters:
    @@ -279,68 +279,8 @@

    Welcome to GitVerse’s documentation! -

    RST Parser

    -
    -
    -gitverse.utils.rst.get_release_notes(filename: Union[PathLike, str], version: str = None) Iterable[str]
    -

    Get release notes from an RST file. Tested for files generated by this module.

    -
    -
    Parameters:
    -
      -
    • filename – Name of the source file.

    • -
    • version – Version number to get release notes of a particular version.

    • -
    -
    -
    Returns:
    -

    Returns an iterable string.

    -
    -
    Return type:
    -

    Iterable

    -
    -
    -
    - -
    -
    -gitverse.utils.rst.rst2dict(filename: Union[PathLike, str], regular_dict: bool = False) Union[OrderedDict, Dict]
    -

    Converts RST file to a python dictionary.

    -
    -
    Parameters:
    -
      -
    • filename – Source filename or filepath.

    • -
    • regular_dict – Boolean flag to return as regular dict. Defaults to OrderedDict

    • -
    -
    -
    Returns:
    -

    Output as regular dict or ordered dict based on arg passed.

    -
    -
    Return type:
    -

    Union[OrderedDict, Dict]

    -
    -
    -
    - -
    -
    -gitverse.utils.rst.rst2html(src: Union[PathLike, str], dst: Union[PathLike, str]) bool
    -

    Converts RST files to HTML.

    -
    -
    Parameters:
    -
      -
    • src – Source filename or filepath.

    • -
    • dst – Destination filename or filepath.

    • -
    -
    -
    Returns:
    -

    A boolean flag if conversion was successful.

    -
    -
    Return type:
    -

    bool

    -
    -
    -
    - +
    +

    RST Parser

    Indices and tables

    @@ -366,7 +306,7 @@

    Table of Contents

  • CommitHistory
  • AuthBearer
  • Debugger
  • -
  • RST Parser
  • +
  • RST Parser
  • Indices and tables
  • diff --git a/docs/objects.inv b/docs/objects.inv index 9b3f91e5fe63baf54afdd8f2c869e304242dacc0..6090425efdbafc308362e89ce0817d41b2ce52dd 100644 GIT binary patch delta 335 zcmV-V0kHn)1Iq)Dg@4!GhM3R}lO~YhSfz=VMoN<^ae>`<4PK8YA#K)?NfT>&YGnW4 zZ_9BiB))@nP|yzRvI1(slJ>A{4DS?>dm=T5&!Wag-G*3xNAgTuz>0_Av+|MNfhp=7 zS;PisBr{DT(WMkSB831AmZBLt-FKRyH2Qie&tX|vs#y(g27elLoJjhhG9nSQot{W= zs5&9iE^cJPA+b;a)=r-O36gqmQkf5GwbWDlv!H-FNLs3q8Mg{br)As1dY*+`%4=ocy8K>3#g1kK6$=j+=Muk0GoNc$ddGQR>BinWJ)Oa!-W*q%@} h%3i^C2dw=h&S>Xy8eLo6^aA-|&nvR{yN{N(%yqagqQ delta 364 zcmV-y0h9jA1Ly;gg?}7(8v-E?lO~YhSfz>AMoN<^ae>`<4PK8YA!*hvlP1>mP&Kms z{dR0CwZIQB77E&9Q&vC?7}D*Qt>(Q1a!Z8b@KrR}%IjduZ%CfiXRzXa_^q79D=oXvMT1Z-|kr}rNN~=WI!Q??l0$9>c zlyMcQJa+}m0_P^3zGX4uH@ajkpNRG-q~k264CVmE_bZj2-k_s``|h}4I1BXt|G}5X z)x-LcSmaBt8D+^ABv^(B@+9!h%VuuF25<}o!!C(u_Yw&Mq K4cQ;cdr;0^?5>*t diff --git a/docs/py-modindex.html b/docs/py-modindex.html index f254ecd..cc3730e 100644 --- a/docs/py-modindex.html +++ b/docs/py-modindex.html @@ -77,11 +77,6 @@

    Python Module Index

    - - -
    +     gitverse.releases
        - gitverse.utils.rst -
    diff --git a/docs/searchindex.js b/docs/searchindex.js index 2b6d2ea..7953bda 100644 --- a/docs/searchindex.js +++ b/docs/searchindex.js @@ -1 +1 @@ -Search.setIndex({"docnames": ["README", "index"], "filenames": ["README.md", "index.rst"], "titles": ["GitVerse", "Welcome to GitVerse\u2019s documentation!"], "terms": {"get": [0, 1], "from": [0, 1], "github": [0, 1], "format": 0, "restructuredtext": 0, "markdown": [0, 1], "file": [0, 1], "pip": 0, "gener": [0, 1], "bulb": 0, "tri": 0, "via": [0, 1], "api": [0, 1], "call": 0, "If": 0, "fail": 0, "us": 0, "messag": [0, 1], "associ": 0, "thi": [0, 1], "featur": 0, "take": [0, 1], "git_token": 0, "an": [0, 1], "environ": 0, "variabl": 0, "i": 0, "person": 0, "repo": [0, 1], "git": [0, 1], "log": [0, 1], "debug": [0, 1], "enabl": 0, "mode": 0, "revers": [0, 1], "order": [0, 1], "b": 0, "gather": [0, 1], "specif": 0, "branch": [0, 1], "default": [0, 1], "pass": [0, 1], "onli": 0, "f": 0, "write": [0, 1], "custom": 0, "filenam": [0, 1], "t": 0, "titl": [0, 1], "index": [0, 1], "line": [0, 1], "_": 0, "rst": 0, "changelog": 0, "precommit": 0, "ensur": 0, "doc": 0, "creation": 0, "ar": 0, "run": [0, 1], "everi": 0, "requir": 0, "sphinx": 0, "5": 0, "1": 0, "pre": 0, "2": 0, "20": 0, "0": 0, "recommonmark": 0, "7": 0, "all": [0, 1], "http": 0, "org": 0, "project": 0, "thevickypedia": 0, "io": 0, "vignesh": 0, "sivanandha": 0, "rao": 0, "under": [0, 1], "mit": 0, "instal": 1, "usag": 1, "lint": 1, "pypi": 1, "packag": 1, "licens": 1, "copyright": 1, "releas": 1, "generate_snippet": 1, "list": 1, "str": 1, "snippet": 1, "base": 1, "inform": 1, "return": 1, "readi": 1, "load": 1, "type": 1, "get_api_releas": 1, "dict": 1, "note": 1, "form": 1, "version": 1, "descript": 1, "kei": 1, "valu": 1, "pair": 1, "get_dat": 1, "int": 1, "timestamp": 1, "each": 1, "get_releas": 1, "option": 1, "union": 1, "map": 1, "dictionari": 1, "none": 1, "noreturn": 1, "handler": 1, "function": 1, "paramet": 1, "name": 1, "where": 1, "ha": 1, "store": 1, "which": 1, "run_git_cmd": 1, "cmd": 1, "raw": 1, "bool": 1, "fals": 1, "command": 1, "argument": 1, "output": 1, "split": 1, "commit": 1, "gitlog": 1, "trigger": 1, "convers": 1, "process": 1, "written": 1, "get_branch": 1, "avail": 1, "get_commit": 1, "trunk": 1, "scan": 1, "number": 1, "get_gitlog": 1, "exclud": 1, "merg": 1, "histori": 1, "modul": 1, "set": 1, "up": 1, "bearer": 1, "authent": 1, "class": 1, "auth_bear": 1, "bearerauth": 1, "token": 1, "instanti": 1, "object": 1, "refer": 1, "new": 1, "initi": 1, "assign": 1, "member": 1, "auth": 1, "msg": 1, "print": 1, "incom": 1, "light": 1, "green": 1, "error": 1, "bright": 1, "red": 1, "info": 1, "warn": 1, "yellow": 1, "util": 1, "get_release_not": 1, "pathlik": 1, "iter": 1, "test": 1, "sourc": 1, "particular": 1, "string": 1, "rst2dict": 1, "regular_dict": 1, "ordereddict": 1, "convert": 1, "python": 1, "filepath": 1, "boolean": 1, "flag": 1, "regular": 1, "arg": 1, "rst2html": 1, "src": 1, "dst": 1, "html": 1, "destin": 1, "A": 1, "wa": 1, "success": 1, "search": 1, "page": 1}, "objects": {"gitverse": [[1, 0, 0, "-", "auth_bearer"], [1, 0, 0, "-", "commits"], [1, 0, 0, "-", "debugger"], [1, 0, 0, "-", "releases"]], "gitverse.auth_bearer": [[1, 1, 1, "", "BearerAuth"]], "gitverse.commits": [[1, 2, 1, "", "generator"], [1, 2, 1, "", "get_branches"], [1, 2, 1, "", "get_commits"], [1, 2, 1, "", "get_gitlog"], [1, 2, 1, "", "run"]], "gitverse.debugger": [[1, 2, 1, "", "debug"], [1, 2, 1, "", "error"], [1, 2, 1, "", "info"], [1, 2, 1, "", "warning"]], "gitverse.releases": [[1, 2, 1, "", "generate_snippets"], [1, 2, 1, "", "get_api_releases"], [1, 2, 1, "", "get_dates"], [1, 2, 1, "", "get_releases"], [1, 2, 1, "", "run"], [1, 2, 1, "", "run_git_cmd"]], "gitverse.utils": [[1, 0, 0, "-", "rst"]], "gitverse.utils.rst": [[1, 2, 1, "", "get_release_notes"], [1, 2, 1, "", "rst2dict"], [1, 2, 1, "", "rst2html"]]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:function"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "function", "Python function"]}, "titleterms": {"gitvers": [0, 1], "instal": 0, "usag": 0, "releas": 0, "note": 0, "tag": 0, "commit": 0, "histori": 0, "option": 0, "flag": 0, "sampl": 0, "lint": 0, "pypi": 0, "packag": 0, "runbook": 0, "licens": 0, "copyright": 0, "welcom": 1, "": 1, "document": 1, "read": 1, "me": 1, "releasenot": 1, "commithistori": 1, "authbear": 1, "debugg": 1, "rst": 1, "parser": 1, "indic": 1, "tabl": 1}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 6, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 56}}) \ No newline at end of file +Search.setIndex({"docnames": ["README", "index"], "filenames": ["README.md", "index.rst"], "titles": ["GitVerse", "Welcome to GitVerse\u2019s documentation!"], "terms": {"get": [0, 1], "from": 0, "github": [0, 1], "format": 0, "restructuredtext": 0, "markdown": [0, 1], "file": [0, 1], "pip": 0, "gener": [0, 1], "bulb": 0, "tri": 0, "via": [0, 1], "api": [0, 1], "call": 0, "If": 0, "fail": 0, "us": 0, "messag": [0, 1], "associ": 0, "thi": 0, "featur": 0, "take": [0, 1], "git_token": 0, "an": [0, 1], "environ": 0, "variabl": 0, "i": 0, "person": 0, "repo": [0, 1], "git": [0, 1], "log": [0, 1], "debug": [0, 1], "enabl": 0, "mode": 0, "revers": [0, 1], "order": [0, 1], "b": 0, "gather": [0, 1], "specif": 0, "branch": [0, 1], "default": 0, "pass": 0, "onli": 0, "f": 0, "write": [0, 1], "custom": 0, "filenam": [0, 1], "t": 0, "titl": [0, 1], "index": [0, 1], "line": [0, 1], "_": 0, "rst": 0, "changelog": 0, "precommit": 0, "ensur": 0, "doc": 0, "creation": 0, "ar": 0, "run": [0, 1], "everi": 0, "requir": 0, "sphinx": 0, "5": 0, "1": 0, "pre": 0, "2": 0, "20": 0, "0": 0, "recommonmark": 0, "7": 0, "all": [0, 1], "http": 0, "org": 0, "project": 0, "thevickypedia": 0, "io": 0, "vignesh": 0, "sivanandha": 0, "rao": 0, "under": [0, 1], "mit": 0, "instal": 1, "usag": 1, "lint": 1, "pypi": 1, "packag": 1, "licens": 1, "copyright": 1, "releas": 1, "generate_snippet": 1, "list": 1, "str": 1, "snippet": 1, "base": 1, "inform": 1, "return": 1, "readi": 1, "load": 1, "type": 1, "get_api_releas": 1, "dict": 1, "note": 1, "form": 1, "version": 1, "descript": 1, "kei": 1, "valu": 1, "pair": 1, "get_dat": 1, "int": 1, "timestamp": 1, "each": 1, "get_releas": 1, "option": 1, "union": 1, "map": 1, "dictionari": 1, "none": 1, "handler": 1, "function": 1, "paramet": 1, "name": 1, "where": 1, "ha": 1, "store": 1, "which": 1, "run_git_cmd": 1, "cmd": 1, "raw": 1, "bool": 1, "fals": 1, "command": 1, "argument": 1, "output": 1, "split": 1, "commit": 1, "gitlog": 1, "trigger": 1, "convers": 1, "process": 1, "written": 1, "get_branch": 1, "avail": 1, "get_commit": 1, "trunk": 1, "scan": 1, "number": 1, "get_gitlog": 1, "exclud": 1, "merg": 1, "histori": 1, "modul": 1, "set": 1, "up": 1, "bearer": 1, "authent": 1, "class": 1, "auth_bear": 1, "bearerauth": 1, "token": 1, "instanti": 1, "object": 1, "refer": 1, "new": 1, "initi": 1, "assign": 1, "member": 1, "auth": 1, "msg": 1, "print": 1, "incom": 1, "light": 1, "green": 1, "error": 1, "bright": 1, "red": 1, "info": 1, "warn": 1, "yellow": 1, "search": 1, "page": 1}, "objects": {"gitverse": [[1, 0, 0, "-", "auth_bearer"], [1, 0, 0, "-", "commits"], [1, 0, 0, "-", "debugger"], [1, 0, 0, "-", "releases"]], "gitverse.auth_bearer": [[1, 1, 1, "", "BearerAuth"]], "gitverse.commits": [[1, 2, 1, "", "generator"], [1, 2, 1, "", "get_branches"], [1, 2, 1, "", "get_commits"], [1, 2, 1, "", "get_gitlog"], [1, 2, 1, "", "run"]], "gitverse.debugger": [[1, 2, 1, "", "debug"], [1, 2, 1, "", "error"], [1, 2, 1, "", "info"], [1, 2, 1, "", "warning"]], "gitverse.releases": [[1, 2, 1, "", "generate_snippets"], [1, 2, 1, "", "get_api_releases"], [1, 2, 1, "", "get_dates"], [1, 2, 1, "", "get_releases"], [1, 2, 1, "", "run"], [1, 2, 1, "", "run_git_cmd"]]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:function"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "function", "Python function"]}, "titleterms": {"gitvers": [0, 1], "instal": 0, "usag": 0, "releas": 0, "note": 0, "tag": 0, "commit": 0, "histori": 0, "option": 0, "flag": 0, "sampl": 0, "lint": 0, "pypi": 0, "packag": 0, "runbook": 0, "licens": 0, "copyright": 0, "welcom": 1, "": 1, "document": 1, "read": 1, "me": 1, "releasenot": 1, "commithistori": 1, "authbear": 1, "debugg": 1, "rst": 1, "parser": 1, "indic": 1, "tabl": 1}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 6, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 56}}) \ No newline at end of file diff --git a/gitverse/__init__.py b/gitverse/__init__.py index ea07e8d..72ede43 100644 --- a/gitverse/__init__.py +++ b/gitverse/__init__.py @@ -1 +1 @@ -version = "2.4" +version = "2.5" diff --git a/gitverse/commits.py b/gitverse/commits.py index 05055d1..6b49ba4 100644 --- a/gitverse/commits.py +++ b/gitverse/commits.py @@ -2,7 +2,7 @@ import subprocess import time from datetime import datetime -from typing import List, NoReturn +from typing import List import click @@ -103,7 +103,7 @@ def generator(versions: List[str], gitlog: List[str]) -> List[str]: return [snippet for snippet in ''.join(output).split('^^')] -def run(branch: str, filename: str, title: str) -> NoReturn: +def run(branch: str, filename: str, title: str) -> None: """Handler for generator functions that writes the commit history into a file. Args: diff --git a/gitverse/releases.py b/gitverse/releases.py index a1702d2..609f699 100644 --- a/gitverse/releases.py +++ b/gitverse/releases.py @@ -2,7 +2,7 @@ import subprocess import time from datetime import datetime -from typing import Dict, List, NoReturn, Union +from typing import Dict, List, Union import click import dotenv @@ -135,8 +135,6 @@ def generate_snippets() -> List[str]: if loaded := get_releases(): snippets = [] for each_tag in loaded: - # remove all character elements from the version - each_tag['version'] = ''.join([v for v in each_tag['version'] if v.isdigit() or v == '.']) line1 = f"{each_tag['version']} ({each_tag['date']})" line2 = "-" * len(line1) description = [] @@ -151,7 +149,7 @@ def generate_snippets() -> List[str]: return snippets -def run(filename: str, title: str) -> NoReturn: +def run(filename: str, title: str) -> None: """Handler for generator functions that writes the release notes into a file. Args: diff --git a/release_notes.rst b/release_notes.rst index f3cc25d..e201aba 100644 --- a/release_notes.rst +++ b/release_notes.rst @@ -1,45 +1,50 @@ Release Notes ============= -2.4 (08/19/2023) ----------------- +v2.5 (08/30/2023) +----------------- +- Restructure version naming in output files +- Includes some minor modifications in type hinting + +v2.4 (08/19/2023) +----------------- - Improved security for API authentication - Includes minor simplifications -2.3 (08/18/2023) ----------------- +v2.3 (08/18/2023) +----------------- - Improved accuracy on release notes mapping from git -2.2 (08/15/2023) ----------------- +v2.2 (08/15/2023) +----------------- - Add a new command for generic help -2.1 (08/10/2023) ----------------- +v2.1 (08/10/2023) +----------------- - Performance improvements and more clear logging -2.0 (08/10/2023) ----------------- +v2.0 (08/10/2023) +----------------- - Release v2.0 -2.0b (08/10/2023) ------------------ +v2.0b (08/10/2023) +------------------ - Use ``python-dotenv`` to load env vars for ``git_token`` - Add CLI option to pass filename/filepath for dot env -2.0a (08/10/2023) ------------------ +v2.0a (08/10/2023) +------------------ - Use ``git pull`` before any operation - Make an API call to github to get accurate release information (if available) - Improve accuracy -0.7 (07/30/2023) ----------------- +v0.7 (07/30/2023) +----------------- - Add ``version`` argument - Set module to stable -0.7b (07/30/2023) ------------------ +v0.7b (07/30/2023) +------------------ - Convert to ``pyproject.toml`` - Update type hint, logging, and runtime