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
118 changes: 118 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: Publish to PyPI (Tag Release)

on:
push:
branches: ["main"]
tags:
- 'v*' # Runs when a tag like v1.2.3 is pushed

permissions:
contents: read

jobs:
build_wheels:
name: Build wheels
runs-on: ubuntu-latest

strategy:
fail-fast: false

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Install Poetry
run: |
python -m pip install --upgrade pip
pip install poetry

- name: Configure Poetry
run: poetry config virtualenvs.create true && poetry lock

- name: Install dependencies
run: poetry install --no-interaction --no-root --with dev

- name: Check formatting
run: |
poetry run black --check $(find hipopy/ -name '*.py') $(find tests/ -name '*.py')
poetry run pylint $(find hipopy/ -name '*.py')

- name: Build package wheel
run: |
poetry build

- name: Upload built wheels
uses: actions/upload-artifact@v4
with:
name: wheels
path: dist/*.whl

publish_testpypi:
name: Publish to TestPyPI
needs: build_wheels
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"

- uses: actions/download-artifact@v4
with:
path: dist
- name: Upload to TestPyPI
run: |
pip install --upgrade pip poetry
ls -lrth dist
mkdir -p dist_flat
cp dist/**/*.whl dist_flat/
rm -rf dist
mv dist_flat dist
ls -lrth dist
poetry config repositories.testpypi https://test.pypi.org/legacy/
echo poetry publish -r testpypi -u __token__ -p ${{ secrets.TESTPYPI_API_TOKEN }}

publish:
name: Publish to PyPI
needs: publish_testpypi
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Download distributions
uses: actions/download-artifact@v4
with:
path: dist

- uses: actions/download-artifact@v4
with:
path: dist
- name: Upload to PyPI
run: |
pip install --upgrade pip poetry
mkdir -p dist_flat
cp dist/**/*.whl dist_flat/
rm -rf dist
mv dist_flat dist
ls -lrth dist
echo poetry publish -u __token__ -p ${{ secrets.PYPI_API_TOKEN }}
56 changes: 56 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build and Install (Python Matrix)

on:
push:
branches: [ main ]
pull_request:

jobs:
test:
name: python-${{ matrix.python-version }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.12", "3.13", "3.14"]

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

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

- name: Install Poetry
run: |
python -m pip install --upgrade pip
pip install poetry

- name: Configure Poetry
run: poetry config virtualenvs.create true && poetry lock

- name: Install dependencies
run: poetry install --no-interaction --no-root --with dev

- name: Check formatting
run: |
poetry run black --check $(find hipopy/ -name '*.py') $(find tests/ -name '*.py')
poetry run pylint $(find hipopy/ -name '*.py')

- name: Build package wheel
run: |
poetry build

- name: Install package wheel
run: |
ls -lrth dist/
pip install dist/*.whl

- name: Run tests
run: |
poetry run pytest --maxfail=1 --disable-warnings -q
6 changes: 6 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[DESIGN]
max-attributes=15
max-public-methods=40
min-public-methods=1
max-args=8
max-branches=20
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.10"
python: "3.13"
# You can also specify other tool versions:
# nodejs: "16"
# rust: "1.55"
Expand Down
31 changes: 13 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
# HIPOPy: UpROOT-like I/O Interface for CLAS12 HIPO Files
[![PyPI](https://img.shields.io/pypi/v/hipopy.svg)](https://pypi.org/project/hipopy/)
[![Python](https://github.com/mfmceneaney/hipopy/actions/workflows/python.yml/badge.svg)](https://github.com/mfmceneaney/hipopy/actions/workflows/python.yml)

## Prerequisites
This package provides an easy python interface for interacting with data stored in CLAS12 [hipo](https://github.com/gavalian/hipo.git) files.

* Python >=3.7.3
* A compiler with C++11 support
* Pip 10+ or CMake >= 3.4 (or 3.14+ on Windows, which was the first version to support VS 2019)
* Ninja or Pip 10+
## :toolbox: Prerequisites

You will also need to install the project dependencies:
* [numpy](https://numpy.org)
* [awkward](https://awkward-array.readthedocs.io/en/latest/)
* [hipopybind](https://github.com/mfmceneaney/hipopybind.git)
* python>=3.9
* compiler with C++17 support
* pip

(All available with pip.)
If you are installing from source *without a package manager* you will also need to install the project dependencies listed in [pyproject.toml](pyproject.toml).

## Installation
## :package: Installation

To install with pip:
```bash
Expand All @@ -24,18 +22,15 @@ pip install hipopy
To install from source:
```bash
git clone https://github.com/mfmceneaney/hipopy.git
cd hipopy
pip install .
```

Then add to following to your startup script:
```bash
export PYTHONPATH=$PYTHONPATH:/path/to/hipopy
```

## Getting Started
## :rocket: Getting Started

Check out the example scripts in `tutorials`. More functionality coming soon!

## Documentation
## :memo: Documentation

Full documentation available on [Read the Docs](https://hipopy.readthedocs.io/en/latest/index.html)!

Expand Down
15 changes: 11 additions & 4 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
# -- Project information

project = 'Hipopy'
copyright = '2024, Matthew McEneaney'
copyright = '2025, Matthew McEneaney'
author = 'Matthew McEneaney'

release = '1.3'
version = '1.3.6'
release = '2.0'
version = '2.0.0'

# -- General configuration

Expand All @@ -23,6 +23,7 @@
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.intersphinx',
"myst_parser"
]
# autosummary_generate = True # Turn on sphinx.ext.autosummary #NOTE: ADDED

Expand All @@ -34,10 +35,16 @@

templates_path = ['_templates']

# myst-parser configuration
myst_enable_extensions = [
"dollarmath",
"amsmath",
]

# -- Options for HTML output

html_theme = 'sphinx_rtd_theme'
html_logo = 'hipopy_logo_1.3.png'
html_logo = 'hipopy_logo_2.0.png'
html_theme_options = {"logo_only": True, "sticky_navigation": False}

# -- Options for EPUB output
Expand Down
File renamed without changes
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ Contents

.. toctree::

start
readme
examples
api
6 changes: 6 additions & 0 deletions docs/source/readme.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. note::

This project is under active development.

.. include:: ../../README.md
:parser: myst_parser.sphinx_
33 changes: 0 additions & 33 deletions docs/source/start.rst

This file was deleted.

4 changes: 3 additions & 1 deletion hipopy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# pylint: disable=redefined-builtin

"""
Hipopy - Python library for reading CLAS12 HIPO files
"""

__version__ = '1.3.6'
__version__ = "2.0.0"

from .hipopy import *
Loading