Skip to content

Commit

Permalink
flake8, fix urllib library name on py3
Browse files Browse the repository at this point in the history
  • Loading branch information
msarahan committed Jul 7, 2016
1 parent e3bacbe commit 4b57738
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
3 changes: 2 additions & 1 deletion conda_build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,8 @@ def build(m, post=None, include_recipe=True, keep_old_work=False,
vcs_source = m.uses_vcs_in_build()
if vcs_source and vcs_source not in specs:
vcs_executable = "hg" if vcs_source == "mercurial" else vcs_source
has_vcs_available = os.path.isfile(external.find_executable(vcs_executable) or "")
has_vcs_available = os.path.isfile(external.find_executable(vcs_executable) or
"")
if not has_vcs_available:
if (vcs_source != "mercurial" or
not any(spec.startswith('python') and "3." in spec
Expand Down
1 change: 0 additions & 1 deletion conda_build/main_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ def execute(args, parser):
index = build.get_build_index(clear_cache=True,
arg_channels=arg_channels)


already_built = set()
to_build_recursive = []
recipes = deque(args.recipe)
Expand Down
15 changes: 6 additions & 9 deletions tests/test_build_recipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
import conda_build.config as config

if PY3:
import urlib.parse as urlparse
import urlib.request as urllib
import urllib.parse as urlparse
import urllib.request as urllib
else:
import urlparse, urllib
import urlparse
import urllib

thisdir = os.path.dirname(os.path.realpath(__file__))
metadata_dir = os.path.join(thisdir, 'test-recipes', 'metadata')
Expand All @@ -28,8 +29,7 @@
# Used for translating local paths into url (file://) paths
# http://stackoverflow.com/a/14298190/1170370
def path2url(path):
return urlparse.urljoin(
'file:', urllib.pathname2url(path))
return urlparse.urljoin('file:', urllib.pathname2url(path))


def is_valid_dir(parent_dir, dirname):
Expand Down Expand Up @@ -325,12 +325,10 @@ def test_skip_existing_anaconda_org():
cmd = 'conda build --token {} {}'.format(token, os.path.join(metadata_dir, "empty_sections"))
subprocess.check_call(cmd.split())

output_file = os.path.join(config.croot, subdir, "empty_sections-0.0-0.tar.bz2")

try:
# ensure that we skip with the package in the anaconda.org channel
cmd = ('conda build --no-anaconda-upload --override-channels '
'-c conda_test_account --skip-existing {}'\
'-c conda_test_account --skip-existing {}'
.format(os.path.join(metadata_dir, "empty_sections")))
process = subprocess.Popen(cmd.split(),
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
Expand Down Expand Up @@ -406,7 +404,6 @@ def test_token_upload():
subprocess.check_call(show_package.split())



@pytest.mark.parametrize("service_name", ["binstar", "anaconda"])
def test_no_anaconda_upload_condarc(service_name):
with TemporaryDirectory() as tmp:
Expand Down

0 comments on commit 4b57738

Please sign in to comment.