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

CLN: [WIP] trial pull-request to make sure everything is in order before proceeding (GH14468) #15866

Closed
wants to merge 5 commits into from
Closed
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
3 changes: 2 additions & 1 deletion .travis.yml
Expand Up @@ -50,7 +50,7 @@ matrix:
- python-gtk2
- os: linux
env:
- JOB="3.5" TEST_ARGS="--skip-slow --skip-network" COVERAGE=true
- JOB="3.5" TEST_ARGS="--skip-slow --skip-network" COVERAGE=true TYPING=true
addons:
apt:
packages:
Expand Down Expand Up @@ -116,6 +116,7 @@ script:
- ci/script_single.sh
- ci/script_multi.sh
- ci/lint.sh
- ci/typing.sh
- echo "script done"

after_success:
Expand Down
4 changes: 4 additions & 0 deletions ci/install_travis.sh
Expand Up @@ -114,6 +114,10 @@ if [ "$LINT" ]; then
pip install cpplint
fi

if [ "$TYPING" ]; then
pip install mypy-lang
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mypy-lang is now called just mypy. I'll update in my branch.

fi

if [ "$COVERAGE" ]; then
pip install coverage pytest-cov
fi
Expand Down
1 change: 1 addition & 0 deletions ci/requirements-2.7.pip
Expand Up @@ -6,3 +6,4 @@ py
PyCrypto
mock
ipython
typing
18 changes: 18 additions & 0 deletions ci/typing.sh
@@ -0,0 +1,18 @@
#!/bin/bash

echo "inside $0"

source activate pandas

RET=0

echo "Typing *.py"
mypy \
pandas/core/base.py
if [ $? -ne "0" ]; then
RET=1
fi
echo "Typing *.py DONE"


exit $RET
14 changes: 12 additions & 2 deletions doc/source/contributing.rst
Expand Up @@ -494,8 +494,8 @@ many errors as possible, but it may not correct *all* of them. Thus, it is
recommended that you run ``cpplint`` to double check and make any other style
fixes manually.

Python (PEP8)
~~~~~~~~~~~~~
Python (PEP8 and mypy)
~~~~~~~~~~~~~~~~~~~~~~

*pandas* uses the `PEP8 <http://www.python.org/dev/peps/pep-0008/>`_ standard.
There are several tools to ensure you abide by this standard. Here are *some* of
Expand Down Expand Up @@ -525,6 +525,16 @@ run this slightly modified command::

git diff master --name-only -- '*.py' | grep 'pandas/' | xargs flake8

Pandas is gradually introducing static type annotations to the code base with
`mypy <http://mypy.readthedocs.io/>`_. To run the checker, you'll need to install
``mypy`` (``pip install mypy``) and run::

sh ci/typing.sh

or on individual files with::

mypy path/to/module.py

Backwards Compatibility
~~~~~~~~~~~~~~~~~~~~~~~

Expand Down