Skip to content
Open
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
22 changes: 13 additions & 9 deletions .github/workflows/pypi_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
host-os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12", "3.13"]
openmp: ["off"]
fail-fast: false

Expand All @@ -26,7 +26,7 @@ jobs:
shell: bash -l {0}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set OpenMP mode
if: matrix.openmp == 'on'
Expand All @@ -40,7 +40,7 @@ jobs:
export MACOSX_DEPLOYMENT_TARGET="10.15"
echo "MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET}" >> $GITHUB_ENV

- uses: conda-incubator/setup-miniconda@v2
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: testenv
allow-softlinks: true
Expand Down Expand Up @@ -84,6 +84,7 @@ jobs:
set -vxeuo pipefail
python -m pip install --upgrade pip
python -m pip install cibuildwheel
python -m pip install packaging
echo "CIBW_BEFORE_ALL=pip install cmake" >> $GITHUB_ENV
PYTH_VER=${{ matrix.python-version }}
PYTH_VER=${PYTH_VER//.}
Expand All @@ -103,15 +104,17 @@ jobs:
set -vxeuo pipefail
cd env/python
python -VV
python -m pip install packaging
python -m pip install setuptools
python setup.py bdist_wheel
ls -la dist/*
mkdir -p ../../dist
cp dist/*.whl ../../dist/

- name: Publish wheels to GitHub artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
name: srwpy-${{ matrix.host-os }}-Py_${{ matrix.python-version }}-OpenMP_${{ matrix.openmp }}
path: dist/*

- name: Install the package and test requirements
Expand Down Expand Up @@ -146,15 +149,16 @@ jobs:
id-token: write

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Download wheels from GitHub artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: wheels
path: dist/
merge-multiple: true

- name: Publish wheels to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ./dist/
repository-url: https://test.pypi.org/legacy/
packages-dir: ./dist/
3 changes: 3 additions & 0 deletions cpp/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ add_library(genesis OBJECT ${genesis_source_files})
target_link_libraries(genesis genmath)
target_include_directories(genesis PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../src/ext/genesis/genesis_july08/)
target_compile_definitions(genesis PRIVATE ${SRW_DEFINITIONS})
if(UNIX)
target_compile_options(genesis PRIVATE -std=c99 -Wno-implicit-int)
endif()

#genmath
set(genmath_source_files
Expand Down
2 changes: 1 addition & 1 deletion cpp/gcc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ PRG= libsrw.a
$(CXX) $(CFLAGS) -c $<

%.o: $(SRW_SRC_GENESIS_DIR)/%.c
$(CC) $(CFLAGS) -c $<
$(CC) $(CFLAGS) -c $< -std=c99 -Wno-implicit-int

# HG30112023
ifeq ($(MODE), cuda)
Expand Down
4 changes: 4 additions & 0 deletions cpp/src/clients/python/srwlpy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3515,7 +3515,11 @@ void ParseDeviceParam(PyObject* oDev, double* &parGPUParam) //HG10202021 Convert
if(PyLong_Check(oDev)) {
parGPUParam = new double[2]; //HG08022024
parGPUParam[0] = 1; //OC: The number of parameters?
#if PY_MAJOR_VERSION >=3 && PY_MINOR_VERSION >= 13 //HG16062025
parGPUParam[1] = (double)PyLong_AsInt(oDev);
#else
parGPUParam[1] = (double)_PyLong_AsInt(oDev);
#endif
return;
}
}
Expand Down
2 changes: 1 addition & 1 deletion env/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def build_extension(self, ext):
requirements = [line for line in requirements_file.read().splitlines()
if not line.startswith('#')]

setup(name='srwpy',
setup(name='srwpy-hgtest00',
version='4.1.0', #'4.0.0b1',
description='This is SRW for Python',
author='O. Chubar et al.',
Expand Down
2 changes: 1 addition & 1 deletion env/python/srwpy/srwl_uti_smp_rnd_obj2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import random #OC01082020
import numpy as np

from skimage.draw import polygon, circle, ellipse
from skimage.draw import polygon, ellipse

# ********************** Get the distance between point jj and the other points
def get_r1j( px, py, jj):
Expand Down
5 changes: 4 additions & 1 deletion env/python/srwpy/uti_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ def uti_plot_init(backend=DEFAULT_BACKEND, fname_format=None):
global _backend
if backend is not None:
try:
import uti_plot_matplotlib
try:
from . import uti_plot_matplotlib
except:
import uti_plot_matplotlib
_backend = uti_plot_matplotlib.Backend(backend, fname_format)
return
except:
Expand Down