Skip to content

CI: Fix clipboard problems #29712

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

Merged
merged 27 commits into from
Jan 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ca3898a
CI: Fix inconsistent clipboard test
datapythonista Nov 19, 2019
2c68362
Merge remote-tracking branch 'upstream/master' into clipboard_error
TomAugspurger Nov 19, 2019
d72987f
lazy check
TomAugspurger Nov 19, 2019
5e0e32c
Running clipboard tests in all builds (I think we already do in pract…
datapythonista Nov 20, 2019
5fe9209
Adding missing self
datapythonista Nov 20, 2019
99315bf
Restoring test outside class
datapythonista Nov 20, 2019
1e53de6
Explicitly skipping clipboard tests in the travis config (azure is do…
datapythonista Nov 20, 2019
7c527c8
Disabling clipboard where it should not be tested, installing xsel wh…
datapythonista Nov 20, 2019
36ff3ce
Removing qt from conda
datapythonista Nov 20, 2019
63c7364
Setting DISPLAY env var
datapythonista Nov 20, 2019
ebfc48b
Trying to understand if xsel is found or not
datapythonista Nov 20, 2019
f84ac34
Better checking to see if xsel is installed
datapythonista Nov 20, 2019
c15f5a7
More xsel info
datapythonista Nov 20, 2019
fea7bae
Merging from master
datapythonista Dec 30, 2019
8532555
Removing xfail
datapythonista Dec 30, 2019
ed429ed
Fixing debug info
datapythonista Dec 31, 2019
cb950f8
Merging from master
datapythonista Jan 8, 2020
fec1363
Black
datapythonista Jan 8, 2020
7cff22d
Fixed typo in a comment
datapythonista Jan 10, 2020
69ea764
Merge remote-tracking branch 'upstream/master' into clipboard_error
datapythonista Jan 14, 2020
49181e3
Checking xsel
datapythonista Jan 14, 2020
8a8244d
Adding more checks for xsel
datapythonista Jan 14, 2020
3384d1e
Using xvfb
datapythonista Jan 15, 2020
670409e
Not logging xvfb output
datapythonista Jan 15, 2020
4a4e116
Removing checks
datapythonista Jan 15, 2020
2ec47e5
Fixing patterns, calling all tests (just debug raises left to be merged)
datapythonista Jan 15, 2020
4a9ed03
Final clean up, this should be ready
datapythonista Jan 15, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ matrix:

include:
- env:
- JOB="3.8" ENV_FILE="ci/deps/travis-38.yaml" PATTERN="(not slow and not network)"
- JOB="3.8" ENV_FILE="ci/deps/travis-38.yaml" PATTERN="(not slow and not network and not clipboard)"

- env:
- JOB="3.7" ENV_FILE="ci/deps/travis-37.yaml" PATTERN="(not slow and not network)"
- JOB="3.7" ENV_FILE="ci/deps/travis-37.yaml" PATTERN="(not slow and not network and not clipboard)"

- env:
- JOB="3.6, locale" ENV_FILE="ci/deps/travis-36-locale.yaml" PATTERN="((not slow and not network) or (single and db))" LOCALE_OVERRIDE="zh_CN.UTF-8" SQL="1"
- JOB="3.6, locale" ENV_FILE="ci/deps/travis-36-locale.yaml" PATTERN="((not slow and not network and not clipboard) or (single and db))" LOCALE_OVERRIDE="zh_CN.UTF-8" SQL="1"
services:
- mysql
- postgresql

- env:
- JOB="3.6, coverage" ENV_FILE="ci/deps/travis-36-cov.yaml" PATTERN="((not slow and not network) or (single and db))" PANDAS_TESTING_MODE="deprecate" COVERAGE=true SQL="1"
- JOB="3.6, coverage" ENV_FILE="ci/deps/travis-36-cov.yaml" PATTERN="((not slow and not network and not clipboard) or (single and db))" PANDAS_TESTING_MODE="deprecate" COVERAGE=true SQL="1"
services:
- mysql
- postgresql
Expand Down
8 changes: 4 additions & 4 deletions ci/azure/posix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
py36_minimum_versions:
ENV_FILE: ci/deps/azure-36-minimum_versions.yaml
CONDA_PY: "36"
PATTERN: "not slow and not network"
PATTERN: "not slow and not network and not clipboard"

py36_locale_slow_old_np:
ENV_FILE: ci/deps/azure-36-locale_slow.yaml
Expand All @@ -36,12 +36,12 @@ jobs:
PATTERN: "not slow and not network"
LANG: "it_IT.utf8"
LC_ALL: "it_IT.utf8"
EXTRA_APT: "language-pack-it"
EXTRA_APT: "language-pack-it xsel"

py36_32bit:
ENV_FILE: ci/deps/azure-36-32bit.yaml
CONDA_PY: "36"
PATTERN: "not slow and not network"
PATTERN: "not slow and not network and not clipboard"
BITS32: "yes"

py37_locale:
Expand All @@ -50,7 +50,7 @@ jobs:
PATTERN: "not slow and not network"
LANG: "zh_CN.utf8"
LC_ALL: "zh_CN.utf8"
EXTRA_APT: "language-pack-zh-hans"
EXTRA_APT: "language-pack-zh-hans xsel"

py37_np_dev:
ENV_FILE: ci/deps/azure-37-numpydev.yaml
Expand Down
12 changes: 6 additions & 6 deletions ci/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ if [ "$COVERAGE" ]; then
COVERAGE="-s --cov=pandas --cov-report=xml:$COVERAGE_FNAME"
fi

PYTEST_CMD="pytest -m \"$PATTERN\" -n auto --dist=loadfile -s --strict --durations=10 --junitxml=test-data.xml $TEST_ARGS $COVERAGE pandas"

# Travis does not have have an X server
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
DISPLAY=DISPLAY=:99.0
PYTEST_CMD="xvfb-run -e /dev/stdout $PYTEST_CMD"
# If no X server is found, we use xvfb to emulate it
if [[ $(uname) == "Linux" && -z $DISPLAY ]]; then
export DISPLAY=":0"
XVFB="xvfb-run "
fi

PYTEST_CMD="${XVFB}pytest -m \"$PATTERN\" -n auto --dist=loadfile -s --strict --durations=10 --junitxml=test-data.xml $TEST_ARGS $COVERAGE pandas"

echo $PYTEST_CMD
sh -c "$PYTEST_CMD"

Expand Down
5 changes: 5 additions & 0 deletions ci/setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ echo "remove postgres if has been installed with conda"
echo "we use the one from the CI"
conda remove postgresql -y --force || true

echo
echo "remove qt"
echo "causes problems with the clipboard, we use xsel for that"
conda remove qt -y --force || true

echo
echo "conda list pandas"
conda list pandas
Expand Down
11 changes: 1 addition & 10 deletions pandas/tests/io/test_clipboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@
from pandas import DataFrame, get_option, read_clipboard
import pandas._testing as tm

from pandas.io.clipboard import PyperclipException, clipboard_get, clipboard_set

try:
DataFrame({"A": [1, 2]}).to_clipboard()
_DEPS_INSTALLED = 1
except (PyperclipException, RuntimeError):
_DEPS_INSTALLED = 0
from pandas.io.clipboard import clipboard_get, clipboard_set


def build_kwargs(sep, excel):
Expand Down Expand Up @@ -148,7 +142,6 @@ def test_mock_clipboard(mock_clipboard):

@pytest.mark.single
@pytest.mark.clipboard
@pytest.mark.skipif(not _DEPS_INSTALLED, reason="clipboard primitives not installed")
@pytest.mark.usefixtures("mock_clipboard")
class TestClipboard:
def check_round_trip_frame(self, data, excel=None, sep=None, encoding=None):
Expand Down Expand Up @@ -256,9 +249,7 @@ def test_round_trip_valid_encodings(self, enc, df):

@pytest.mark.single
@pytest.mark.clipboard
@pytest.mark.skipif(not _DEPS_INSTALLED, reason="clipboard primitives not installed")
@pytest.mark.parametrize("data", ["\U0001f44d...", "Ωœ∑´...", "abcd..."])
@pytest.mark.xfail(reason="flaky in CI", strict=False)
def test_raw_roundtrip(data):
# PR #25040 wide unicode wasn't copied correctly on PY3 on windows
clipboard_set(data)
Expand Down