diff --git a/.github/workflows/capi.yaml b/.github/workflows/capi.yaml index 4d15a0ad..1d70c36b 100644 --- a/.github/workflows/capi.yaml +++ b/.github/workflows/capi.yaml @@ -2,6 +2,8 @@ name: CAPI on: push: + branches-ignore: + - pycli jobs: capi: diff --git a/.github/workflows/cli-wheels-windows.yml b/.github/workflows/cli-wheels-windows.yml new file mode 100644 index 00000000..52655c73 --- /dev/null +++ b/.github/workflows/cli-wheels-windows.yml @@ -0,0 +1,74 @@ +name: Generate CLI wheels for Windows + +# this workflow doesn't do (yet) what it promises; we keep this file to not lose the progress + +on: + workflow_dispatch: + +jobs: + cli-wheels-windows: + runs-on: windows-latest + strategy: + matrix: + target: [x64] + defaults: + run: + shell: msys2 {0} + + steps: + - uses: actions/checkout@v4 + - uses: msys2/setup-msys2@v2 + with: + msystem: UCRT64 + update: true + install: >- + git + gcc + make + autoconf + python3 + curl + tar + mingw-w64-ucrt-x86_64-pkg-config + mingw-w64-rust + mingw-w64-python-maturin + - uses: actions/setup-python@v5 + with: + # WARNING: be careful with the ordering - the last version is the + # default one. Apparently maturin doesn't find all Python versions + # when one chooses a PyPy version instead of CPython as default + python-version: | + pypy3.7 + pypy3.8 + pypy3.9 + pypy3.10 + 3.7 + 3.8 + 3.9 + 3.11 + 3.12 + 3.10 + - name: Install LHAPDF + run: | + curl "https://lhapdf.hepforge.org/downloads/?f=LHAPDF-6.5.4.tar.gz" | tar xzf - + cd LHAPDF-6.5.4 + # compiling with Python gives errors, but we also don't need Python + ./configure --disable-python --disable-shared + make -j + make install + # print the path of `pkgconf` + command -v pkg-config + - name: Set pkg-config paths + run: | + # for some reason `pkg-config` isn't properly found by Rust + echo "PKG_CONFIG=$(command -v pkg-config)" >> ${GITHUB_ENV} + echo "PKG_CONFIG_PATH=/ucrt64/lib/pkgconfig:${PKG_CONFIG_PATH}" >> ${GITHUB_ENV} + echo "${PKG_CONFIG_PATH}" + - name: Build wheels + run: + maturin build --release --out dist --find-interpreter --manifest-path pineappl_cli/Cargo.toml --target ${{ matrix.target }} + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: ${{ github.job }}-${{ matrix.target }} + path: dist diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml index 25ef4b9a..c236f28a 100644 --- a/.github/workflows/msrv.yml +++ b/.github/workflows/msrv.yml @@ -2,6 +2,8 @@ name: MSRV on: push: + branches-ignore: + - pycli env: CARGO_TERM_COLOR: always diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index c9ccd8c8..51d2a256 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -2,6 +2,8 @@ name: Python on: push: + branches-ignore: + - pycli jobs: test: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8fa0463c..fd129383 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,55 +7,120 @@ on: workflow_dispatch: env: + # this is make the `gh` binary work GH_TOKEN: ${{ github.token }} jobs: - # create a release on github - create-release: - runs-on: ubuntu-latest - if: "startsWith(github.ref, 'refs/tags/')" - steps: - - uses: actions/checkout@v4 - - name: Create new release - run: | - # remove leading 'v' in tag name - gh release create -d v${GITHUB_REF_NAME#v} + ## create a release on github + #create-release: + # runs-on: ubuntu-latest + # if: "startsWith(github.ref, 'refs/tags/')" + # steps: + # - uses: actions/checkout@v4 + # - name: Create new release + # run: | + # # remove leading 'v' in tag name + # gh release create -d v${GITHUB_REF_NAME#v} - capi-macos: - runs-on: macos-latest - strategy: - matrix: - target: [x86_64-apple-darwin, aarch64-apple-darwin] - steps: - - uses: actions/checkout@v4 - - name: Compile library - run: | - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --target=${{ matrix.target }} - cargo install --locked cargo-c - cd pineappl_capi - cargo cinstall --destdir=prefix --library-type=cdylib --locked --prefix=/ --target=${{ matrix.target }} --verbose - cd prefix - tar czf ../../pineappl_capi-${{ matrix.target }}.tar.gz . - - name: Upload artifact - # as long as we need v3 in `capi-linux` we also must use it here - uses: actions/upload-artifact@v3 - with: - name: pineappl_capi-${{ matrix.target }} - path: pineappl_capi-${{ matrix.target }}.tar.gz + #capi-macos: + # runs-on: macos-latest + # strategy: + # matrix: + # target: [x86_64-apple-darwin, aarch64-apple-darwin] + # steps: + # - uses: actions/checkout@v4 + # - name: Compile library + # run: | + # curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --target=${{ matrix.target }} + # cargo install --locked cargo-c + # cd pineappl_capi + # cargo cinstall --destdir=prefix --library-type=cdylib --locked --prefix=/ --target=${{ matrix.target }} --verbose + # cd prefix + # tar czf ../../pineappl_capi-${{ matrix.target }}.tar.gz . + # - name: Upload artifact + # # as long as we need v3 in `capi-linux` we also must use it here + # uses: actions/upload-artifact@v3 + # with: + # name: pineappl_capi-${{ matrix.target }} + # path: pineappl_capi-${{ matrix.target }}.tar.gz + + #cli-macos: + # strategy: + # matrix: + # include: + # - os: macos-13 + # target: x86_64-apple-darwin + # - os: macos-14 + # # we cannot cross-compile, because we need also all dependencies for the specified target + # target: aarch64-apple-darwin + # runs-on: ${{ matrix.os }} + # steps: + # - uses: actions/checkout@v4 + # - name: Compile binary + # run: | + # brew tap davidchall/hep + # # install LHAPDF + # brew install lhapdf + # # install APPLgrid's dependencies; disable ROOT because its static libraries are missing + # brew install --only-dependencies --without-hoppet --without-lhapdf --without-root applgrid + # # install zlib, which is a dependency of APPLgrid but somehow missing + # brew install zlib + # # APPLgrid wants to be linked against zlib, and we need to find its static library via pkg-config + # export PKG_CONFIG_PATH=$(find $(brew --cellar) -name '*.pc' -exec dirname {} + | sort -u | tr '\n' ':') + # # manually compile APPLgrid, because we need the file `appl_igrid.h` and the files it includes, which are possibly generated + # export HOMEBREW_TEMP="$(pwd)"/tmp + # mkdir -p ${HOMEBREW_TEMP} + # brew install --build-from-source --keep-tmp --without-hoppet --without-lhapdf --without-root applgrid + # export APPL_IGRID_DIR=$(find ${HOMEBREW_TEMP} -name appl_igrid.h -exec dirname {} +) + # # do not link against `gfortran` + # sed 's/-lgfortran//g' $(command -v applgrid-config) > applgrid-config.new + # mv applgrid-config.new $(command -v applgrid-config) + # chmod +x $(command -v applgrid-config) + # # install fastNLO + # brew install --without-fastjet fastnlo + # # install Rust + # curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-host=${{ matrix.target }} + # # build the CLI + # cargo install --all-features --locked --path pineappl_cli --root=prefix --target=${{ matrix.target }} + # # build manpages + # mkdir -p prefix/share/man/man1 + # cargo xtask install-manpages prefix/share/man/man1 + # cd prefix + # tar czf ../pineappl_cli-${{ matrix.target }}.tar.gz . + # - name: Upload artifact + # # as long as we need v3 in `cli-linux` we also must use it here + # uses: actions/upload-artifact@v3 + # with: + # name: pineappl_cli-${{ matrix.target }} + # path: pineappl_cli-${{ matrix.target }}.tar.gz - cli-macos: + cli-wheels-macos: strategy: matrix: include: - os: macos-13 - target: x86_64-apple-darwin + target: x86_64 - os: macos-14 # we cannot cross-compile, because we need also all dependencies for the specified target - target: aarch64-apple-darwin + target: aarch64 runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - name: Compile binary + - uses: actions/setup-python@v5 + with: + # WARNING: be careful with the ordering - the last version is the + # default one. Apparently maturin doesn't find all Python versions + # when one chooses a PyPy version instead of CPython as default + python-version: | + pypy3.8 + pypy3.9 + pypy3.10 + 3.8 + 3.9 + 3.11 + 3.12 + 3.10 + - name: Install dependencies run: | brew tap davidchall/hep # install LHAPDF @@ -65,139 +130,157 @@ jobs: # install zlib, which is a dependency of APPLgrid but somehow missing brew install zlib # APPLgrid wants to be linked against zlib, and we need to find its static library via pkg-config - export PKG_CONFIG_PATH=$(find $(brew --cellar) -name '*.pc' -exec dirname {} + | sort -u | tr '\n' ':') + echo "PKG_CONFIG_PATH=$(find $(brew --cellar) -name '*.pc' -exec dirname {} + | sort -u | tr '\n' ':')" >> ${GITHUB_ENV} # manually compile APPLgrid, because we need the file `appl_igrid.h` and the files it includes, which are possibly generated export HOMEBREW_TEMP="$(pwd)"/tmp mkdir -p ${HOMEBREW_TEMP} brew install --build-from-source --keep-tmp --without-hoppet --without-lhapdf --without-root applgrid - export APPL_IGRID_DIR=$(find ${HOMEBREW_TEMP} -name appl_igrid.h -exec dirname {} +) + echo "APPL_IGRID_DIR=$(find ${HOMEBREW_TEMP} -name appl_igrid.h -exec dirname {} +)" >> ${GITHUB_ENV} # do not link against `gfortran` sed 's/-lgfortran//g' $(command -v applgrid-config) > applgrid-config.new mv applgrid-config.new $(command -v applgrid-config) chmod +x $(command -v applgrid-config) # install fastNLO brew install --without-fastjet fastnlo - # install Rust - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-host=${{ matrix.target }} - # build the CLI - cargo install --all-features --locked --path pineappl_cli --root=prefix --target=${{ matrix.target }} - # build manpages - mkdir -p prefix/share/man/man1 - cargo xtask install-manpages prefix/share/man/man1 - cd prefix - tar czf ../pineappl_cli-${{ matrix.target }}.tar.gz . - - name: Upload artifact - # as long as we need v3 in `cli-linux` we also must use it here - uses: actions/upload-artifact@v3 + - name: Build wheels + uses: PyO3/maturin-action@v1 with: - name: pineappl_cli-${{ matrix.target }} - path: pineappl_cli-${{ matrix.target }}.tar.gz - - capi-linux: - runs-on: ubuntu-latest - container: ghcr.io/nnpdf/pineappl-ci:latest - strategy: - matrix: - target: [x86_64-unknown-linux-gnu] - steps: - # checkout@v4 uses a newer version of Node that's incompatible with our container's GLIBC - - uses: actions/checkout@v3 - - name: Compile library - run: | - cd pineappl_capi - cargo cinstall --destdir=prefix --library-type=cdylib --locked --prefix=/ --target=${{ matrix.target }} --verbose - cd prefix - tar czf ../../pineappl_capi-${{ matrix.target }}.tar.gz . - # print the glibc version requirement - objdump -T lib/libpineappl_capi.so | grep GLIBC | sed 's/.*GLIBC_\([.0-9]*\).*/\1/g' | sort -Vu | tail -1 - - name: Upload artifact - # upload-artifact@v4 uses a newer version of Node that's incompatible with our container's GLIBC - uses: actions/upload-artifact@v3 + target: ${{ matrix.target }} + args: --release --out dist --find-interpreter --manifest-path pineappl_cli/Cargo.toml + sccache: "true" + - name: Upload wheels + uses: actions/upload-artifact@v4 with: - name: pineappl_capi-${{ matrix.target }} - path: pineappl_capi-${{ matrix.target }}.tar.gz + name: ${{ github.job }}-${{ matrix.target }} + path: dist + + #capi-linux: + # runs-on: ubuntu-latest + # container: ghcr.io/nnpdf/pineappl-ci:latest + # strategy: + # matrix: + # target: [x86_64-unknown-linux-gnu] + # steps: + # # checkout@v4 uses a newer version of Node that's incompatible with our container's GLIBC + # - uses: actions/checkout@v3 + # - name: Compile library + # run: | + # cd pineappl_capi + # cargo cinstall --destdir=prefix --library-type=cdylib --locked --prefix=/ --target=${{ matrix.target }} --verbose + # cd prefix + # tar czf ../../pineappl_capi-${{ matrix.target }}.tar.gz . + # # print the glibc version requirement + # objdump -T lib/libpineappl_capi.so | grep GLIBC | sed 's/.*GLIBC_\([.0-9]*\).*/\1/g' | sort -Vu | tail -1 + # - name: Upload artifact + # # upload-artifact@v4 uses a newer version of Node that's incompatible with our container's GLIBC + # uses: actions/upload-artifact@v3 + # with: + # name: pineappl_capi-${{ matrix.target }} + # path: pineappl_capi-${{ matrix.target }}.tar.gz + + #cli-linux: + # runs-on: ubuntu-latest + # container: ghcr.io/nnpdf/pineappl-ci:latest + # strategy: + # matrix: + # target: [x86_64-unknown-linux-gnu] + # steps: + # # checkout@v4 uses a newer version of Node that's incompatible with our container's GLIBC + # - uses: actions/checkout@v3 + # - name: Compile binary + # run: | + # cargo install --all-features --locked --path pineappl_cli --root=prefix --target=${{ matrix.target }} -vv + # # build manpages + # mkdir -p prefix/share/man/man1 + # cargo xtask install-manpages prefix/share/man/man1 + # cd prefix + # tar czf ../pineappl_cli-${{ matrix.target }}.tar.gz . + # # print the dynamically linked libraries + # ldd bin/pineappl + # - name: Upload artifact + # # upload-artifact@v4 uses a newer version of Node that's incompatible with our container's GLIBC + # uses: actions/upload-artifact@v3 + # with: + # name: pineappl_cli-${{ matrix.target }} + # path: pineappl_cli-${{ matrix.target }}.tar.gz - cli-linux: + cli-wheels-linux: runs-on: ubuntu-latest - container: ghcr.io/nnpdf/pineappl-ci:latest strategy: matrix: - target: [x86_64-unknown-linux-gnu] - steps: - # checkout@v4 uses a newer version of Node that's incompatible with our container's GLIBC - - uses: actions/checkout@v3 - - name: Compile binary - run: | - cargo install --all-features --locked --path pineappl_cli --root=prefix --target=${{ matrix.target }} -vv - # build manpages - mkdir -p prefix/share/man/man1 - cargo xtask install-manpages prefix/share/man/man1 - cd prefix - tar czf ../pineappl_cli-${{ matrix.target }}.tar.gz . - # print the dynamically linked libraries - ldd bin/pineappl - - name: Upload artifact - # upload-artifact@v4 uses a newer version of Node that's incompatible with our container's GLIBC - uses: actions/upload-artifact@v3 - with: - name: pineappl_cli-${{ matrix.target }} - path: pineappl_cli-${{ matrix.target }}.tar.gz - - # publish a release on github and upload pre-built CAPI - publish-release: - needs: [capi-macos, cli-macos, capi-linux, cli-linux] - runs-on: ubuntu-latest - if: "startsWith(github.ref, 'refs/tags/')" + target: [x86_64] steps: - uses: actions/checkout@v4 - # version must match the one used in `actions/upload-artifact` - - uses: actions/download-artifact@v3 + - name: Build wheels + uses: PyO3/maturin-action@v1 with: - path: artifacts - - name: Create new release - run: | - # remove leading 'v' in tag name - version=${GITHUB_REF_NAME#v} - prerelease=$(echo ${version} | perl -pe 's/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/\4/') - if [[ ${prerelease} == "" ]]; then - # extract the previous version number - old_version=$(sed -n 's/^## \[\(.*\)\] - .*/\1/p' CHANGELOG.md | tail +2 | head -n 1) - # extract news for the current version from the changelog file, dismissing - # empty lines at the start and the end - news=$(sed -n "/\\[${version}\\]/, /\\[${old_version}\\]/{ /\\[${old_version}\\]/! p }" \ - CHANGELOG.md | sed -e :a -e '/./,$!d;/^\n*$/{$d;N;};/\n$/ba') - gh release edit v${version} -n "${news}" - else - gh release edit v${version} -n "" --prerelease - fi - find artifacts -name 'pineappl*' -type f -exec gh release upload v${version} {} + - gh release edit v${version} --draft=false + target: ${{ matrix.target }} + container: ghcr.io/nnpdf/pineappl-ci:latest + # `--find-interpreter` is needed to generate wheels for *all* Python versions + args: --release --out dist --find-interpreter --manifest-path pineappl_cli/Cargo.toml + sccache: "true" + manylinux: auto + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: ${{ github.job }}-${{ matrix.target }} + path: dist - publish-crates: - runs-on: ubuntu-latest - if: "startsWith(github.ref, 'refs/tags/')" - container: ghcr.io/nnpdf/pineappl-ci:latest - steps: - # checkout@v4 uses a newer version of Node that's incompatible with our container's GLIBC - - uses: actions/checkout@v3 + ## publish a release on github and upload pre-built CAPI + #publish-release: + # needs: [capi-macos, cli-macos, capi-linux, cli-linux] + # runs-on: ubuntu-latest + # if: "startsWith(github.ref, 'refs/tags/')" + # steps: + # - uses: actions/checkout@v4 + # # version must match the one used in `actions/upload-artifact` + # - uses: actions/download-artifact@v3 + # with: + # path: artifacts + # - name: Create new release + # run: | + # # remove leading 'v' in tag name + # version=${GITHUB_REF_NAME#v} + # prerelease=$(echo ${version} | perl -pe 's/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/\4/') + # if [[ ${prerelease} == "" ]]; then + # # extract the previous version number + # old_version=$(sed -n 's/^## \[\(.*\)\] - .*/\1/p' CHANGELOG.md | tail +2 | head -n 1) + # # extract news for the current version from the changelog file, dismissing + # # empty lines at the start and the end + # news=$(sed -n "/\\[${version}\\]/, /\\[${old_version}\\]/{ /\\[${old_version}\\]/! p }" \ + # CHANGELOG.md | sed -e :a -e '/./,$!d;/^\n*$/{$d;N;};/\n$/ba') + # gh release edit v${version} -n "${news}" + # else + # gh release edit v${version} -n "" --prerelease + # fi + # find artifacts -name 'pineappl*' -type f -exec gh release upload v${version} {} + + # gh release edit v${version} --draft=false - - name: Publish all crates - env: - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - run: | - # this must be at least Rust 1.66 to support waiting for dependencies to on crates.io: - # https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-166-2022-12-15 - rustup default stable - cd pineappl - cargo publish - cd ../pineappl_applgrid - cargo publish - cd ../pineappl_fastnlo - cargo publish - cd ../pineappl_capi - cargo publish - cd ../pineappl_cli - cargo publish + #publish-crates: + # runs-on: ubuntu-latest + # if: "startsWith(github.ref, 'refs/tags/')" + # container: ghcr.io/nnpdf/pineappl-ci:latest + # steps: + # # checkout@v4 uses a newer version of Node that's incompatible with our container's GLIBC + # - uses: actions/checkout@v3 + + # - name: Publish all crates + # env: + # CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + # run: | + # # this must be at least Rust 1.66 to support waiting for dependencies to on crates.io: + # # https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-166-2022-12-15 + # rustup default stable + # cd pineappl + # cargo publish + # cd ../pineappl_applgrid + # cargo publish + # cd ../pineappl_fastnlo + # cargo publish + # cd ../pineappl_capi + # cargo publish + # cd ../pineappl_cli + # cargo publish wheels-linux: runs-on: ubuntu-latest @@ -307,14 +390,37 @@ jobs: name: ${{ github.job }}-${{ matrix.target }} path: dist + release-cli-wheels: + runs-on: ubuntu-latest + if: "startsWith(github.ref, 'refs/tags/')" + needs: + - cli-wheels-linux + - cli-wheels-macos + steps: + - uses: actions/download-artifact@v4 + with: + pattern: "cli-wheels-*" + merge-multiple: true + - name: Publish to PyPI + uses: PyO3/maturin-action@v1 + env: + MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN_CLI }} + with: + command: upload + args: --skip-existing * + release-wheels: runs-on: ubuntu-latest if: "startsWith(github.ref, 'refs/tags/')" - needs: [wheels-linux, wheels-macos, wheels-sdist, wheels-windows] + needs: + - wheels-linux + - wheels-macos + - wheels-sdist + - wheels-windows steps: - uses: actions/download-artifact@v4 with: - pattern: wheels-* + pattern: "wheels-*" merge-multiple: true - name: Publish to PyPI uses: PyO3/maturin-action@v1 diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a2751695..17556a0a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -2,6 +2,8 @@ name: Rust on: push: + branches-ignore: + - pycli defaults: run: diff --git a/Cargo.lock b/Cargo.lock index d70e3286..135f934f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1225,7 +1225,7 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pineappl" -version = "0.7.4" +version = "0.8.0-alpha.4" dependencies = [ "anyhow", "arrayvec", @@ -1250,7 +1250,7 @@ dependencies = [ [[package]] name = "pineappl_applgrid" -version = "0.7.4" +version = "0.8.0-alpha.4" dependencies = [ "cc", "cxx", @@ -1261,7 +1261,7 @@ dependencies = [ [[package]] name = "pineappl_capi" -version = "0.7.4" +version = "0.8.0-alpha.4" dependencies = [ "itertools", "pineappl", @@ -1269,7 +1269,7 @@ dependencies = [ [[package]] name = "pineappl_cli" -version = "0.7.4" +version = "0.8.0-alpha.4" dependencies = [ "anyhow", "assert_cmd", @@ -1300,7 +1300,7 @@ dependencies = [ [[package]] name = "pineappl_fastnlo" -version = "0.7.4" +version = "0.8.0-alpha.4" dependencies = [ "cxx", "cxx-build", @@ -1310,7 +1310,7 @@ dependencies = [ [[package]] name = "pineappl_py" -version = "0.7.4" +version = "0.8.0-alpha.4" dependencies = [ "itertools", "ndarray", @@ -2472,7 +2472,7 @@ dependencies = [ [[package]] name = "xtask" -version = "0.7.4" +version = "0.8.0-alpha.4" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index 6aa82170..dab4054c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ keywords = ["high-energy-physics", "physics"] license = "GPL-3.0-or-later" repository = "https://github.com/NNPDF/pineappl" rust-version = "1.70.0" -version = "0.7.4" +version = "0.8.0-alpha.4" [workspace.lints.clippy] all = { level = "warn", priority = -1 } diff --git a/maintainer/make-release.sh b/maintainer/make-release.sh index 12b7feb6..74ce4942 100755 --- a/maintainer/make-release.sh +++ b/maintainer/make-release.sh @@ -19,6 +19,9 @@ features=( fktable ) +main=master +this_branch=$(git rev-parse --abbrev-ref HEAD) + cd .. if [[ $# != 1 ]]; then @@ -28,13 +31,17 @@ fi version=$1 +prerelease=$(echo ${version} | perl -pe 's/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/\4/') + if [[ $(echo ${version} | grep -oP '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$') != ${version} ]]; then echo "Version string incorrect." exit 1 fi -if [[ $(git rev-parse --abbrev-ref HEAD) != master ]]; then - echo "You're not on master." +# in branches that are not master we only allow prereleases +if [[ ${this_branch} != ${main} ]] && [[ ${prerelease} == "" ]]; then + echo "Ordinary releases are only allowed in the '${main}' branch." + echo "If you really want to make a release from '${this_branch}', consider making a prerelease." exit 1 fi @@ -73,8 +80,6 @@ cd .. echo ">>> Updating version strings ..." -prerelease=$(echo ${version} | perl -pe 's/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/\4/') - # we don't want to create a changelog entry for prereleases, which are solely # for internal testing purposes if [[ ${prerelease} == "" ]]; then diff --git a/pineappl_capi/Cargo.toml b/pineappl_capi/Cargo.toml index 864faf21..8d3f47c4 100644 --- a/pineappl_capi/Cargo.toml +++ b/pineappl_capi/Cargo.toml @@ -16,7 +16,7 @@ version.workspace = true workspace = true [dependencies] -pineappl = { path = "../pineappl", version = "=0.7.4" } +pineappl = { path = "../pineappl", version = "=0.8.0-alpha.4" } itertools = "0.10.1" [features] diff --git a/pineappl_cli/Cargo.toml b/pineappl_cli/Cargo.toml index 46172936..fe1d19b9 100644 --- a/pineappl_cli/Cargo.toml +++ b/pineappl_cli/Cargo.toml @@ -30,9 +30,9 @@ lhapdf = { package = "managed-lhapdf", version = "0.3.2" } lz4_flex = { optional = true, version = "0.9.2" } ndarray = "0.15.4" ndarray-npy = { optional = true, version = "0.8.1" } -pineappl = { path = "../pineappl", version = "=0.7.4" } -pineappl_applgrid = { optional = true, path = "../pineappl_applgrid", version = "=0.7.4" } -pineappl_fastnlo = { optional = true, path = "../pineappl_fastnlo", version = "=0.7.4" } +pineappl = { path = "../pineappl", version = "=0.8.0-alpha.4" } +pineappl_applgrid = { optional = true, path = "../pineappl_applgrid", version = "=0.8.0-alpha.4" } +pineappl_fastnlo = { optional = true, path = "../pineappl_fastnlo", version = "=0.8.0-alpha.4" } prettytable-rs = { default-features = false, features = ["win_crlf"], version = "0.10.0" } rayon = "1.5.1" serde = { features = ["derive"], optional = true, version = "1.0.130" } diff --git a/pineappl_cli/pyproject.toml b/pineappl_cli/pyproject.toml new file mode 100644 index 00000000..a5476cc3 --- /dev/null +++ b/pineappl_cli/pyproject.toml @@ -0,0 +1,7 @@ +[build-system] +requires = ["maturin>=1.0,<2.0"] +build-backend = "maturin" + +[tool.maturin] +bindings = "bin" +all-features = true diff --git a/pineappl_py/Cargo.toml b/pineappl_py/Cargo.toml index 5b7f35b6..177daffd 100644 --- a/pineappl_py/Cargo.toml +++ b/pineappl_py/Cargo.toml @@ -30,5 +30,5 @@ crate-type = ["cdylib"] itertools = "0.10.1" ndarray = "0.15.4" numpy = "0.20.0" -pineappl = { path = "../pineappl", version = "=0.7.4" } +pineappl = { path = "../pineappl", version = "=0.8.0-alpha.4" } pyo3 = { features = ["extension-module"], version = "0.20.0" } diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index 8b025b56..aa06a4d5 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -21,4 +21,4 @@ clap_mangen = "0.2.18" enum_dispatch = "0.3.7" #git2 = "0.17.2" #semver = "1.0.17" -pineappl_cli = { path = "../pineappl_cli", version = "=0.7.4" } +pineappl_cli = { path = "../pineappl_cli", version = "=0.8.0-alpha.4" }