Skip to content

Commit

Permalink
new uranium version - more robust virtualenv.
Browse files Browse the repository at this point in the history
  • Loading branch information
toumorokoshi committed Jun 6, 2016
1 parent 8ed6af8 commit c212c3f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
]

setup(name='uranium',
version='0.2.32b',
version='0.2.34b',
description='a build system for python',
long_description=open('README.rst').read(),
author='Yusuke Tsutsumi',
Expand Down
13 changes: 10 additions & 3 deletions uranium/lib/sandbox/venv/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import logging
import os
import subprocess
import sys
import virtualenv
from virtualenv import create_environment

LOGGER = logging.getLogger(__name__)
Expand All @@ -13,9 +15,14 @@ def install_virtualenv(install_dir):
if is_virtualenv(install_dir):
return

create_environment(install_dir, no_setuptools=False,
no_pip=True, site_packages=False,
symlink=False)
subprocess.call([
sys.executable,
virtualenv.__file__.rstrip("c"),
"--no-site-packages",
"--no-pip",
"--always-copy",
install_dir
])

VIRTUALENV_FILES = {
'activate file': os.path.join('bin', 'activate')
Expand Down
4 changes: 2 additions & 2 deletions uranium/scripts/uranium
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ def get_cached_standalone():
if not os.path.isfile(CACHED_URANIUM_STANDALONE):
return None
with open(CACHED_URANIUM_STANDALONE) as fh:
return fh.read().decode("UTF-8")
return fh.read()


def store_cached_standalone(body):
if not os.path.exists(CACHE_DIRECTORY):
os.makedirs(CACHE_DIRECTORY)
with open(CACHED_URANIUM_STANDALONE, "w+") as fh:
with open(CACHED_URANIUM_STANDALONE, "wb+") as fh:
fh.write(body)

cached_standalone = get_cached_standalone()
Expand Down

0 comments on commit c212c3f

Please sign in to comment.