Skip to content

CI: Move sql builds from Travis to Github actions #38344

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 69 commits into from
Dec 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
644f80e
CLN: use with instead of try finally in io/stata.py
Dec 6, 2020
bed5d8c
Merge remote-tracking branch 'upstream/master' into use-with-stata
Dec 7, 2020
fdf8797
CI: move py38-slow to actions
Dec 7, 2020
9d84dc4
CI: move py38-slow to actions
Dec 7, 2020
7a0972c
CI: fix typo, add password
Dec 7, 2020
0804e03
CI: troubleshoot actions
Dec 7, 2020
a76a067
CI: troubleshoot actions
Dec 7, 2020
905d826
CI: troubleshoot actions
Dec 7, 2020
d2c1efd
CI: troubleshoot actions
Dec 7, 2020
311409b
CI: troubleshoot actions
Dec 7, 2020
7b02a7e
CI: troubleshoot actions
Dec 7, 2020
f9c0a1a
CI: troubleshoot actions
Dec 8, 2020
6910132
CI: troubleshoot actions
Dec 8, 2020
736c4a1
CI: build pandas
Dec 8, 2020
2330a33
CI: print skipped tests
Dec 8, 2020
365b953
Merge remote-tracking branch 'upstream/master' into move-travis-to-ac…
Dec 10, 2020
410bf98
CI: change branche
Dec 10, 2020
9bf82cd
CI: debug
Dec 10, 2020
3bf8e9f
Merge remote-tracking branch 'upstream/master' into move-travis-to-ac…
Dec 11, 2020
1c83fde
CL: debut sql tests
Dec 11, 2020
00bf2f0
Merge remote-tracking branch 'upstream/master' into move-travis-to-ac…
Dec 20, 2020
0ace2e1
CI: try 37 locale
Dec 20, 2020
676c136
CI: try 37 locale
Dec 20, 2020
2bc0950
CI: try 37 locale
Dec 20, 2020
510d2bb
CI: try 37 locale
Dec 20, 2020
b1d6023
CI: try 37 locale
Dec 20, 2020
5b752f5
CI: try 37 locale
Dec 20, 2020
eb89799
Merge remote-tracking branch 'upstream/master' into move-travis-to-ac…
Dec 23, 2020
6114a56
try to fix postgres
Dec 23, 2020
c6c628d
try to fix postgres
Dec 23, 2020
bd797a8
try to fix postgres
Dec 23, 2020
4bef8e0
Merge remote-tracking branch 'upstream/master' into move-travis-to-ac…
Dec 25, 2020
cccffe1
postgres
Dec 25, 2020
2a5164b
remove default channel
Dec 25, 2020
86c627c
unpin xlrd to resolve conflicts
Dec 25, 2020
fe54d15
resolve conflicts
Dec 25, 2020
9d4db55
resolve conflicts
Dec 25, 2020
73b671a
resolve conflicts
Dec 25, 2020
75c7344
add mysql
Dec 25, 2020
496384b
add cov
Dec 25, 2020
93c88fa
add cov
Dec 25, 2020
0ba4b83
add cov
Dec 25, 2020
693dbc0
fix typo
Dec 25, 2020
af93e67
fix typo
Dec 25, 2020
136345d
cleanup
Dec 25, 2020
cc22b75
cleanup
Dec 25, 2020
b653f9b
cleanup
Dec 25, 2020
0c0791e
cleanup
Dec 25, 2020
ea685fd
cleanup
Dec 25, 2020
8c1ae7e
pin dep version
Dec 25, 2020
9c7e91b
pin dep version
Dec 25, 2020
a134412
try min blosc version
Dec 25, 2020
ac99f28
try min blosc version
Dec 26, 2020
0779f25
try min blosc version
Dec 26, 2020
6156f36
install libmagic
Dec 26, 2020
3b76c7c
install libmagic
Dec 26, 2020
42cedd4
install xvfb
Dec 26, 2020
8276c1f
install xvfb
Dec 26, 2020
d293e1d
try to find min pymysql version
Dec 26, 2020
ca54750
try checkout v1
Dec 26, 2020
9cbbef7
Merge remote-tracking branch 'upstream/master' into move-travis-to-ac…
Dec 26, 2020
6e5e17f
try 2 workers arm64 build
Dec 26, 2020
54e75d4
change worker back to 1, sync min version
Dec 26, 2020
9da83f4
fix database name
Dec 26, 2020
4d6f10c
Merge remote-tracking branch 'upstream/master' into move-travis-to-ac…
fangchenli Dec 27, 2020
2dacb36
bump fastparquet version
fangchenli Dec 27, 2020
338e1fc
add whatsnew note
fangchenli Dec 27, 2020
9cc6517
add whatsnew note
fangchenli Dec 27, 2020
7d28232
fix typo
fangchenli Dec 27, 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
180 changes: 180 additions & 0 deletions .github/workflows/database.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
name: Database

