Skip to content

CI: adding cython coverage #43660

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

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this go in the coverage section of setup.cfg?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tried that in another repo. it has it be in .coveragerc

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, if this file is re-introduced, then probably should move the coverage stuff currently in setup.cfg (which currently includes this Cython.Coverage line)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tried that in another repo. it has it be in .coveragerc

Are you sure? I just did a test run locally after building using --with-cython-coverage and it seemed to work fine.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're right. my bad!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great can you move to setup.cfg then?

plugins = Cython.Coverage
84 changes: 84 additions & 0 deletions .github/workflows/python-cython.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Python build with Cython
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

umm we need another build? can you do it in an existing one


on:
push:
branches:
- master
- 1.3.x
pull_request:
branches:
- master
- 1.3.x
paths-ignore:
- "doc/**"

jobs:
build:
runs-on: ubuntu-latest
name: python_cython_build
timeout-minutes: 60

strategy:
matrix:
PYTEST_WORKERS: "auto"
PATTERN: "not slow and not network and not clipboard"
COVERAGE: true
PYTEST_TARGET: ["pandas/tests/[a-h]*", "pandas/tests/[i-z]*"]

concurrency:
group: ${{ github.ref }}-${{ matrix.PYTEST_TARGET }}
cancel-in-progress: ${{github.event_name == 'pull_request'}}

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v2

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy
pip install git+https://github.com/pytest-dev/pytest.git
pip install git+https://github.com/nedbat/coveragepy.git
pip install cython python-dateutil pytz hypothesis pytest-xdist pytest-cov
pip list

- name: Build Pandas
run: |
python setup.py build_ext -q -j2 --with-cython-coverage
python -m pip install -e . --no-build-isolation --no-use-pep517

- name: Build Version
run: |
python -c "import pandas; pandas.show_versions();"

- name: Test with pytest
run: |
ci/run_tests.sh
# GH 41935
continue-on-error: true

- 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

- name: Report Coverage
run: |
coverage report -m

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
flags: unittests
name: codecov-pandas
fail_ci_if_error: true
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ def run(self):
# https://pypkg.com/pypi/pytest-cython/f/tests/example-project/setup.py
directives["linetrace"] = True
macros = [("CYTHON_TRACE", "1"), ("CYTHON_TRACE_NOGIL", "1")]
extra_compile_args.append("-Wno-error=maybe-uninitialized")

# silence build warnings about deprecated API usage
# we can't do anything about these warnings because they stem from
Expand Down