Skip to content

Commit

Permalink
Merge pull request #47 from eendebakpt/lazy_import
Browse files Browse the repository at this point in the history
Use lazy imports for setuptools
  • Loading branch information
jbweston authored Sep 21, 2022
2 parents b83c328 + 04b3427 commit 9624074
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions miniver/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
#
from collections import namedtuple
import os
import subprocess

from setuptools.command.build_py import build_py as build_py_orig
from setuptools.command.sdist import sdist as sdist_orig

Version = namedtuple("Version", ("release", "dev", "labels"))

Expand Down Expand Up @@ -62,6 +58,8 @@ def pep440_format(version_info):


def get_version_from_git():
import subprocess

# git describe --first-parent does not take into account tags from branches
# that were merged-in. The '--long' flag gets us the 'dev' version and
# git hash, '--always' returns the git hash even if there are no tags.
Expand Down Expand Up @@ -164,6 +162,9 @@ def _write_version(fname):


def get_cmdclass(pkg_source_path):
from setuptools.command.build_py import build_py as build_py_orig
from setuptools.command.sdist import sdist as sdist_orig

class _build_py(build_py_orig):
def run(self):
super().run()
Expand Down

0 comments on commit 9624074

Please sign in to comment.