Skip to content

Commit ed98647

Browse files
ric-evansgithub-actions
and
github-actions
authored
CI: Add Packaging (#2)
Co-authored-by: github-actions <[email protected]>
1 parent b65eb1c commit ed98647

File tree

8 files changed

+91
-12
lines changed

8 files changed

+91
-12
lines changed

.github/workflows/wipac-cicd.yaml

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,26 @@ on:
99

1010
jobs:
1111

12+
###########################################################################
13+
# PACKAGING
14+
###########################################################################
15+
16+
py-setup:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
22+
- uses: WIPACrepo/[email protected]
23+
with:
24+
python_min: 3.9
25+
pypi_name: icecube-simprod-histograms
26+
author: IceCube
27+
author_email: [email protected]
28+
keywords: |
29+
"histogram sampling" simulation statistics
30+
31+
1232
###########################################################################
1333
# LINTERS
1434
###########################################################################
@@ -90,7 +110,7 @@ jobs:
90110
with:
91111
python-version: ${{ matrix.py3 }}
92112
- run: |
93-
pip install -r requirements-tests.txt
113+
pip install .[tests]
94114
- name: Run unit tests
95115
run: |
96116
pytest -vvv tests/unit/
@@ -101,14 +121,25 @@ jobs:
101121

102122
release:
103123
if: github.ref == 'refs/heads/main'
104-
needs: [ flake8, mypy, code-format, unit-tests ]
124+
needs: [ py-setup, flake8, mypy, code-format, unit-tests ]
105125
runs-on: ubuntu-latest
126+
concurrency: release # prevent any possible race conditions
106127
steps:
107-
- uses: actions/checkout@v3
128+
- uses: actions/checkout@v4
108129
with:
109130
fetch-depth: 0
110-
token: ${{ secrets.GITHUB_TOKEN }}
111-
- name: Python Semantic Release
112-
uses: python-semantic-release/[email protected]
131+
# Python-Package Version Bump
132+
- uses: python-semantic-release/[email protected]
133+
id: psr-psr
134+
with:
135+
github_token: ${{ secrets.GITHUB_TOKEN }}
136+
# PyPI Release
137+
- uses: pypa/[email protected]
138+
if: steps.psr-psr.outputs.released == 'true'
139+
with:
140+
password: ${{ secrets.PYPI_TOKEN }}
141+
# GitHub Release
142+
- uses: python-semantic-release/[email protected]
143+
if: steps.psr-psr.outputs.released == 'true'
113144
with:
114145
github_token: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
<!--- Top of README Badges (automated) --->
2+
[![PyPI](https://img.shields.io/pypi/v/icecube-simprod-histograms)](https://pypi.org/project/icecube-simprod-histograms/) [![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/icecube/simprod-histogram?include_prereleases)](https://github.com/icecube/simprod-histogram/) [![Versions](https://img.shields.io/pypi/pyversions/icecube-simprod-histograms.svg)](https://pypi.org/project/icecube-simprod-histograms) [![PyPI - License](https://img.shields.io/pypi/l/icecube-simprod-histograms)](https://github.com/icecube/simprod-histogram/blob/main/LICENSE) [![GitHub issues](https://img.shields.io/github/issues/icecube/simprod-histogram)](https://github.com/icecube/simprod-histogram/issues?q=is%3Aissue+sort%3Aupdated-desc+is%3Aopen) [![GitHub pull requests](https://img.shields.io/github/issues-pr/icecube/simprod-histogram)](https://github.com/icecube/simprod-histogram/pulls?q=is%3Apr+sort%3Aupdated-desc+is%3Aopen)
3+
<!--- End of README Badges (automated) --->
14
# simprod-histogram
25
Utilities for working with histograms created for simprod

pyproject.toml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
version = "0.0.0"
7+
dependencies = ["h5py"]
8+
name = "icecube-simprod-histograms"
9+
description = "Utilities for working with histograms created for simprod"
10+
readme = "README.md"
11+
keywords = ["histogram sampling", "simulation", "statistics"]
12+
classifiers = ["Development Status :: 3 - Alpha", "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"]
13+
requires-python = ">=3.9, <3.14"
14+
15+
[[project.authors]]
16+
name = "IceCube"
17+
18+
19+
[project.license]
20+
file = "LICENSE"
21+
22+
[project.optional-dependencies]
23+
tests = ["h5py", "pytest", "matplotlib"]
24+
mypy = ["h5py", "pytest", "matplotlib"]
25+
display = ["h5py", "matplotlib"]
26+
27+
[project.urls]
28+
Homepage = "https://pypi.org/project/icecube-simprod-histograms/"
29+
Tracker = "https://github.com/icecube/simprod-histogram/issues"
30+
Source = "https://github.com/icecube/simprod-histogram"
31+
32+
[tool.semantic_release]
33+
version_toml = ["pyproject.toml:project.version"]
34+
version_variables = []
35+
commit_parser = "emoji"
36+
build_command = "pip install build && python -m build"
37+
38+
[tool.semantic_release.commit_parser_options]
39+
major_tags = ["[major]"]
40+
minor_tags = ["[minor]", "[feature]"]
41+
patch_tags = ["[patch]", "[fix]", " ", "!", "#", "$", "%", "&", "'", "(", ")", "*", "+", "-", ".", "/", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ":", ";", "<", "=", ">", "?", "@", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "[", "]", "^", "_", "`", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "{", "|", "}", "~"]
42+
43+
[tool.setuptools.package-data]
44+
"*" = ["py.typed"]
45+
46+
[tool.setuptools.packages.find]
47+
namespaces = false
48+
exclude = ["test", "tests", "doc", "docs", "resource", "resources", "example", "examples"]

requirements-display.txt

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

requirements-tests.txt

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

requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

scripts/py.typed

Whitespace-only changes.

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from setuptools import setup # type: ignore[import]
2+
3+
setup()

0 commit comments

Comments
 (0)