From 568e96123d623440959d56ca6673cb72f8a771b9 Mon Sep 17 00:00:00 2001 From: Daniel Mach Date: Thu, 13 Oct 2022 09:50:46 +0200 Subject: [PATCH 1/4] Configure Read the Docs --- .gitattributes | 1 + .readthedocs.yaml | 17 +++++++++++++++++ doc/requirements.txt | 2 ++ 3 files changed, 20 insertions(+) create mode 100644 .readthedocs.yaml create mode 100644 doc/requirements.txt diff --git a/.gitattributes b/.gitattributes index b657a8d6..10780d2b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,6 @@ .gitattributes export-ignore .github export-ignore +.readthedocs.yaml export-ignore behave export-ignore contrib/build_rpm.py export-ignore contrib/osc.spec export-ignore diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 00000000..9b20fc6a --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,17 @@ +# .readthedocs.yaml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +version: 2 + +build: + os: ubuntu-20.04 + tools: + python: "3.9" + +sphinx: + configuration: doc/conf.py + +python: + install: + - requirements: doc/requirements.txt diff --git a/doc/requirements.txt b/doc/requirements.txt new file mode 100644 index 00000000..9e737b6a --- /dev/null +++ b/doc/requirements.txt @@ -0,0 +1,2 @@ +cryptography +urllib3 From ef6e3996031b69314110f4678ea6b04b522e079a Mon Sep 17 00:00:00 2001 From: Daniel Mach Date: Thu, 13 Oct 2022 09:54:54 +0200 Subject: [PATCH 2/4] Import rpm locally because it's not available to Read the Docs --- osc/checker.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/osc/checker.py b/osc/checker.py index 4acbe9eb..d539ff0d 100644 --- a/osc/checker.py +++ b/osc/checker.py @@ -3,8 +3,6 @@ import os from tempfile import mkdtemp from shutil import rmtree -import rpm - class KeyError(Exception): def __init__(self, key, *args): @@ -18,6 +16,7 @@ class KeyError(Exception): class Checker: def __init__(self): + import rpm self.dbdir = mkdtemp(prefix='oscrpmdb') self.imported = {} rpm.addMacro('_dbpath', self.dbdir) @@ -28,6 +27,7 @@ class Checker: # self.ts.Debug(1) def readkeys(self, keys=None): + import rpm keys = keys or [] rpm.addMacro('_dbpath', self.dbdir) for key in keys: @@ -39,6 +39,7 @@ class Checker: if not self.imported: raise KeyError('', "no key imported") + import rpm rpm.delMacro("_dbpath") # python is an idiot From 7b7bbd157f90229333c8b814c3ce1a19ca936775 Mon Sep 17 00:00:00 2001 From: Daniel Mach Date: Thu, 13 Oct 2022 09:58:18 +0200 Subject: [PATCH 3/4] Rename doc/index.rst to contents.rst --- doc/{index.rst => contents.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename doc/{index.rst => contents.rst} (100%) diff --git a/doc/index.rst b/doc/contents.rst similarity index 100% rename from doc/index.rst rename to doc/contents.rst From 468a4984383a7708be1d8eed40d940dca09aa21d Mon Sep 17 00:00:00 2001 From: Daniel Mach Date: Thu, 13 Oct 2022 10:23:38 +0200 Subject: [PATCH 4/4] Add docs badge to README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index acb5ef06..65bdde91 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ [![unit tests](https://github.com/openSUSE/osc/actions/workflows/unittests.yaml/badge.svg)](https://github.com/openSUSE/osc/actions/workflows/unittests.yaml) +[![docs](https://readthedocs.org/projects/opensuse-commander/badge/?version=latest)](https://opensuse-commander.readthedocs.io/en/latest/?badge=latest) [![codecov](https://codecov.io/gh/openSUSE/osc/branch/master/graph/badge.svg)](https://codecov.io/gh/openSUSE/osc) [![code climate](https://codeclimate.com/github/openSUSE/osc.png)](https://codeclimate.com/github/openSUSE/osc) [![contributors](https://img.shields.io/github/contributors/openSUSE/osc.svg)](https://github.com/openSUSE/osc/graphs/contributors)