git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[StGit PATCH 1/2] Import version to a separate namespace

From
Karl Hasselström <kha@treskal.com>
Date
May 14, 2008, 01:44 UTC
Message-ID
<20080514014450.7043.20656.stgit@yoghurt>
In-Reply-To
<20080514014309.GA17955@diana.vm.bytemark.co.uk>

The set of names we need from the version module is about to get too large to list explicitly, but we don't want to pollute the local namespace with every name from version. So do a qualified import of the module.

Signed-off-by: Karl Hasselström <kha@treskal.com>
---
 setup.py |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/setup.py b/setup.py
index 3be087c..04ca821 100755
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@
 import sys, glob, os
 from distutils.core import setup
 
-from stgit.version import version, git_min_ver, python_min_ver
+from stgit import version
 from stgit.run import Run
 
 def __version_to_list(version):
@@ -29,18 +29,18 @@ def __check_python_version():
     """Check the minimum Python version
     """
     pyver = '.'.join(str(n) for n in sys.version_info)
-    if not __check_min_version(python_min_ver, pyver):
+    if not __check_min_version(version.python_min_ver, pyver):
         print >> sys.stderr, 'Python version %s or newer required. Found %s' \
-              % (python_min_ver, pyver)
+              % (version.python_min_ver, pyver)
         sys.exit(1)
 
 def __check_git_version():
     """Check the minimum GIT version
     """
     gitver = Run('git', '--version').output_one_line().split()[2]
-    if not __check_min_version(git_min_ver, gitver):
+    if not __check_min_version(version.git_min_ver, gitver):
         print >> sys.stderr, 'GIT version %s or newer required. Found %s' \
-              % (git_min_ver, gitver)
+              % (version.git_min_ver, gitver)
         sys.exit(1)
 
 # Check the minimum versions required
@@ -52,7 +52,7 @@ if sys.argv[1] in ['install', 'build']:
 old_mask = os.umask(0022)
 
 setup(name = 'stgit',
-      version = version,
+      version = version.version,
       license = 'GPLv2',
       author = 'Catalin Marinas',
       author_email = 'catalin.marinas@gmail.com',
Previous: Karl HasselströmNext: Karl Hasselström
Message 2 of 16 in “StGit: kha/{safe,experimental} updated”
  1. Karl HasselströmMay 14, 2008
  2. 1/2 Import version to a separate namespaceKarl Hasselström, May 14, 2008
  3. 2/2 Better StGit version trackingKarl Hasselström, May 14, 2008
  4. Emacs mode: automatically cd up to root of worktreeKarl Hasselström, May 14, 2008
  5. David KågedalMay 14, 2008
  6. Karl HasselströmMay 14, 2008
  7. New command: stg redoKarl Hasselström, May 14, 2008
  8. Catalin MarinasMay 19, 2008
  9. Karl HasselströmMay 20, 2008
  10. Catalin MarinasMay 20, 2008
  11. Karl HasselströmMay 20, 2008
  12. Try the built-in version string before git-describeKarl Hasselström, May 20, 2008
  13. Catalin MarinasMay 21, 2008
  14. Karl HasselströmMay 21, 2008
  15. Catalin MarinasMay 21, 2008
  16. Karl HasselströmMay 21, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.