Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Add Packaging #2

Merged
merged 9 commits into from
Nov 18, 2024
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
43 changes: 37 additions & 6 deletions .github/workflows/wipac-cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,26 @@ on:

jobs:

###########################################################################
# PACKAGING
###########################################################################

py-setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- uses: WIPACrepo/[email protected]
with:
python_min: 3.9
pypi_name: icecube-simprod-histograms
author: IceCube
author_email: [email protected]
keywords: |
"histogram sampling" simulation statistics


###########################################################################
# LINTERS
###########################################################################
Expand Down Expand Up @@ -90,7 +110,7 @@ jobs:
with:
python-version: ${{ matrix.py3 }}
- run: |
pip install -r requirements-tests.txt
pip install .[tests]
- name: Run unit tests
run: |
pytest -vvv tests/unit/
Expand All @@ -101,14 +121,25 @@ jobs:

release:
if: github.ref == 'refs/heads/main'
needs: [ flake8, mypy, code-format, unit-tests ]
needs: [ py-setup, flake8, mypy, code-format, unit-tests ]
runs-on: ubuntu-latest
concurrency: release # prevent any possible race conditions
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Python Semantic Release
uses: python-semantic-release/[email protected]
# Python-Package Version Bump
- uses: python-semantic-release/[email protected]
id: psr-psr
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# PyPI Release
- uses: pypa/[email protected]
if: steps.psr-psr.outputs.released == 'true'
with:
password: ${{ secrets.PYPI_TOKEN }}
# GitHub Release
- uses: python-semantic-release/[email protected]
if: steps.psr-psr.outputs.released == 'true'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
<!--- Top of README Badges (automated) --->
[![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)
<!--- End of README Badges (automated) --->
# simprod-histogram
Utilities for working with histograms created for simprod
48 changes: 48 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
version = "0.0.0"
dependencies = ["h5py"]
name = "icecube-simprod-histograms"
description = "Utilities for working with histograms created for simprod"
readme = "README.md"
keywords = ["histogram sampling", "simulation", "statistics"]
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"]
requires-python = ">=3.9, <3.14"

[[project.authors]]
name = "IceCube"
email = "[email protected]"

[project.license]
file = "LICENSE"

[project.optional-dependencies]
tests = ["h5py", "pytest", "matplotlib"]
mypy = ["h5py", "pytest", "matplotlib"]
display = ["h5py", "matplotlib"]

[project.urls]
Homepage = "https://pypi.org/project/icecube-simprod-histograms/"
Tracker = "https://github.com/icecube/simprod-histogram/issues"
Source = "https://github.com/icecube/simprod-histogram"

[tool.semantic_release]
version_toml = ["pyproject.toml:project.version"]
version_variables = []
commit_parser = "emoji"
build_command = "pip install build && python -m build"

[tool.semantic_release.commit_parser_options]
major_tags = ["[major]"]
minor_tags = ["[minor]", "[feature]"]
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", "{", "|", "}", "~"]

[tool.setuptools.package-data]
"*" = ["py.typed"]

[tool.setuptools.packages.find]
namespaces = false
exclude = ["test", "tests", "doc", "docs", "resource", "resources", "example", "examples"]
2 changes: 0 additions & 2 deletions requirements-display.txt

This file was deleted.

3 changes: 0 additions & 3 deletions requirements-tests.txt

This file was deleted.

1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

Empty file added scripts/py.typed
Empty file.
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from setuptools import setup # type: ignore[import]

setup()
Loading