Skip to content
This repository was archived by the owner on Mar 19, 2026. It is now read-only.

Commit df72896

Browse files
committed
create isis-streaming-data-types
1 parent a059b3f commit df72896

File tree

210 files changed

+246
-105
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

210 files changed

+246
-105
lines changed

.flake8

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Python application
5+
6+
on:
7+
workflow_call:
8+
push:
9+
branches: [ "main" ]
10+
pull_request:
11+
branches: [ "main" ]
12+
13+
jobs:
14+
call-workflow:
15+
uses: ISISComputingGroup/reusable-workflows/.github/workflows/linters.yml@main
16+
with:
17+
compare-branch: origin/main
18+
python-ver: '3.13'
19+
runs-on: 'ubuntu-latest'
20+
tests:
21+
strategy:
22+
matrix:
23+
version: ['3.12', '3.13', '3.14']
24+
os: ["ubuntu-latest", "windows-latest"]
25+
runs-on: ${{ matrix.os }}
26+
steps:
27+
- uses: actions/checkout@v6
28+
- name: Install uv and set the python version
29+
uses: astral-sh/setup-uv@v7
30+
with:
31+
python-version: ${{ matrix.runs-on }}
32+
- name: Install dependencies
33+
run: uv sync --all-extras --dev
34+
- name: Test with pytest
35+
run: uv run pytest tests
36+
results:
37+
if: ${{ always() }}
38+
runs-on: ubuntu-latest
39+
name: Final Results
40+
needs: [tests, call-workflow]
41+
steps:
42+
- run: exit 1
43+
# see https://stackoverflow.com/a/67532120/4907315
44+
if: >-
45+
${{
46+
contains(needs.*.result, 'failure')
47+
|| contains(needs.*.result, 'cancelled')
48+
}}

