Skip to content

Commit

Permalink
Merge pull request #1641 from msarahan/chardet
Browse files Browse the repository at this point in the history
utilize chardet and bs4 to guess file encoding
  • Loading branch information
msarahan authored Jan 10, 2017
2 parents 11aa0b9 + 7a4e15e commit 1cc8627
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ install:
hash -r;
conda info;
fi
- conda install -q anaconda-client requests=2.11.1 filelock contextlib2 jinja2 patchelf python=$TRAVIS_PYTHON_VERSION pyflakes=1.1 conda-verify
- conda install -q anaconda-client requests filelock contextlib2 jinja2 patchelf python=$TRAVIS_PYTHON_VERSION
- conda install -q pyflakes conda-verify beautifulsoup4 chardet
- pip install pkginfo
- if [[ "$FLAKE8" == "true" ]]; then
conda install -q flake8;
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ install:
- python -c "import sys; print(sys.executable)"
- python -c "import sys; print(sys.prefix)"
- conda update -q --all
- conda install -q pip pytest pytest-cov jinja2 patch flake8 mock requests contextlib2
- conda install -q pyflakes=1.1 pycrypto posix m2-git anaconda-client numpy conda-verify
- conda install -q pip pytest pytest-cov jinja2 patch flake8 mock requests contextlib2 chardet
- conda install -q pyflakes pycrypto posix m2-git anaconda-client numpy conda-verify beautifulsoup4
- conda install -c conda-forge -q perl
# this is to ensure dependencies
- python --version
Expand Down
2 changes: 2 additions & 0 deletions conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ requirements:
build:
- python
run:
- beautifulsoup4
- chardet
- conda >=4.1
- contextlib2 [py<34]
- conda-verify
Expand Down
3 changes: 2 additions & 1 deletion conda_build/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import sys
from os.path import isdir, join, dirname, isfile

import bs4
# importing setuptools patches distutils so that it knows how to find VC for python 2.7
import setuptools # noqa
# Leverage the hard work done by setuptools/distutils to find vcvarsall using
Expand Down Expand Up @@ -43,7 +44,7 @@ def fix_staged_scripts(scripts_dir):
continue

with open(join(scripts_dir, fn)) as f:
line = f.readline().lower()
line = bs4.UnicodeDammit(f.readline()).unicode_markup.lower()
# If it's a #!python script
if not (line.startswith('#!') and 'python' in line.lower()):
continue
Expand Down

0 comments on commit 1cc8627

Please sign in to comment.