From fcb8da54feb0b970a31ee62f649783f3e322f529 Mon Sep 17 00:00:00 2001 From: Hans Dembinski Date: Thu, 1 Sep 2022 14:40:12 +0200 Subject: [PATCH] minor ci improvements and bug-fixes to previous pr (#35) --- .github/workflows/coverage.yml | 9 ++++----- .github/workflows/docs.yml | 2 +- .github/workflows/test.yml | 2 ++ .github/workflows/wheels.yml | 2 +- README.rst | 4 ++-- setup.cfg | 6 +++--- src/core.cpp | 4 +++- 7 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index fc4dfd2..25e0a59 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -7,12 +7,10 @@ on: - '*.rst' - '*.md' push: - branches: - - master - - develop - - beta/* + branch: + - 'main' paths-ignore: - - 'doc/**' + - 'docs/**' - '*.rst' - '*.md' @@ -28,6 +26,7 @@ jobs: - uses: actions/checkout@v2 with: submodules: true + fetch-depth: 3 - uses: actions/setup-python@v2 with: python-version: 3.9 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 1ff70a1..15f294b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/checkout@v2 with: submodules: true - fetch-depth: 3 + fetch-depth: 0 # needed for setuptools_scm - uses: actions/setup-python@v2 with: python-version: "3.9" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3506729..e339f2c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,6 +6,7 @@ on: - 'docs/**' - '*.rst' - '*.md' + workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.head_ref }} @@ -30,6 +31,7 @@ jobs: - uses: actions/checkout@v2 with: submodules: true + fetch-depth: 3 - uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 0a62df1..4d2add9 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -42,7 +42,7 @@ jobs: - uses: actions/checkout@v2 with: submodules: true - fetch-depth: 0 + fetch-depth: 0 # needed by setuptools_scm - uses: pypa/cibuildwheel@v2.3.1 env: diff --git a/README.rst b/README.rst index 67be699..8b8857f 100644 --- a/README.rst +++ b/README.rst @@ -9,8 +9,8 @@ A Pythonic wrapper for the HepMC3 C++ library. .. image:: https://badge.fury.io/py/pyhepmc.svg :target: https://pypi.org/project/pyhepmc -.. image:: https://coveralls.io/repos/github/scikit-hep/pyhepmc/badge.svg - :target: https://coveralls.io/github/scikit-hep/pyhepmc +.. image:: https://coveralls.io/repos/github/scikit-hep/pyhepmc/badge.svg?branch=main + :target: https://coveralls.io/github/scikit-hep/pyhepmc?branch=main .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.7013498.svg :target: https://doi.org/10.5281/zenodo.7013498 diff --git a/setup.cfg b/setup.cfg index 9bd07da..a47c0bf 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,11 +3,11 @@ name = pyhepmc author = Hans Dembinski author_email = hans.dembinski@gmail.com description = Pythonic interface to the HepMC3 C++ library. -long_description = file: README.md -long_description_content_type = text/markdown +long_description = file: README.rst +long_description_content_type = text/x-rst url = https://github.com/scikit-hep/pyhepmc project_urls = - Documentation = https://github.com/scikit-hep/pyhepmc + Documentation = https://scikit-hep.org/pyhepmc/ license_files = LICENSE, extern/pybind11/LICENSE, extern/HepMC3/LICENSE classifiers = Programming Language :: Python :: 3 diff --git a/src/core.cpp b/src/core.cpp index ecb019a..3989e45 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -262,7 +262,9 @@ inline std::ostream& repr(std::ostream& os, const HepMC3::GenEvent& x) { inline int gencrosssection_validate_index(GenCrossSection& cs, py::object obj) { auto idx = py::cast(obj); - const auto size = cs.event() ? (std::max)(cs.event()->weights().size(), 1ul) : 1ul; + const auto size = + cs.event() ? (std::max)(cs.event()->weights().size(), static_cast(1)) + : 1u; if (idx < 0) idx += size; if (idx < 0 || idx >= size) throw py::index_error(); return idx;