.github/workflows/release.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Publish Python distribution to PyPI
2+
on: push
3+
jobs:
4+
lint-and-test:
5+
if: github.ref_type == 'tag'
6+
name: Run linter and tests
7+
uses: ./.github/workflows/Lint-and-test.yml
8+
build:
9+
needs: lint-and-test
10+
if: github.ref_type == 'tag'
11+
name: build distribution
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v6
16+
- name: Set up Python
17+
uses: actions/setup-python@v6
18+
with:
19+
python-version: "3.13"
20+
- name: Install pypa/build
21+
run: >-
22+
python3 -m
23+
pip install
24+
build
25+
--user
26+
- name: Build a binary wheel and a source tarball
27+
run: python3 -m build
28+
- name: Store the distribution packages
29+
uses: actions/upload-artifact@v6
30+
with:
31+
name: python-package-distributions
32+
path: dist/
33+
publish-to-pypi:
34+
name: >-
35+
Publish Python distribution to PyPI
36+
if: github.ref_type == 'tag'
37+
needs: [lint-and-test, build]
38+
runs-on: ubuntu-latest
39+
environment:
40+
name: release
41+
url: https://pypi.org/p/isis-streaming-data-types
42+
permissions:
43+
id-token: write # IMPORTANT: mandatory for trusted publishing
44+
steps:
45+
- name: Download all the dists
46+
uses: actions/download-artifact@v7
47+
with:
48+
name: python-package-distributions
49+
path: dist/
50+
- name: Publish distribution to PyPI
51+
uses: pypa/gh-action-pypi-publish@release/v1
52+
github-release:
53+
name: >-
54+
Sign the Python distribution with Sigstore
55+
and upload them to GitHub Release
56+
needs: [lint-and-test, build, publish-to-pypi]
57+
runs-on: ubuntu-latest
58+
59+
permissions:
60+
contents: write # IMPORTANT: mandatory for making GitHub Releases
61+
id-token: write # IMPORTANT: mandatory for sigstore
62+
63+
steps:
64+
- name: Download all the dists
65+
uses: actions/download-artifact@v7
66+
with:
67+
name: python-package-distributions
68+
path: dist/
69+
- name: Sign the dists with Sigstore
70+
uses: sigstore/gh-action-sigstore-python@v3.2.0
71+
with:
72+
inputs: >-
73+
./dist/*.tar.gz
74+
./dist/*.whl
75+
- name: Create GitHub Release
76+
env:
77+
GITHUB_TOKEN: ${{ github.token }}
78+
run: >-
79+
gh release create
80+
'${{ github.ref_name }}'
81+
--repo '${{ github.repository }}'
82+
--notes ""
83+
- name: Upload artifact signatures to GitHub Release
84+
env:
85+
GITHUB_TOKEN: ${{ github.token }}
86+
# Upload to GitHub Release using the `gh` CLI.
87+
# `dist/` contains the built packages, and the
88+
# sigstore-produced signatures and certificates.
89+
run: >-
90+
gh release upload
91+
'${{ github.ref_name }}' dist/**
92+
--repo '${{ github.repository }}'

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,5 @@ dmypy.json
136136
# VSCode
137137
.vscode
138138

139+
140+
src/streaming_data_types/_version.py

.pre-commit-config.yaml

Lines changed: 0 additions & 23 deletions
This file was deleted.

MANIFEST.in

Lines changed: 0 additions & 4 deletions
This file was deleted.

Makefile

Lines changed: 0 additions & 5 deletions
This file was deleted.

pyproject.toml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
[build-system]
2+
requires = ["setuptools", "setuptools_scm>=8"]
3+
build-backend = "setuptools.build_meta"
4+
5+
6+
[project]
7+
name = "isis_streaming_data_types"
8+
dynamic = ["version"]
9+
description = "Python utilities for handling ISIS streamed data"
10+
readme = "README.md"
11+
requires-python = ">=3.12"
12+
license-files = ["LICENSE"]
13+
14+
authors = [
15+
{name = "ISIS Experiment Controls", email = "ISISExperimentControls@stfc.ac.uk" }
16+
]
17+
maintainers = [
18+
{name = "ISIS Experiment Controls", email = "ISISExperimentControls@stfc.ac.uk" }
19+
]
20+
21+
# Classifiers help users find your project by categorizing it.
22+
#
23+
# For a list of valid classifiers, see https://pypi.org/classifiers/
24+
classifiers = [
25+
# How mature is this project? Common values are
26+
# 3 - Alpha
27+
# 4 - Beta
28+
# 5 - Production/Stable
29+
"Development Status :: 3 - Alpha",
30+
"Intended Audience :: Developers",
31+
32+
# Specify the Python versions you support here. In particular, ensure
33+
# that you indicate you support Python 3. These classifiers are *not*
34+
# checked by "pip install". See instead "requires-python" key in this file.
35+
"Programming Language :: Python :: 3",
36+
"Programming Language :: Python :: 3.12",
37+
"Programming Language :: Python :: 3.13",
38+
"Programming Language :: Python :: 3.14",
39+
"Programming Language :: Python :: 3 :: Only",
40+
]
41+
42+
dependencies = [
43+
"flatbuffers",
44+
"numpy<2", # Pinned to <2 due to f142 np.unicode
45+
]
46+
47+
[project.optional-dependencies]
48+
dev = [
49+
"ruff>=0.8",
50+
"pyright",
51+
"pytest",
52+
"pytest-cov",
53+
]
54+
55+
[project.urls]
56+
"Homepage" = "https://github.com/isiscomputinggroup/isis_streaming_data_types"
57+
"Bug Reports" = "https://github.com/isiscomputinggroup/isis_streaming_data_types/issues"
58+
"Source" = "https://github.com/isiscomputinggroup/isis_streaming_data_types"
59+
60+
[tool.pytest.ini_options]
61+
testpaths = "tests"
62+
asyncio_mode = "auto"
63+
addopts = "--cov --cov-report=html -vv"
64+
filterwarnings = [
65+
'ignore:FigureCanvasAgg is non-interactive, and thus cannot be shown:UserWarning',
66+
'error:Using UFloat objects with std_dev==0 may give unexpected results.:UserWarning',
67+
]
68+
69+
[tool.coverage.run]
70+
branch = true
71+
source = ["src"]
72+
73+
[tool.coverage.report]
74+
fail_under = 100
75+
exclude_lines = [
76+
"pragma: no cover",
77+
"if TYPE_CHECKING:",
78+
"if typing.TYPE_CHECKING:",
79+
"@abstractmethod",
80+
]
81+
82+
[tool.coverage.html]
83+
directory = "coverage_html_report"
84+
85+
[tool.pyright]
86+
include = ["src", "tests"]
87+
reportConstantRedefinition = true
88+
reportDeprecated = true
89+
reportInconsistentConstructor = true
90+
reportMissingParameterType = true
91+
reportMissingTypeArgument = true
92+
reportUnnecessaryCast = true
93+
reportUnnecessaryComparison = true
94+
reportUnnecessaryContains = true
95+
reportUnnecessaryIsInstance = true
96+
reportUntypedBaseClass = true
97+
reportUntypedClassDecorator = true
98+
reportUntypedFunctionDecorator = true
99+
100+
[tool.setuptools_scm]
101+
version_file = "src/streaming_data_types/_version.py"
102+
103+

requirements-dev.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

requirements.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)