Skip to content

Commit

Permalink
Prepare for v.0.3.0
Browse files Browse the repository at this point in the history
Update workflow
  • Loading branch information
richardkoehler authored Feb 15, 2024
2 parents 7fa5b93 + a5dd18d commit 54a0141
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 49 deletions.
4 changes: 2 additions & 2 deletions .github/actions/setup-venv/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ runs:
using: composite
steps:
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}

Expand All @@ -26,7 +26,7 @@ runs:
# Get the exact Python version to use in the cache key.
echo "PYTHON_VERSION=$(python --version)" >> $GITHUB_ENV
- uses: actions/cache@v2
- uses: actions/cache@v4
id: virtualenv-cache
with:
path: .venv
Expand Down
47 changes: 16 additions & 31 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,52 +21,36 @@ env:

jobs:
tests:
name: Python ${{ matrix.python }} - ${{ matrix.task.name }}
name:
${{ matrix.os }} - Python ${{ matrix.python }} - ${{ matrix.task.name }}
runs-on: [ubuntu-latest]
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python: ["3.12", "3.11", "3.10"]
python: ["3.12"]
task:
- name: Test
os: [windows-latest, ubuntu-latest, macos-latest]
run: |
pytest -v --color=yes tests/
- name: Build
os: [windows-latest, ubuntu-latest, macos-latest]
run: python -m build

run:
":"
# pytest -v --color=yes tests/
include:
# - os: [windows-latest, ubuntu-latest, macos-latest]
# task:
# name: Build
# run: |
# python -m build

- python: "3.12"
task:
name: pre-commit
run: |
pip install pre-commit
pre-commit run --all-files
- python: "3.12"
task:
name: Lint
run: ruff check .

- python: "3.12"
task:
name: Type check
run: mypy .

- python: "3.12"
task:
name: Build
run: hatch build
- python: "3.12"
task:
name: Style
run: black --check .

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

Expand All @@ -82,9 +66,9 @@ jobs:
with:
path: .mypy_cache
key:
mypy-${{ env.CACHE_PREFIX }}-${{ runner.os }}-${{ matrix.python
}}-${{ hashFiles('*requirements.txt') }}-${{ github.ref }}-${{
github.sha }}
mypy-${{ env.CACHE_PREFIX }}-${{ runner.os }}-${{
matrix.python}}-${{ hashFiles('*requirements.txt') }}-${{ github.ref
}}-${{github.sha }}
restore-keys: |
mypy-${{ env.CACHE_PREFIX }}-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('*requirements.txt') }}-${{ github.ref }}
mypy-${{ env.CACHE_PREFIX }}-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('*requirements.txt') }}
Expand Down Expand Up @@ -114,9 +98,10 @@ jobs:
needs: [tests]
environment:
name: pypi
url: https://pypi.org/p/<package-name> # Replace <package-name> with your PyPI project name
url: https://pypi.org/p/pte-stats
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
contents: write
steps:
- uses: actions/checkout@v4
with:
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ repos:
hooks:
- id: codespell

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: "v0.9.0.6"
hooks:
- id: shellcheck
# - repo: https://github.com/shellcheck-py/shellcheck-py
# rev: "v0.9.0.6"
# hooks:
# - id: shellcheck

- repo: local
hooks:
Expand All @@ -84,7 +84,7 @@ repos:
- id: validate-pyproject

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.27.0
rev: 0.28.0
hooks:
- id: check-dependabot
- id: check-github-workflows
Expand Down
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
[![Tests][tests-shield]][tests-url] [![License][license-shield]][license-url]
[![Contributors][contributors-shield]][contributors-url]
[![Code Style][codestyle-shield]][codestyle-url]
[![Homepage][homepage-shield]][homepage-url]

# PTE Stats - Python tools for electrophysiology

Expand Down Expand Up @@ -89,18 +88,15 @@ PTE Stats is licensed under the [MIT license](license-url).
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->

[python-shield]:
https://img.shields.io/static/v1?label=Python&message=3.10&logoColor=black&labelColor=grey&color=blue
https://img.shields.io/static/v1?label=Python&message=3.12&logoColor=black&labelColor=grey&color=blue
[python-url]: https://pypi.org/project/pte-stats/
[pypi-shield]:
https://img.shields.io/static/v1?label=PyPi&message=v0.2.0&logoColor=black&labelColor=grey&color=blue
https://img.shields.io/static/v1?label=PyPi&message=v0.3.0&logoColor=black&labelColor=grey&color=blue
[pypi-url]: https://pypi.org/project/pte-stats/
[tests-shield]:
https://github.com/richardkoehler/pte-stats/actions/workflows/tests.yml/badge.svg
https://github.com/richardkoehler/pte-stats/actions/workflows/main.yml/badge.svg
[tests-url]:
https://github.com/richardkoehler/pte-stats/actions/workflows/tests.yml
[homepage-shield]:
https://img.shields.io/static/v1?label=Homepage&message=ICN&logoColor=black&labelColor=grey&color=9cf
[homepage-url]: https://www.icneuromodulation.org/
https://github.com/richardkoehler/pte-stats/actions/workflows/main.yml
[contributors-shield]:
https://img.shields.io/github/contributors/richardkoehler/pte-stats.svg
[contributors-url]:
Expand Down
16 changes: 14 additions & 2 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## Unreleased

### Added

Expand All @@ -18,7 +18,19 @@ and this project adheres to

### Removed

## [0.1.0] - 2022-02-01
## [v0.3.0](https://github.com/richardkoehler/pte-stats/releases/tag/v0.3.0) - 2024-02-15

## [v0.3.0rc1](https://github.com/richardkoehler/pte-stats/releases/tag/v0.3.0rc1) - 2024-02-15

- Minor additions

## [0.2.0](https://github.com/richardkoehler/pte-stats/releases/tag/v0.2.0) - 2023-01-12

### Added

- Minor additions

## [0.1.0](https://github.com/richardkoehler/pte-stats/releases/tag/v0.1.0) - 2022-02-01

### Added

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ dependencies = [
[project.optional-dependencies]
dev = [
"black",
"hatch",
"mypy",
"packaging",
"pandas-stubs",
Expand Down
19 changes: 19 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

set -e

TAG=$(python -c 'from pte_stats import __version__; print("v" + __version__)')

read -p "Creating new release for $TAG. Do you want to continue? [Y/n] " prompt

if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then
python scripts/prepare_changelog.py
git add -A
git commit -m "Bump version to $TAG for release" || true && git push
echo "Creating new git tag $TAG"
git tag "$TAG" -m "$TAG"
git push --tags
else
echo "Cancelled"
exit 1
fi
2 changes: 1 addition & 1 deletion src/pte_stats/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""An open-source software package for statistics with time series. """

__version__ = "0.3.0rc1"
__version__ = "0.3.0"

from .cluster import (
cluster_analysis_1d,
Expand Down

0 comments on commit 54a0141

Please sign in to comment.