Skip to content
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
2 changes: 0 additions & 2 deletions .coveragerc

This file was deleted.

156 changes: 131 additions & 25 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,149 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package
name: CI

on:
push:
branches: [ master, dev]
pull_request:
branches: [ master, dev, v0.7]

permissions: {}

jobs:
build:
check:
name: ${{ matrix.env.name }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
env:
- {"name": "pkg", "target": "show"}
# - {"name": "lint", "target": "run"}
# - {"name": "type", "target": "run"}
- {"name": "docs", "target": "all"}
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: Let us have colors
run: echo "FORCE_COLOR=true" >> "$GITHUB_ENV"
- name: Install Hatch
uses: pypa/hatch@install
- name: Setup ${{ matrix.env.name }}
run: |
hatch -v env create ${{ matrix.env.name }}
hatch run ${{ matrix.env.name }}:pip freeze
- name: Run ${{ matrix.env.name }}
run: hatch -v run ${{ matrix.env.name }}:${{ matrix.env.target }}

test:
name: test py${{ matrix.python-version }} - seaborn-${{ matrix.seaborn-version }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9, '3.10', 3.11, 3.12]
# keep synchronized with hatch tests matrix
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
seaborn-version: ["0.13"]
# include seaborn-version [0.11, 0.12] only for python < 3.12
include:
- python-version: "3.10"
seaborn-version: "0.11"
- python-version: "3.10"
seaborn-version: "0.12"
- python-version: "3.11"
seaborn-version: "0.11"
- python-version: "3.11"
seaborn-version: "0.12"

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 coverage packaging
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with unittest
run: |
coverage run -m unittest discover tests
coverage report -m
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v4
- name: Setup python
uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: Pick environment to run
run: |
import codecs
import os
env = "tests.py{}-{}".format("${{ matrix.python-version }}", "${{ matrix.seaborn-version }}")
print(f"Environment {env}")
with codecs.open(os.environ["GITHUB_ENV"], mode="a", encoding="utf-8") as file_handler:
file_handler.write("FORCE_COLOR=1\n")
file_handler.write(f"ENV={env}\n")
shell: python
- name: Install Hatch
uses: pypa/hatch@install
- uses: actions/checkout@v6
with:
persist-credentials: false
fetch-depth: 0
- name: Setup python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Setup test environment
run: |
hatch -v env create ${ENV}
hatch run ${ENV}:pip freeze
shell: bash
- name: Run test suite
run: hatch -v run ${ENV}:run-cov
env:
CI_RUN: "yes"
shell: bash
- name: Upload coverage data
uses: actions/upload-artifact@v7
with:
name: coverage-${{ matrix.python-version }}-${{ matrix.seaborn-version }}
path: report/.coverage.*
if-no-files-found: error
include-hidden-files: true

coverage:
name: coverage
runs-on: ubuntu-22.04
needs: test
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
fetch-depth: 0
- uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: Let us have colors
run: echo "FORCE_COLOR=true" >> "$GITHUB_ENV"
- name: Install Hatch
uses: pypa/hatch@install
- name: Setup coverage tool
run: |
hatch -v env create coverage
hatch run coverage:pip freeze
- name: Download coverage data
uses: actions/download-artifact@v8
with:
pattern: coverage-*
path: report
merge-multiple: true
- name: Combine and report coverage
run: hatch run coverage:run

- name: Upload HTML report
uses: actions/upload-artifact@v7
with:
name: html-report
path: report/html

- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v6
with:
directory: report
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
5 changes: 5 additions & 0 deletions .github/zizmor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
rules:
unpinned-uses:
config:
policies:
"*": ref-pin
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ statannot.egg-info/requires.txt
statannot.egg-info/SOURCES.txt
statannot.egg-info/top_level.txt

usage/figures/*
report/

# IDE files
.idea/
35 changes: 35 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
exclude: '^(.*\.svg)$'
- id: trailing-whitespace
exclude: '^(.*\.svg|.*\.tsv)$'

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.25
hooks:
- id: validate-pyproject
name: validate-pyproject

- repo: https://github.com/crate-ci/typos
rev: v1.46.0
hooks:
- id: typos

- repo: https://github.com/woodruffw/zizmor-pre-commit
rev: v1.24.1
hooks:
- id: zizmor

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.12
hooks:
# Run the linter.
- id: ruff
args: [ --fix, --unsafe-fixes ]
# Run the formatter.
- id: ruff-format
2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

1 change: 0 additions & 1 deletion coverage.sh

This file was deleted.

Binary file removed docs/build/doctrees/index.doctree
Binary file not shown.
Binary file removed docs/build/doctrees/modules.doctree
Binary file not shown.
Binary file removed docs/build/doctrees/setup.doctree
Binary file not shown.
Binary file removed docs/build/doctrees/statannotations.doctree
Binary file not shown.
Binary file removed docs/build/doctrees/statannotations.stats.doctree
Binary file not shown.
4 changes: 0 additions & 4 deletions docs/build/html/.buildinfo

This file was deleted.

20 changes: 0 additions & 20 deletions docs/build/html/_sources/index.rst.txt

This file was deleted.

8 changes: 0 additions & 8 deletions docs/build/html/_sources/modules.rst.txt

This file was deleted.

7 changes: 0 additions & 7 deletions docs/build/html/_sources/setup.rst.txt

This file was deleted.

63 changes: 0 additions & 63 deletions docs/build/html/_sources/statannotations.rst.txt

This file was deleted.

55 changes: 0 additions & 55 deletions docs/build/html/_sources/statannotations.stats.rst.txt

This file was deleted.

Loading