Skip to content

Commit

Permalink
handle internal pip API change, revert moving of 'version'
Browse files Browse the repository at this point in the history
  • Loading branch information
dansan committed Nov 23, 2019
1 parent 0615125 commit 03bb80f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 17 deletions.
22 changes: 11 additions & 11 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,27 @@
# relative to the documentation root, use os.path.abspath to make it
# absolute, like shown here.
#
import inspect
import os
import sys
from pathlib import Path

try:
from pip import main as pip_main
except ImportError:
from pip._internal import main as pip_main
if not inspect.isfunction(pip_main):
pip_main = pip_main.main

sys.path.insert(0, os.path.abspath(".."))

# get version information without importing project
proj_path = Path(__file__).parent.parent
sys.path.append(str(proj_path / "udm_rest_client"))
from version import __version__

# install 'openapi_client_udm' package from test-pypi to be able to build
# Python module doc
try:
import openapi_client_udm
import openapi_client_udm # isort:skip
except ImportError:
print("Installing 'openapi_client_udm' package from test-pypi...")
try:
from pip import main as pip_main
except ImportError:
from pip._internal import main as pip_main
pip_main.main(
pip_main(
[
"install",
"--compile",
Expand All @@ -51,6 +49,8 @@
]
)

from udm_rest_client import __version__ # isort:skip

# -- General configuration ---------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tag = True
search = version="{current_version}"
replace = version="{new_version}"

[bumpversion:file:udm_rest_client/version.py]
[bumpversion:file:udm_rest_client/__init__.py]
search = __version__ = "{current_version}"
replace = __version__ = "{new_version}"

Expand Down
4 changes: 3 additions & 1 deletion udm_rest_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
UnknownModuleType,
)
from .udm import UDM
from .version import __author__, __email__, __version__

__all__ = [
"UDM",
Expand All @@ -35,3 +34,6 @@
"UnknownModuleType",
"APICommunicationError",
]
__author__ = """Daniel Troeder"""
__email__ = "troeder@univention.de"
__version__ = "0.1.0"
2 changes: 1 addition & 1 deletion udm_rest_client/udm.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
# that code doesn't work when something goes wrong:
try:
del openapi_client_udm.rest.RESTClientObject.__del__
except AttributeError:
except AttributeError: # pragma: no cover
pass


Expand Down
3 changes: 0 additions & 3 deletions udm_rest_client/version.py

This file was deleted.

0 comments on commit 03bb80f

Please sign in to comment.