Skip to content
Merged
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
67 changes: 67 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: release

on:
push:
tags:
- "v*"

jobs:
build:
name: Build sdist and wheel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install build
run: python -m pip install --upgrade build

- name: Build distribution
run: python -m build

- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/

publish-testpypi:
name: Publish to TestPyPI
needs: build
if: contains(github.ref, '-rc') || contains(github.ref, '-a') || contains(github.ref, '-b')
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/baycomp_plotting
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/

- uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

publish-pypi:
name: Publish to PyPI
needs: build
# Only stable tags (no -rc, -a, -b suffix) go to real PyPI.
if: ${{ !contains(github.ref, '-') }}
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/baycomp_plotting
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/

- uses: pypa/gh-action-pypi-publish@release/v1
40 changes: 40 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: tests

on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
# Weekly run on Mondays catches breakage from new transitive deps.
- cron: "0 6 * * 1"

jobs:
test:
name: py${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
include:
- os: macos-latest
python-version: "3.12"
- os: windows-latest
python-version: "3.12"
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install package with test extras
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[test]"

- name: Run tests
run: pytest --mpl
1 change: 0 additions & 1 deletion baycomp_plotting/__init__.py

This file was deleted.

159 changes: 0 additions & 159 deletions baycomp_plotting/plotting.py

This file was deleted.

73 changes: 73 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
[build-system]
requires = ["hatchling>=1.24"]
build-backend = "hatchling.build"

[project]
name = "baycomp_plotting"
version = "1.2.0"
description = "Extra plotting functionality for baycomp's Bayesian classifier comparison posteriors."
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.9"
authors = [
{ name = "Mario Juez-Gil", email = "mariojg@ubu.es" },
]
keywords = [
"bayesian",
"classifier-comparison",
"machine-learning",
"plotting",
"baycomp",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Visualization",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dependencies = [
"matplotlib>=3.5",
"numpy>=1.21",
"scipy>=1.7",
]

[project.optional-dependencies]
test = [
"pytest>=7",
"pytest-mpl>=0.17",
"baycomp>=1.0.3",
]

[project.urls]
Homepage = "https://github.com/mjuez/baycomp_plotting"
Repository = "https://github.com/mjuez/baycomp_plotting"
Issues = "https://github.com/mjuez/baycomp_plotting/issues"

[tool.hatch.build.targets.wheel]
packages = ["src/baycomp_plotting"]

[tool.hatch.build.targets.sdist]
include = [
"src",
"tests",
"README.md",
"LICENSE",
"pyproject.toml",
]

[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-ra"
filterwarnings = [
"error::DeprecationWarning",
"error::FutureWarning",
# Emitted by matplotlib's internal use of pyparsing; third-party.
"ignore::pyparsing.warnings.PyparsingDeprecationWarning",
]
2 changes: 0 additions & 2 deletions setup.cfg

This file was deleted.

35 changes: 0 additions & 35 deletions setup.py

This file was deleted.

11 changes: 11 additions & 0 deletions src/baycomp_plotting/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from importlib.metadata import PackageNotFoundError as _PackageNotFoundError
from importlib.metadata import version as _version

from .plotting import Color, dens, tern

try:
__version__ = _version("baycomp_plotting")
except _PackageNotFoundError:
__version__ = "0.0.0+unknown"

__all__ = ["Color", "dens", "tern", "__version__"]
Loading
Loading