Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify package dependencies #18

Merged
merged 3 commits into from Nov 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 20 additions & 3 deletions RELEASES.md
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
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
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
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
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
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
@@ -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