Skip to content

Commit

Permalink
adding better string resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
toumorokoshi committed Feb 22, 2015
1 parent 703c492 commit 0c7355f
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 9 deletions.
6 changes: 3 additions & 3 deletions scripts/uranium
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# * run uranium

VENV_URL = "https://pypi.python.org/packages/source/v/virtualenv/virtualenv-{major}.{minor}.{rev}.tar.gz"
VENV_MAJOR = 1
VENV_MINOR = 11
VENV_REV = 6
VENV_MAJOR = 12
VENV_MINOR = 0
VENV_REV = 5

import io
import logging
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
from setuptools import setup, find_packages

install_requires = [
'setuptools==12.0.3',
'setuptools==12.0.5',
'docopt==0.6.2',
'jinja2==2.7.3',
'pip==6.0.6',
'pyyaml==3.11',
'requests==2.5.1',
'six==1.9.0',
'virtualenv==12.0.5',
'virtualenv==12.0.6',
'zc.buildout'
]

Expand All @@ -19,7 +19,7 @@
]

setup(name='uranium',
version='0.0.57',
version='0.0.60',
description='a build system for python',
long_description='a build system for python',
author='Yusuke Tsutsumi',
Expand Down
2 changes: 1 addition & 1 deletion uranium/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
install_virtualenv, inject_into_activate_this
)
from .config import Config
from uranium.activate import generate_activate_this
from .activate import generate_activate_this
import os
import sys

Expand Down
5 changes: 3 additions & 2 deletions uranium/config/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import copy
import requests
import yaml
from ..part import Part
Expand Down Expand Up @@ -88,14 +87,16 @@ def _set_values(to_dict, raw_options):
* download all values from the inheritance list
* fold those values into the raw_options dictionary
"""
_recursive_merge(to_dict, raw_options)

inheritance_list = raw_options.get(INHERITANCE_KEY)

if inheritance_list:

for inherited_path in inheritance_list:
inherited_values = _load_values_from_path(inherited_path)
_set_values(to_dict, inherited_values)

_recursive_merge(to_dict, raw_options)


def _recursive_merge(to_dict, from_dict):
Expand Down
2 changes: 2 additions & 0 deletions uranium/tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ def test_inheritance(self):
eq_(self.config.get("index"), "http://my-index.local",
"value should have been inherited from base.yaml!")

eq_(self.config.get("config"), "uranium")

parts = self.config["parts"]
ok_('zeromq' in parts,
"value should have been inherited indirectly through zeromq.yaml")
Expand Down
1 change: 1 addition & 0 deletions uranium/tests/test_files/uranium.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
inherits:
- "./base.yaml"
config: "uranium"
parts:
uranium:
another: key
1 change: 1 addition & 0 deletions uranium/tests/test_files/zeromq.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
config: "zeromq"
parts:
zeromq:
some: dict

0 comments on commit 0c7355f

Please sign in to comment.