From 19af89cbeeb0c2a75c207e4c64719d7361348321 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Mon, 3 Aug 2020 23:01:51 -0500 Subject: .gitignore: only ignore autoapi generated .rst files in shared-bindings; ignore common python venv's --- .gitignore | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 475a1183f..03cd38f35 100644 --- a/.gitignore +++ b/.gitignore @@ -57,7 +57,7 @@ _build ###################### genrst/ /autoapi/ -/shared-bindings/**/*.rst +/shared-bindings/*/**/*.rst # ctags and similar ################### @@ -80,3 +80,8 @@ TAGS *.mo .vscode + +# Python Virtual Environments +#################### +.venv +.env -- cgit v1.2.3 From d8d36a4fb0814a90b3c14e1f5302205483ca9355 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Tue, 4 Aug 2020 20:55:20 -0500 Subject: conf.py: set the version for sphinx, based on the current git tag --- conf.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/conf.py b/conf.py index 37e611dbb..9b2efa8af 100644 --- a/conf.py +++ b/conf.py @@ -20,6 +20,7 @@ import json import logging import os +import re import subprocess import sys import urllib.parse @@ -106,7 +107,25 @@ copyright = '2014-2020, MicroPython & CircuitPython contributors (https://github # # We don't follow "The short X.Y version" vs "The full version, including alpha/beta/rc tags" # breakdown, so use the same version identifier for both to avoid confusion. -version = release = '0.0.0' + +final_version = "" +git_describe = subprocess.run( + ["git", "describe", "--dirty", "--tags"], + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + encoding="utf-8" +) +if git_describe.returncode == 0: + git_version = re.search( + r"^\d(?:\.\d){0,2}(?:\-(?:alpha|beta)\.\d+){0,1}", + str(git_describe.stdout) + ) + if git_version: + final_version = git_version[0] +else: + print("Failed to retrieve git version:", git_describe.stdout) + +version = release = final_version # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. -- cgit v1.2.3 From 3a954801788d052ed15bca2ec4d5e6aed7d09583 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Tue, 4 Aug 2020 21:05:03 -0500 Subject: conf.py: also include 'rc' versions for sphinx versioning --- conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf.py b/conf.py index 9b2efa8af..cbdc71524 100644 --- a/conf.py +++ b/conf.py @@ -117,7 +117,7 @@ git_describe = subprocess.run( ) if git_describe.returncode == 0: git_version = re.search( - r"^\d(?:\.\d){0,2}(?:\-(?:alpha|beta)\.\d+){0,1}", + r"^\d(?:\.\d){0,2}(?:\-(?:alpha|beta|rc)\.\d+){0,1}", str(git_describe.stdout) ) if git_version: -- cgit v1.2.3