Skip to content

Commit

Permalink
Merge pull request #497 from OpenGATE/revert-484-novis
Browse files Browse the repository at this point in the history
Revert "Create an opengate_core wheel whithout visu option"
  • Loading branch information
dsarrut authored Oct 17, 2024
2 parents 3e92e30 + 40852b5 commit aa3d712
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 172 deletions.
36 changes: 0 additions & 36 deletions .github/workflows/Dockerfile_opengate_core_novis

This file was deleted.

16 changes: 0 additions & 16 deletions .github/workflows/createWheelLinux_novis.sh

This file was deleted.

130 changes: 21 additions & 109 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,7 @@ on:
workflow_dispatch:

jobs:
build_opengate_wheel:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: [3.9]
steps:
- name: Checkout github repo
uses: actions/checkout@v4
- name: Checkout submodules
shell: bash -l {0}
run: |
export GIT_SSL_NO_VERIFY=1
git submodule update --init --recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: Create opengate Wheel
run: |
rm -rf $GITHUB_WORKSPACE/opengate/tests/data
cp $GITHUB_WORKSPACE/.git/modules/gam-tests/data/HEAD $GITHUB_WORKSPACE/opengate/tests/
pip install build
python -m build
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: dist-opengate
path: dist/

build_opengate_core_wheel:
build_wheel:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -100,6 +68,16 @@ jobs:
path: ~/software
key: ${{ runner.os }}-${{ steps.get-os-version.outputs.release }}_geant4_${{ env.GEANT4_VERSION }}_itk_${{ env.ITK_VERSION }}_build2
restore-keys: ${{ runner.os }}-${{ steps.get-os-version.outputs.release }}_geant4_${{ env.GEANT4_VERSION }}_itk_${{ env.ITK_VERSION }}_build2
- name: Create opengate Wheel
if: matrix.os == 'ubuntu-latest'
run: |
if [ ${{ matrix.python-version }} == "3.9" ]; then
rm -rf $GITHUB_WORKSPACE/opengate/tests/data
cp $GITHUB_WORKSPACE/.git/modules/gam-tests/data/HEAD $GITHUB_WORKSPACE/opengate/tests/
pip install build
python -m build
mv dist dist_opengate
fi
- name: Create opengate_core Wheel Linux
if: matrix.os == 'ubuntu-latest'
run: |
Expand All @@ -118,6 +96,12 @@ jobs:
rm -rf dist
mv wheelhouse dist
sudo chown -R runner:docker dist
if [ ${{ matrix.python-version }} == "3.9" ]; then
ls -lrt .
ls -lrt dist/
ls -lrt dist_opengate/
mv dist_opengate/* dist/
fi
- uses: conda-incubator/setup-miniconda@v3
if: (matrix.os == 'macos-13') || (matrix.os == 'windows-latest')
with:
Expand Down Expand Up @@ -275,75 +259,12 @@ jobs:
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.os }}-${{ matrix.python-version }}-opengate-core
path: dist/

build_opengate_core_novis_wheel:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: [3.9, '3.10', '3.11', '3.12']

env:
GEANT4_VERSION: 'v11.2.1'
ITK_VERSION: 'v5.2.1'

steps:
- name: Checkout github repo
uses: actions/checkout@v4
- name: Checkout submodules
shell: bash -l {0}
run: |
export GIT_SSL_NO_VERIFY=1
git submodule update --init --recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: Get OS version
id: get-os-version
shell: bash -l {0}
run: |
varOS=`cat /etc/os-release | grep "VERSION=" | grep -oP '(?<=\").*?(?=\")'`
varOS=($varOS)
echo "release=${varOS[0]}" >> $GITHUB_OUTPUT
- name: Cache modules
id: cache_opengate_core_dependencies
uses: actions/cache@v4
with:
path: ~/software
key: ${{ runner.os }}-${{ steps.get-os-version.outputs.release }}_geant4_${{ env.GEANT4_VERSION }}_itk_${{ env.ITK_VERSION }}_build2
restore-keys: ${{ runner.os }}-${{ steps.get-os-version.outputs.release }}_geant4_${{ env.GEANT4_VERSION }}_itk_${{ env.ITK_VERSION }}_build2
- name: Create opengate_core_novis Wheel Linux
run: |
if [ ${{ matrix.python-version }} == "3.9" ]; then
export PYTHONFOLDER="cp39-cp39"
elif [ ${{ matrix.python-version }} == "3.10" ]; then
export PYTHONFOLDER="cp310-cp310"
elif [ ${{ matrix.python-version }} == "3.11" ]; then
export PYTHONFOLDER="cp311-cp311"
elif [ ${{ matrix.python-version }} == "3.12" ]; then
export PYTHONFOLDER="cp312-cp312"
fi
mkdir -p $HOME/software
docker run --rm -e "PYTHONFOLDER=${PYTHONFOLDER}" -v $GITHUB_WORKSPACE:/home tbaudier/opengate_core:${{ env.GEANT4_VERSION }}_novis /home/.github/workflows/createWheelLinux_novis.sh
ls wheelhouse
rm -rf dist
mv wheelhouse dist
sudo chown -R runner:docker dist
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.os }}-${{ matrix.python-version }}-opengate-core-novis
name: dist-${{ matrix.os }}-${{ matrix.python-version }}
path: dist/

publish_wheel:
runs-on: ubuntu-latest
needs: [build_opengate_wheel, build_opengate_core_wheel, build_opengate_core_novis_wheel]
needs: [build_wheel]
steps:
- name: Checkout github repo
uses: actions/checkout@v4
Expand All @@ -354,18 +275,9 @@ jobs:
path: dist/
- name: Separate the wheels
run: |
mkdir dist_opengate_core dist_opengate dist_opengate_core_novis
mv dist/opengate_core_novis-* dist_opengate_core_novis/ || true
mkdir dist_opengate_core dist_opengate
mv dist/opengate_core-* dist_opengate_core/
mv dist/opengate-* dist_opengate/
- name: Publish to PyPI opengate_core_novis
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_OPENGATE_CORE }}
packages_dir: dist_opengate_core_novis/
skip_existing: true
- name: Publish to PyPI opengate_core
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down Expand Up @@ -432,7 +344,7 @@ jobs:

test_wheel:
runs-on: ${{ matrix.os }}
needs: [build_opengate_wheel, build_opengate_core_wheel, build_opengate_core_novis_wheel]
needs: [build_wheel]
strategy:
fail-fast: false
matrix:
Expand Down
7 changes: 0 additions & 7 deletions docs/source/user_guide_1_intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,6 @@ Once installed, we recommend to check the installation by printing GATE informat

The libraries (libG4processes and libG4geometry) are usually found in the Geant4 folder, something like ```~/build-geant4.11.0.2/BuildProducts/lib64```.

### Cluster / no-OpenGL version

For some systems (espacialy clusters or older computers), the main opengate_core cannot be run due to the lack of libGL, or other librairies. For linux system, we offer a version without visualization pro
perties and using older librairies. You can install it with:

pip install --force-reinstall "opengate[novis]"

### Additional command lines tools

There is some additional commands lines tools that can also be used, see the [addons section](user_guide_3_addons.md).
Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ classifiers = [
]
requires-python = ">=3.9"

[project.optional-dependencies]
novis = ["opengate-core-novis"]

[project.scripts]
opengate_tests = "opengate.bin.opengate_tests:go"
opengate_info = "opengate.bin.opengate_info:go"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
setup(
install_requires=[
"colored>1.5",
"opengate-core==" + version,
"opengate_core==" + version,
"gatetools",
"click",
"python-box<7.0.0",
Expand Down

0 comments on commit aa3d712

Please sign in to comment.