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

[CI] remove unused import in python tests #8409

Merged
merged 1 commit into from
Nov 3, 2022

Conversation

jameslamb
Copy link
Contributor

👋 I'm interested in spending some time helping out on xgboost, so I started looking around tonight.

I ran flake8 over the Python package tonight, and found what looks like an unused import.

flake8 \
    --ignore=E501,W503 \
    python-package/xgboost
python-package/xgboost/testing/__init__.py:6:1: F401 'copy' imported but unused

This PR proposes removing it.

How I tested this

locally on my mac (click for details)

Basically copied what I saw in

- name: Build XGBoost on macos
.

Created and activated a conda environment.

mamba env create \
    --name xgboost-dev \
        pythoon=3.10 \
        pandas \
        numpy \
        scipy \
        dask \
        distributed \
        hypothesis \
        pytest \
        pytest-cov \
        matplotlib

source activate xgboost-dev

Then compiled, built the Python package, installed it, and ran the Python tests.

brew install ninja
mkdir build
cd build
cmake \
    -GNinja \
    -DGOOGLE_TEST=ON \
    -DUSE_DMLC_GTEST=ON \
    -DCMAKE_PREFIX_PATH=$CONDA_PREFIX \
    ..

ninja -j2

cd ../python-package
python setup.py install

cd ../
pytest tests/python

This resulted in 3 test failures which I'm guessing are not related to the change in this PR.

FAILED tests/python/test_linear.py::TestLinear::test_coordinate - hypothesis.errors.FailedHealthCheck: Examples routinely exceeded the max allowable size...
FAILED tests/python/test_tracker.py::test_rabit_ops - socket.gaierror: [Errno 8] nodename nor servname provided, or not known
FAILED tests/python/test_tracker.py::test_rank_assignment - socket.gaierror: [Errno 8] nodename nor servname provided, or not known

Notes for Reviewers

Thanks very much for your time and consideration.

@trivialfis trivialfis merged commit bf8de22 into dmlc:master Nov 3, 2022
@jameslamb jameslamb deleted the unused-import branch November 3, 2022 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants