Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Commit

Permalink
Merge pull request #739 from vfreex/fix-version-detection
Browse files Browse the repository at this point in the history
Fix version detection error on pip installations
  • Loading branch information
vfreex authored Mar 14, 2023
2 parents 9f4cbed + abcb312 commit 98cdae4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ cover
# Ignore ocp-build-dat
ocp-build-data/
tests_functional.log

# Ignore _version.py created by setuptools_scm
_version.py
16 changes: 7 additions & 9 deletions doozerlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
if sys.version_info < (3, 8):
sys.exit('Sorry, Python < 3.8 is not supported.')

from setuptools_scm import get_version

from .runtime import Runtime
from .pushd import Dir
from doozerlib.runtime import Runtime


def version():
return get_version(
root=os.path.abspath(
os.path.join(os.path.dirname(__file__), '..')
)
)
try:
from ._version import version
except ImportError:
from setuptools_scm import get_version
version = get_version()
return version
4 changes: 2 additions & 2 deletions doozerlib/cli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import pathlib

from future import standard_library
from doozerlib import Runtime, Dir, cli as cli_package
from doozerlib import state
from doozerlib import Runtime, state, cli as cli_package
from doozerlib.pushd import Dir
from doozerlib.model import Missing
from doozerlib.brew import get_watch_task_info_copy
from doozerlib import metadata
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
name="rh-doozer",
author="AOS ART Team",
author_email="aos-team-art@redhat.com",
use_scm_version=True,
use_scm_version={
'write_to': 'doozerlib/_version.py',
},
setup_requires=['setuptools_scm'],
description="CLI tool for managing and automating Red Hat software releases",
long_description=open('README.md').read(),
Expand Down

0 comments on commit 98cdae4

Please sign in to comment.