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/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) diff --git a/doc/index.rst b/doc/contents.rst similarity index 100% rename from doc/index.rst rename to doc/contents.rst 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 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