Skip to content

Commit

Permalink
Call pylint directly during linting instead of via prospector (mlflow#59
Browse files Browse the repository at this point in the history
)

* Generate default pylint rcfile via 'pylint --generate-rcfile > rcfile'

* Rename rcfile -> pylintrc (to match convention elsewhere)

* Update linter to use pylint directly instead of via prospector. Also, customize pylint settings for MLflow

* Update linter-disabling comments

* Delete prospector.yaml

* Add distutils to ignored modules
  • Loading branch information
smurching committed Jun 18, 2018
1 parent 3a52e43 commit 2c1f181
Show file tree
Hide file tree
Showing 6 changed files with 561 additions and 32 deletions.
2 changes: 1 addition & 1 deletion lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ set -e
FWDIR="$(cd "`dirname $0`"; pwd)"
cd "$FWDIR"

prospector --profile "$FWDIR/prospector.yaml" -i "example"
pylint --rcfile="$FWDIR/pylintrc" mlflow

rstcheck README.rst
4 changes: 2 additions & 2 deletions mlflow/pyfunc/scoring_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def init(model):
app = flask.Flask(__name__)

@app.route('/ping', methods=['GET'])
def ping(): # noqa
def ping(): # pylint: disable=unused-variable
"""
Determine if the container is working and healthy.
We declare it healthy if we can load the model successfully.
Expand All @@ -38,7 +38,7 @@ def ping(): # noqa
return flask.Response(response='\n', status=status, mimetype='application/json')

@app.route('/invocations', methods=['POST'])
def transformation(): # noqa
def transformation(): # pylint: disable=unused-variable
"""
Do an inference on a single batch of data. In this sample server,
we take data as CSV or json, convert it to a pandas data frame,
Expand Down
2 changes: 1 addition & 1 deletion mlflow/server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ def serve_static_file(path):
# Serve the index.html for the React App for all other routes.
@app.route('/', defaults={'path': ''})
@app.route('/<path:path>')
def serve(path): # noqa
def serve(path): # pylint: disable=unused-argument
return send_from_directory(STATIC_DIR, 'index.html')
2 changes: 1 addition & 1 deletion mlflow/sklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def serve_model(model_path, run_id=None, port=None, host="127.0.0.1"):
app = flask.Flask(__name__)

@app.route('/invocations', methods=['POST'])
def predict(): # noqa
def predict(): # pylint: disable=unused-variable
if flask.request.content_type != 'application/json':
return flask.Response(status=415, response='JSON data expected', mimetype='text/plain')
data = flask.request.data.decode('utf-8')
Expand Down
27 changes: 0 additions & 27 deletions prospector.yaml

This file was deleted.

Loading

0 comments on commit 2c1f181

Please sign in to comment.