Skip to content

Commit 0932647

Browse files
authored
Merge pull request #2 from mfmceneaney/update_hipopybind_dep
Update hipopybind dependency
2 parents 554ca31 + ae7c227 commit 0932647

15 files changed

Lines changed: 1993 additions & 502 deletions

File tree

.github/workflows/publish.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: Publish to PyPI (Tag Release)
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
tags:
7+
- 'v*' # Runs when a tag like v1.2.3 is pushed
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build_wheels:
14+
name: Build wheels
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
fail-fast: false
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
with:
24+
submodules: recursive
25+
26+
- name: Set up Python
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: "3.13"
30+
31+
- name: Install Poetry
32+
run: |
33+
python -m pip install --upgrade pip
34+
pip install poetry
35+
36+
- name: Configure Poetry
37+
run: poetry config virtualenvs.create true && poetry lock
38+
39+
- name: Install dependencies
40+
run: poetry install --no-interaction --no-root --with dev
41+
42+
- name: Check formatting
43+
run: |
44+
poetry run black --check $(find hipopy/ -name '*.py') $(find tests/ -name '*.py')
45+
poetry run pylint $(find hipopy/ -name '*.py')
46+
47+
- name: Build package wheel
48+
run: |
49+
poetry build
50+
51+
- name: Upload built wheels
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: wheels
55+
path: dist/*.whl
56+
57+
publish_testpypi:
58+
name: Publish to TestPyPI
59+
needs: build_wheels
60+
runs-on: ubuntu-latest
61+
steps:
62+
- name: Checkout repository
63+
uses: actions/checkout@v4
64+
with:
65+
submodules: recursive
66+
67+
- name: Set up Python
68+
uses: actions/setup-python@v5
69+
with:
70+
python-version: "3.13"
71+
72+
- uses: actions/download-artifact@v4
73+
with:
74+
path: dist
75+
- name: Upload to TestPyPI
76+
run: |
77+
pip install --upgrade pip poetry
78+
ls -lrth dist
79+
mkdir -p dist_flat
80+
cp dist/**/*.whl dist_flat/
81+
rm -rf dist
82+
mv dist_flat dist
83+
ls -lrth dist
84+
poetry config repositories.testpypi https://test.pypi.org/legacy/
85+
echo poetry publish -r testpypi -u __token__ -p ${{ secrets.TESTPYPI_API_TOKEN }}
86+
87+
publish:
88+
name: Publish to PyPI
89+
needs: publish_testpypi
90+
runs-on: ubuntu-latest
91+
steps:
92+
- name: Checkout repository
93+
uses: actions/checkout@v4
94+
with:
95+
submodules: recursive
96+
97+
- name: Set up Python
98+
uses: actions/setup-python@v5
99+
with:
100+
python-version: "3.13"
101+
102+
- name: Download distributions
103+
uses: actions/download-artifact@v4
104+
with:
105+
path: dist
106+
107+
- uses: actions/download-artifact@v4
108+
with:
109+
path: dist
110+
- name: Upload to PyPI
111+
run: |
112+
pip install --upgrade pip poetry
113+
mkdir -p dist_flat
114+
cp dist/**/*.whl dist_flat/
115+
rm -rf dist
116+
mv dist_flat dist
117+
ls -lrth dist
118+
echo poetry publish -u __token__ -p ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/python.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Build and Install (Python Matrix)
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
name: python-${{ matrix.python-version }}
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
python-version: ["3.9", "3.10", "3.12", "3.13", "3.14"]
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
submodules: recursive
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
29+
- name: Install Poetry
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install poetry
33+
34+
- name: Configure Poetry
35+
run: poetry config virtualenvs.create true && poetry lock
36+
37+
- name: Install dependencies
38+
run: poetry install --no-interaction --no-root --with dev
39+
40+
- name: Check formatting
41+
run: |
42+
poetry run black --check $(find hipopy/ -name '*.py') $(find tests/ -name '*.py')
43+
poetry run pylint $(find hipopy/ -name '*.py')
44+
45+
- name: Build package wheel
46+
run: |
47+
poetry build
48+
49+
- name: Install package wheel
50+
run: |
51+
ls -lrth dist/
52+
pip install dist/*.whl
53+
54+
- name: Run tests
55+
run: |
56+
poetry run pytest --maxfail=1 --disable-warnings -q

.pylintrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[DESIGN]
2+
max-attributes=15
3+
max-public-methods=40
4+
min-public-methods=1
5+
max-args=8
6+
max-branches=20

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ version: 2
99
build:
1010
os: ubuntu-22.04
1111
tools:
12-
python: "3.10"
12+
python: "3.13"
1313
# You can also specify other tool versions:
1414
# nodejs: "16"
1515
# rust: "1.55"

README.md

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
# HIPOPy: UpROOT-like I/O Interface for CLAS12 HIPO Files
2+
[![PyPI](https://img.shields.io/pypi/v/hipopy.svg)](https://pypi.org/project/hipopy/)
3+
[![Python](https://github.com/mfmceneaney/hipopy/actions/workflows/python.yml/badge.svg)](https://github.com/mfmceneaney/hipopy/actions/workflows/python.yml)
24

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

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

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

15-
(All available with pip.)
13+
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).
1614

17-
## Installation
15+
## :package: Installation
1816

1917
To install with pip:
2018
```bash
@@ -24,18 +22,15 @@ pip install hipopy
2422
To install from source:
2523
```bash
2624
git clone https://github.com/mfmceneaney/hipopy.git
25+
cd hipopy
26+
pip install .
2727
```
2828

29-
Then add to following to your startup script:
30-
```bash
31-
export PYTHONPATH=$PYTHONPATH:/path/to/hipopy
32-
```
33-
34-
## Getting Started
29+
## :rocket: Getting Started
3530

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

38-
## Documentation
33+
## :memo: Documentation
3934

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

docs/source/conf.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
# -- Project information
1010

1111
project = 'Hipopy'
12-
copyright = '2024, Matthew McEneaney'
12+
copyright = '2025, Matthew McEneaney'
1313
author = 'Matthew McEneaney'
1414

15-
release = '1.3'
16-
version = '1.3.6'
15+
release = '2.0'
16+
version = '2.0.0'
1717

1818
# -- General configuration
1919

@@ -23,6 +23,7 @@
2323
'sphinx.ext.autodoc',
2424
'sphinx.ext.autosummary',
2525
'sphinx.ext.intersphinx',
26+
"myst_parser"
2627
]
2728
# autosummary_generate = True # Turn on sphinx.ext.autosummary #NOTE: ADDED
2829

@@ -34,10 +35,16 @@
3435

3536
templates_path = ['_templates']
3637

38+
# myst-parser configuration
39+
myst_enable_extensions = [
40+
"dollarmath",
41+
"amsmath",
42+
]
43+
3744
# -- Options for HTML output
3845

3946
html_theme = 'sphinx_rtd_theme'
40-
html_logo = 'hipopy_logo_1.3.png'
47+
html_logo = 'hipopy_logo_2.0.png'
4148
html_theme_options = {"logo_only": True, "sticky_navigation": False}
4249

4350
# -- Options for EPUB output

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ Contents
1616

1717
.. toctree::
1818

19-
start
19+
readme
2020
examples
2121
api

docs/source/readme.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.. note::
2+
3+
This project is under active development.
4+
5+
.. include:: ../../README.md
6+
:parser: myst_parser.sphinx_

docs/source/start.rst

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

0 commit comments

Comments
 (0)