Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions cli/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,10 @@
pass

try:
import sphinx
from pkg_resources import parse_version

cmd_line_template = "sphinx-apidoc -f -o {outputdir} {moduledir}"
cmd_line = cmd_line_template.format(outputdir=output_dir, moduledir=module_dir)

args = cmd_line.split(" ")
if parse_version(sphinx.__version__) >= parse_version("1.7"):
args = args[1:]
args = cmd_line.split(" ")[1:] # Remove first argument (sphinx-apidoc)

apidoc.main(args)
except Exception as e:
Expand Down
9 changes: 4 additions & 5 deletions cli/src/etos_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""ETOS client module."""
from pkg_resources import get_distribution, DistributionNotFound
from importlib.metadata import version, PackageNotFoundError
from .command import TestRun

# pylint:disable=invalid-name
try:
# Change here if project is renamed and does not equal the package name
dist_name = "etos_client"
__version__ = get_distribution(dist_name).version
except DistributionNotFound:
__version__ = version(dist_name)
except PackageNotFoundError:
__version__ = "unknown"
finally:
del get_distribution, DistributionNotFound
del version, PackageNotFoundError
Loading