8000 avoid duplicate imports in generated versioneer.py · drinkingjava/python-versioneer@fa98fa6 · GitHub
[go: up one dir, main page]

Skip to content

Commit fa98fa6

Browse files
committed
avoid duplicate imports in generated versioneer.py
This moves all the imports from the individual sources files (src/*.py and src/git/*.py) into one place: src/header.py . We can't usefully run pyflakes against the individual source files, but we *can* run it against the concatenated output versioneer.py after building it with "setup.py make_versioneer". Thanks to @ceball for the catch. closes python-versioneer#37
1 parent a22ea16 commit fa98fa6

File tree

7 files changed

+1
-15
lines changed

7 files changed

+1
-15
lines changed

src/get_versions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import sys
21

32
def get_root():
43
try:

src/git/from_keywords.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11

2-
import re
3-
42
def git_get_keywords(versionfile_abs):
53
# the code embedded in _version.py can just fetch the value of these
64
# keywords. When used from setup.py, we don't want to import _version.py,

src/git/from_vcs.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11

2-
import sys
3-
import os.path
4-
52
def git_versions_from_vcs(tag_prefix, root, verbose=False):
63
# this runs 'git' from the root of the source tree. This only gets called
74
# if the git-archive 'subst' keywords were *not* expanded, and

src/git/install.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import os.path
2-
import sys
31

42
def do_vcs_install(manifest_in, versionfile_source, ipy):
53
GITS = ["git"]

src/git/long_get_versions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import os
21

32
def get_versions(default={"version": "unknown", "full": ""}, verbose=False):
43
# I am in _version.py, which lives at ROOT/VERSIONFILE_SOURCE. If we have

src/header.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
@README@
66
"""
77

8-
import os, sys, re
8+
import os, sys, re, subprocess, errno
99
from distutils.core import Command
1010
from distutils.command.sdist import sdist as _sdist
1111
from distutils.command.build import build as _build

src/subprocess_helper.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11

2-
import subprocess
3-
import sys
4-
import errno
5-
6-
72
def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False):
83
assert isinstance(commands, list)
94
p = None

0 commit comments

Comments
 (0)
0