on:
push:
branches: [master]
pull_request:
branches:
- master
- 1.2.x

env:
PYTEST_WORKERS: "auto"
PANDAS_CI: 1
PATTERN: ((not slow and not network and not clipboard) or (single and db))

jobs:
Linux_py37_locale:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}

env:
ENV_FILE: ci/deps/actions-37-locale.yaml
LOCALE_OVERRIDE: zh_CN.UTF-8

services:
mysql:
image: mysql
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: pandas
options: >-
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 3306:3306

postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: pandas
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

steps:
- name: Checkout
uses: actions/checkout@v1

- name: Cache conda
uses: actions/cache@v1
env:
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('${{ env.ENV_FILE }}') }}

- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: pandas-dev
channel-priority: strict
environment-file: ${{ env.ENV_FILE }}
use-only-tar-bz2: true

- name: Environment Detail
run: |
conda info
conda list

- name: Build Pandas
run: |
python setup.py build_ext -j 2
python -m pip install -e . --no-build-isolation --no-use-pep517

- name: Test
run: ci/run_tests.sh
if: always()

- name: Publish test results
uses: actions/upload-artifact@master
with:
name: Test results
path: test-data.xml
if: failure()

- name: Print skipped tests
run: python ci/print_skipped.py

Linux_py37_cov:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}

env:
ENV_FILE: ci/deps/actions-37-cov.yaml
PANDAS_TESTING_MODE: deprecate
COVERAGE: true

services:
mysql:
image: mysql
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: pandas
options: >-
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 3306:3306

postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: pandas
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

steps:
- name: Checkout
uses: actions/checkout@v1

- name: Cache conda
uses: actions/cache@v1
env:
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('${{ env.ENV_FILE }}') }}

- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: pandas-dev
channel-priority: strict
environment-file: ${{ env.ENV_FILE }}
use-only-tar-bz2: true

- name: Environment Detail
run: |
conda info
conda list

- name: Build Pandas
run: |
python setup.py build_ext -j 2
python -m pip install -e . --no-build-isolation --no-use-pep517

- name: Test
run: ci/run_tests.sh
if: always()

- name: Publish test results
uses: actions/upload-artifact@master
with:
name: Test results
path: test-data.xml
if: failure()

- name: Print skipped tests
run: python ci/print_skipped.py
17 changes: 1 addition & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ services:
# travis cache --delete inside the project directory from the travis command line client
# The cache directories will be deleted if anything in ci/ changes in a commit
cache:
apt: true
ccache: true
directories:
- $HOME/.cache # cython cache

env:
global:
- PYTEST_WORKERS="auto"
# create a github personal access token
# cd pandas-dev/pandas
# travis encrypt 'PANDAS_GH_TOKEN=personal_access_token' -r pandas-dev/pandas
Expand All @@ -35,25 +35,10 @@ matrix:
fast_finish: true

include:
- env:
- JOB="3.7, locale" ENV_FILE="ci/deps/travis-37-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

- arch: arm64
env:
- JOB="3.7, arm64" PYTEST_WORKERS=1 ENV_FILE="ci/deps/travis-37-arm64.yaml" PATTERN="(not slow and not network and not clipboard and not arm_slow)"

- env:
# Enabling Deprecations when running tests
# PANDAS_TESTING_MODE="deprecate" causes DeprecationWarning messages to be displayed in the logs
# See pandas/_testing.py for more details.
- JOB="3.7, coverage" ENV_FILE="ci/deps/travis-37-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

allow_failures:
# Moved to allowed_failures 2020-09-29 due to timeouts https://github.com/pandas-dev/pandas/issues/36719
- arch: arm64
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/travis-37-cov.yaml → ci/deps/actions-37-cov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies:
- beautifulsoup4
- botocore>=1.11
- dask
- fastparquet>=0.3.2
- fastparquet>=0.4.0
- fsspec>=0.7.4
- gcsfs>=0.6.0
- geopandas
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: pandas-dev
channels:
- defaults
- conda-forge
dependencies:
- python=3.7.*
Expand All @@ -18,9 +17,9 @@ dependencies:

# optional
- beautifulsoup4
- blosc=1.15.0
- blosc=1.17.0
- python-blosc
- fastparquet=0.3.2
- fastparquet=0.4.0
- html5lib
- ipython
- jinja2
Expand All @@ -43,5 +42,5 @@ dependencies:

