Fix with latest pylint. (#7071)

This commit is contained in:
Jiaming Yuan 2021-07-02 21:26:00 +08:00 committed by GitHub
parent a5d222fcdb
commit 93f3acdef9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View File

@ -301,12 +301,16 @@ if __name__ == '__main__':
# - pip install . -e # - pip install . -e
# - python setup.py develop # same as above # - python setup.py develop # same as above
logging.basicConfig(level=logging.INFO) logging.basicConfig(level=logging.INFO)
with open(os.path.join(CURRENT_DIR, 'README.rst'), encoding='utf-8') as fd:
description = fd.read()
with open(os.path.join(CURRENT_DIR, 'xgboost/VERSION')) as fd:
version = fd.read().strip()
setup(name='xgboost', setup(name='xgboost',
version=open(os.path.join( version=version,
CURRENT_DIR, 'xgboost/VERSION')).read().strip(),
description="XGBoost Python Package", description="XGBoost Python Package",
long_description=open(os.path.join(CURRENT_DIR, 'README.rst'), long_description=description,
encoding='utf-8').read(),
long_description_content_type="text/x-rst", long_description_content_type="text/x-rst",
install_requires=[ install_requires=[
'numpy', 'numpy',

View File

@ -502,7 +502,7 @@ def cv(params, dtrain, num_boost_round=10, nfold=3, stratified=False, folds=None
results[key + '-std'].append(std) results[key + '-std'].append(std)
if should_break: if should_break:
for k in results: for k in results.keys(): # pylint: disable=consider-iterating-dictionary
results[k] = results[k][:(booster.best_iteration + 1)] results[k] = results[k][:(booster.best_iteration + 1)]
break break
if as_pandas: if as_pandas: