Skip to content

Commit

Permalink
more pkg fixes such as MANIFEST.in RE data files
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Steinberg committed Apr 6, 2017
1 parent 76d62e0 commit 68f8543
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 32 deletions.
4 changes: 0 additions & 4 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
include btax/data/depreciation_rates/*.xlsx
include btax/data/depreciation_rates/*.csv
include btax/data/reference_data/*.xls
include btax/data/reference_data/*.csv
include btax/data/notes/*.xlsx
include btax/data/pickles/*.pkl
include btax/data/raw_data/BEA/*.csv
include btax/data/raw_data/BEA/*.xlsx
include btax/data/raw_data/Inventories/*.xls
Expand Down
24 changes: 2 additions & 22 deletions btax/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,28 +38,8 @@ def read_from_egg(tfile):

def get_paths():
paths = {}
_CUR_DIR = os.environ.get('BTAX_CUR_DIR', 'not-exist')
if _CUR_DIR:
_CUR_DIR = os.path.expanduser(_CUR_DIR)
if not _CUR_DIR or not os.path.exists(_CUR_DIR):
paths['_CUR_DIR'] = _CUR_DIR = os.path.dirname(os.path.abspath(__file__))
else:
paths['_CUR_DIR'] = _CUR_DIR
data_dir_guesses = (os.path.join(_CUR_DIR),
os.path.join(_CUR_DIR, 'btax'),
os.path.join(os.path.abspath(os.curdir), 'btax'),
os.path.abspath(os.curdir))
_MAIN_DIR = None
for d in data_dir_guesses:
if os.path.exists(d):
_MAIN_DIR = os.path.dirname(d)
_DATA_DIR = os.path.join(_MAIN_DIR, 'btax', 'data')
break

if _MAIN_DIR is None:
raise IOError('Expected one of {} to exist. Change '
'working directory or define '
'BTAX_CUR_DIR env var'.format(data_dir_guesses))
_CUR_DIR = _MAIN_DIR = os.path.dirname(os.path.abspath(__file__))
_DATA_DIR = os.path.join(_MAIN_DIR, 'data')
paths['_MAIN_DIR'] = paths['_DATA_DIR'] = _MAIN_DIR
paths['_RATE_DIR'] = _RATE_DIR = os.path.join(_DATA_DIR, 'depreciation_rates')
paths['_REF_DIR'] = os.path.join(_DATA_DIR, 'reference_data')
Expand Down
6 changes: 0 additions & 6 deletions conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,11 @@ package:
source:
path: ..

build:
script_env:
- BTAX_CUR_DIR={{ environ["RECIPE_DIR"] }}/../

requirements:
build:
- setuptools
- scipy
- taxcalc
- matplotlib
- numpy
- pandas <=0.18.0
- python
Expand All @@ -26,7 +21,6 @@ requirements:
- setuptools
- scipy
- taxcalc
- matplotlib
- numpy
- pandas <=0.18.0
- python
Expand Down

0 comments on commit 68f8543

Please sign in to comment.