# sql
- psycopg2=2.7
- pymysql=0.7.11
- pymysql=0.8.1
- sqlalchemy=1.3.0
1 change: 0 additions & 1 deletion ci/deps/azure-38-slow.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: pandas-dev
channels:
- defaults
- conda-forge
dependencies:
- python=3.8.*
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/azure-windows-38.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies:
# pandas dependencies
- blosc
- bottleneck
- fastparquet>=0.3.2
- fastparquet>=0.4.0
- flask
- fsspec>=0.8.0
- matplotlib=3.1.3
Expand Down
8 changes: 4 additions & 4 deletions doc/source/getting_started/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,12 @@ Jinja2 2.10 Conditional formatting with DataFra
PyQt4 Clipboard I/O
PyQt5 Clipboard I/O
PyTables 3.5.1 HDF5-based reading / writing
SQLAlchemy 1.2.8 SQL support for databases other than sqlite
SQLAlchemy 1.3.0 SQL support for databases other than sqlite
SciPy 1.12.0 Miscellaneous statistical functions
xlsxwriter 1.0.2 Excel writing
blosc 1.15.0 Compression for HDF5
blosc 1.17.0 Compression for HDF5
fsspec 0.7.4 Handling files aside from local and HTTP
fastparquet 0.3.2 Parquet reading / writing
fastparquet 0.4.0 Parquet reading / writing
gcsfs 0.6.0 Google Cloud Storage access
html5lib 1.0.1 HTML parser for read_html (see :ref:`note <optional_html>`)
lxml 4.3.0 HTML parser for read_html (see :ref:`note <optional_html>`)
Expand All @@ -278,7 +278,7 @@ openpyxl 2.6.0 Reading / writing for xlsx files
pandas-gbq 0.12.0 Google Big Query access
psycopg2 2.7 PostgreSQL engine for sqlalchemy
pyarrow 0.15.0 Parquet, ORC, and feather reading / writing
pymysql 0.7.11 MySQL engine for sqlalchemy
pymysql 0.8.1 MySQL engine for sqlalchemy
pyreadstat SPSS files (.sav) reading
pyxlsb 1.0.6 Reading for xlsb files
qtpy Clipboard I/O
Expand Down
7 changes: 7 additions & 0 deletions doc/source/whatsnew/v1.2.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ Fixed regressions

Bug fixes
~~~~~~~~~

I/O
^^^

- Bumped minimum fastparquet version to 0.4.0 to avoid ``AttributeError`` from numba (:issue:`38344`)
- Bumped minimum pymysql version to 0.8.1 to avoid test failures (:issue:`38344`)

-
-

Expand Down
12 changes: 7 additions & 5 deletions pandas/tests/io/test_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,7 @@ def test_sql_open_close(self):

@pytest.mark.skipif(SQLALCHEMY_INSTALLED, reason="SQLAlchemy is installed")
def test_con_string_import_error(self):
conn = "mysql://root@localhost/pandas_nosetest"
conn = "mysql://root@localhost/pandas"
msg = "Using URI string without sqlalchemy installed"
with pytest.raises(ImportError, match=msg):
sql.read_sql("SELECT * FROM iris", conn)
Expand Down Expand Up @@ -2071,11 +2071,12 @@ class _TestMySQLAlchemy:
"""

flavor = "mysql"
port = 3306

@classmethod
def connect(cls):
return sqlalchemy.create_engine(
f"mysql+{cls.driver}://root@localhost/pandas_nosetest",
f"mysql+{cls.driver}://root@localhost:{cls.port}/pandas",
connect_args=cls.connect_args,
)

Expand Down Expand Up @@ -2140,11 +2141,12 @@ class _TestPostgreSQLAlchemy:
"""

flavor = "postgresql"
port = 5432

@classmethod
def connect(cls):
return sqlalchemy.create_engine(
f"postgresql+{cls.driver}://postgres@localhost/pandas_nosetest"
f"postgresql+{cls.driver}://postgres:postgres@localhost:{cls.port}/pandas"
)

@classmethod
Expand Down Expand Up @@ -2760,7 +2762,7 @@ class TestXMySQL(MySQLMixIn):
@pytest.fixture(autouse=True, scope="class")
def setup_class(cls):
pymysql = pytest.importorskip("pymysql")
pymysql.connect(host="localhost", user="root", passwd="", db="pandas_nosetest")
pymysql.connect(host="localhost", user="root", passwd="", db="pandas")
try:
pymysql.connect(read_default_group="pandas")
except pymysql.ProgrammingError as err:
Expand All @@ -2780,7 +2782,7 @@ def setup_class(cls):
@pytest.fixture(autouse=True)
def setup_method(self, request, datapath):
pymysql = pytest.importorskip("pymysql")
pymysql.connect(host="localhost", user="root", passwd="", db="pandas_nosetest")
pymysql.connect(host="localhost", user="root", passwd="", db="pandas")
try:
pymysql.connect(read_default_group="pandas")
except pymysql.ProgrammingError as err:
Expand Down