Skip to content

Commit

Permalink
Merge pull request #18 from martinholmer/0-3-0
Browse files Browse the repository at this point in the history
Simplify package dependencies
  • Loading branch information
martinholmer authored Nov 6, 2018
2 parents acb22cb + 57086c2 commit 5e9cda9
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 35 deletions.
23 changes: 20 additions & 3 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,26 @@ Go [here](https://github.com/open-source-economics/Behavioral-Responses/pulls?q=
for a complete commit history.


2018-11-06 Release 0.3.0
------------------------
(last merged pull request is
[#18](https://github.com/open-source-economics/Behavioral-Responses/pull/18))

**API Changes**
- Simplify specification of package dependencies
[[#18](https://github.com/open-source-economics/Behavioral-Responses/pull/18)
by Martin Holmer]

**New Features**
- None

**Bug Fixes**
- None


_Earlier Releases:_


2018-11-03 Release 0.2.0
------------------------
(last merged pull request is
Expand All @@ -21,9 +41,6 @@ for a complete commit history.
- None


_Earlier Releases:_


2018-11-01 Release 0.1.0
------------------------
(last merged pull request is
Expand Down
14 changes: 2 additions & 12 deletions behresp/tests/test_4package.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,6 @@ def test_for_consistency(tests_path):
Ensure that there is consistency between environment.yml dependencies
and conda.recipe/meta.yaml requirements.
"""
dev_pkgs = set([
'pytest',
'pytest-pep8',
'pytest-xdist',
'pyyaml',
'pycodestyle',
'pylint',
'coverage'
])
# read conda.recipe/meta.yaml requirements
meta_file = os.path.join(tests_path, '..', '..',
'conda.recipe', 'meta.yaml')
Expand All @@ -54,6 +45,5 @@ def test_for_consistency(tests_path):
with open(envr_file, 'r') as stream:
envr = yaml.load(stream)
env = set(envr['dependencies'])
# confirm that extras in env (relative to run) equal the dev_pkgs set
extras = env - run
assert extras == dev_pkgs
# confirm that environment and run packages are the same
assert env == run
9 changes: 4 additions & 5 deletions conda.recipe/install_local_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,23 @@ echo "BUILD-PREP..."

# check version of conda package
conda list conda | awk '$1=="conda"{v=$2;gsub(/\./,"",v);nv=v+0;if(nv<444)rc=1}END{exit(rc)}'
if [ $? -eq 1 ]; then
if [[ $? -eq 1 ]]; then
echo "==> Installing conda 4.4.4+"
conda install conda>=4.4.4 --yes 2>&1 > /dev/null
echo "==> Continuing to build new behresp package"
fi

# install conda-build package if not present
conda list build | awk '$1~/conda-build/{rc=1}END{exit(rc)}'
if [ $? -eq 0 ]; then
if [[ $? -eq 0 ]]; then
echo "==> Installing conda-build package"
conda install conda-build --yes 2>&1 > /dev/null
echo "==> Continuing to build new behresp package"
fi

# build behresp conda package for this version of Python
NOHASH=--old-build-string
pversion=3.6
conda build $NOHASH --python $pversion . 2>&1 | awk '$1~/BUILD/||$1~/TEST/'
OPTIONS="--old-build-string --python 3.6"
conda build $OPTIONS . 2>&1 | awk '$1~/BUILD/||$1~/TEST/'

# install behresp conda package
echo "INSTALLATION..."
Expand Down
4 changes: 0 additions & 4 deletions conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@ package:
requirements:
build:
- python=3.6
- "numpy>=1.13"
- "pandas>=0.22"
- taxcalc

run:
- python=3.6
- "numpy>=1.13"
- "pandas>=0.22"
- taxcalc

test:
Expand Down
2 changes: 1 addition & 1 deletion conda.recipe/remove_local_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# uninstall any existing behresp conda package
conda list behresp | awk '$1~/behresp/{rc=1}END{exit(rc)}'
if [ $? -eq 1 ]; then
if [[ $? -eq 1 ]]; then
conda uninstall behresp --yes 2>&1 > /dev/null
fi

Expand Down
1 change: 1 addition & 0 deletions continuous_integration/setup_conda_environment.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ conda create -n %CONDA_ENV% -q -y python=%PYTHON%
call activate %CONDA_ENV%

%CONDA% env update -f environment.yml
%CONDA_INSTALL% pytest

@rem Display final environment (for reproducing)
%CONDA% list
Expand Down
11 changes: 1 addition & 10 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
name: behresp-dev
channels:
- ospc
- OSPC
dependencies:
- python=3.6
- "numpy>=1.13"
- "pandas>=0.22"
- taxcalc
- pytest
- pytest-pep8
- pytest-xdist
- pyyaml
- pycodestyle
- pylint
- coverage

0 comments on commit 5e9cda9

Please sign in to comment.