Skip to content

Commit

Permalink
Merge branch 'main' into feature/pnast/address-pandas-futurewarning
Browse files Browse the repository at this point in the history
  • Loading branch information
patricktnast authored Sep 26, 2023
2 parents ad3eb9d + 9858573 commit c677bb0
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 5 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# -----------------------------------------------------------------------------
# - invoked on push, pull_request, or manual trigger
# - invoked on push, pull_request, manual trigger, or schedule
# - test under at least 3 versions of python
# -----------------------------------------------------------------------------
name: build
on: [push, pull_request, workflow_dispatch]
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: "0 8 * * *"

jobs:
build:
Expand Down Expand Up @@ -31,7 +36,11 @@ jobs:
pip install .[dev]
- name: Test
run: |
pytest ./tests
if github.event_name == 'schedule'; then
pytest --runslow ./tests
else
pytest ./tests
fi
- name: Doc build
run: |
make html -C docs/ SPHINXOPTS="-W --keep-going -n"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Test
run: |
pip install .[test]
pytest ./tests
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Risk Distributions
.. image:: https://badge.fury.io/py/risk_distributions.svg
:target: https://badge.fury.io/py/risk-distributions

.. image:: https://travis-ci.org/ihmeuw/risk_distributions.svg?branch=master
:target: https://travis-ci.org/ihmeuw/risk_distributions
.. image:: https://github.com/ihmeuw/risk_distributions/actions/workflows/build.yml/badge.svg?branch=main
:target: https://github.com/ihmeuw/risk_distributions
:alt: Latest Version

.. image:: https://readthedocs.org/projects/risk-distributions/badge/?version=latest
Expand Down
19 changes: 19 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import pytest


def pytest_addoption(parser):
parser.addoption("--runslow", action="store_true", default=False, help="run slow tests")


def pytest_configure(config):
config.addinivalue_line("markers", "slow: mark test as slow to run")


def pytest_collection_modifyitems(config, items):
if config.getoption("--runslow"):
# --runslow given in cli: do not skip slow tests
return
skip_slow = pytest.mark.skip(reason="need --runslow option to run")
for item in items:
if "slow" in item.keywords:
item.add_marker(skip_slow)

0 comments on commit c677bb0

Please sign in to comment.