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

Test and build docs on GitHub Actions #19

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
39 changes: 39 additions & 0 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Docs

on: [push, pull_request, workflow_dispatch]

env:
FORCE_COLOR: 1

jobs:
docs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x
allow-prereleases: true
cache: pip
cache-dependency-path: |
setup.py
doc/requirements.txt

- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -r doc/requirements.txt
python -m pip install -e .

- name: Build documentation
run: |
make -C doc html

- name: Upload documentation
uses: actions/upload-artifact@v3
with:
name: docs
path: doc/.build/html
38 changes: 38 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Test

on: [push, pull_request, workflow_dispatch]

env:
FORCE_COLOR: 1

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [windows-latest, macos-latest, ubuntu-latest]

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
cache: pip
cache-dependency-path: |
setup.py
tests/requirements.txt

- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -r tests/requirements.txt
python -m pip install -e .

- name: Test
run: |
pytest --cov=calmap --cov=tests
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
build
dist
.cache
.coverage
*.egg-info
.sonarlint
.sonarlint
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
------------------------------------------------
[![PyPI version](https://badge.fury.io/py/calmap.svg)](https://badge.fury.io/py/calmap)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/calmap.svg)
[![Build Status](https://travis-ci.com/MarvinT/calmap.svg?branch=master)](https://travis-ci.com/MarvinT/calmap)
[![GitHub Actions status](https://github.com/MarvinT/calmap/workflows/Test/badge.svg)](https://github.com/MarvinT/calmap/actions)
[![Coverage Status](https://coveralls.io/repos/github/MarvinT/calmap/badge.svg?branch=master)](https://coveralls.io/github/MarvinT/calmap?branch=master)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
Expand Down
4 changes: 2 additions & 2 deletions calmap/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from distutils.version import StrictVersion
from packaging import version
from dateutil.relativedelta import relativedelta
from matplotlib.patches import Polygon

Expand All @@ -28,7 +28,7 @@
__contact__ = "[email protected], [email protected]"
__homepage__ = "https://github.com/MarvinT/calmap"

_pandas_18 = StrictVersion(pd.__version__) >= StrictVersion("0.18")
_pandas_18 = version.parse(pd.__version__) >= version.parse("0.18")


def yearplot(
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from setuptools import setup

install_requires = ["matplotlib", "numpy", "pandas"]
install_requires = ["matplotlib", "packaging", "numpy", "pandas"]

try:
with open("README.md") as readme:
Expand Down