diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index f159153..edd7ca7 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -54,6 +54,15 @@ jobs: name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} path: ./wheelhouse/*.whl + - uses: actions/setup-python@v5 + with: + python-version: 3.12 + + - name: Install twine + run: | + python -m pip install --upgrade pip + python -m pip install twine build + - name: PyPI deployment env: TWINE_USERNAME: __token__ @@ -63,4 +72,4 @@ jobs: echo "# No PYPI_TOKEN secret in job!" | tee -a "$GITHUB_STEP_SUMMARY" exit 1 fi - twine upload --verbose dist/* + twine upload --verbose ./wheelhouse/*.whl diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index 88d2761..4d98c40 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -55,9 +55,9 @@ about: description: | PyCA (Python Channel Access) is a module that offers lightweight bindings for Python applications to access EPICS PVs. It acts as - a channel access client, much like pyepics. The intention of the + a channel access client, much like pyepics. The intention of the module is to provide better performance for embedded applications, rather than to provide an interactive interface. The most significant gains will be found when monitoring large waveforms that need to be - processed before exposing them the Python layer. + processed before exposing them the Python layer. dev_url: https://github.com/slaclab/pyca diff --git a/dev-requirements.txt b/dev-requirements.txt index 1f73203..d59e27f 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,2 +1,2 @@ pcaspy -pytest \ No newline at end of file +pytest diff --git a/pyca/getfunctions.hh b/pyca/getfunctions.hh index 211fe31..72d30cc 100644 --- a/pyca/getfunctions.hh +++ b/pyca/getfunctions.hh @@ -108,7 +108,7 @@ PyObject* _pyca_get_value(capv* pv, const T* dbrv, long count) npy_intp dims[1] = {count}; int typenum = _numpy_array_type(&(dbrv->value)); PyObject* nparray = PyArray_EMPTY(1, dims, typenum, 0); - PyArrayObject *arr = (PyArrayObject *)PyArray_FROM_O(nparray); + PyArrayObject *arr = (PyArrayObject *)PyArray_FROM_O(nparray); memcpy(PyArray_DATA(arr), &(dbrv->value), count*sizeof(dbrv->value)); return nparray; } else { diff --git a/pyca/putfunctions.hh b/pyca/putfunctions.hh index 72c30d6..44eae30 100644 --- a/pyca/putfunctions.hh +++ b/pyca/putfunctions.hh @@ -66,7 +66,7 @@ void _pyca_put_value(capv* pv, PyObject* pyvalue, T** buf, long count) _pyca_put(pyval, buffer); } else if (PyArray_Check(pyvalue)) { // Convert to array - PyArrayObject *arr = (PyArrayObject *)PyArray_FROM_O(pyvalue); + PyArrayObject *arr = (PyArrayObject *)PyArray_FROM_O(pyvalue); char* npdata = static_cast(PyArray_GETPTR1(arr, 0)); if (PyArray_IsPythonScalar(pyvalue)) { PyObject* pyval = PyArray_GETITEM(arr, npdata); @@ -88,7 +88,7 @@ void _pyca_put_value(capv* pv, PyObject* pyvalue, T** buf, long count) _pyca_put(pyval, buffer+i); } } else if (PyArray_Check(pyvalue)) { - PyArrayObject *arr2 = (PyArrayObject *)PyArray_FROM_O(pyvalue); + PyArrayObject *arr2 = (PyArrayObject *)PyArray_FROM_O(pyvalue); bool py_type = PyArray_IsPythonScalar(arr2); for (long i=0; i(PyArray_GETPTR1(arr2, i)); diff --git a/scripts/get_library_paths.py b/scripts/get_library_paths.py index 8361afe..cb06240 100644 --- a/scripts/get_library_paths.py +++ b/scripts/get_library_paths.py @@ -8,4 +8,4 @@ def get_library_paths(): if __name__ == "__main__": - get_library_paths() \ No newline at end of file + get_library_paths() diff --git a/setup.py b/setup.py index 354eb9a..d50eb0a 100644 --- a/setup.py +++ b/setup.py @@ -1,22 +1,22 @@ +import platform import sys +import epicscorelibs.path +import epicscorelibs.version import numpy -import platform +from epicscorelibs.config import get_config_var +from numpy import get_include from setuptools_dso import Extension, setup -from numpy import get_include + def get_numpy_include_dirs(): return [get_include()] -import epicscorelibs.path -import epicscorelibs.version -from epicscorelibs.config import get_config_var - extra = [] -if sys.platform=='linux2': +if sys.platform == 'linux2': extra += ['-v'] -elif platform.system()=='Darwin': +elif platform.system() == 'Darwin': # avoid later failure where install_name_tool may run out of space. # install_name_tool: changing install names or rpaths can't be redone for: # ... because larger updated load commands do not fit (the program must be relinked, @@ -27,12 +27,13 @@ def get_numpy_include_dirs(): pyca = Extension( name='pyca', sources=['pyca/pyca.cc'], - include_dirs= get_numpy_include_dirs()+[epicscorelibs.path.include_path], - define_macros = get_config_var('CPPFLAGS'), - extra_compile_args = get_config_var('CXXFLAGS'), - extra_link_args = get_config_var('LDFLAGS')+extra, - dsos = ['epicscorelibs.lib.ca', - 'epicscorelibs.lib.Com' + include_dirs=get_numpy_include_dirs() + [epicscorelibs.path.include_path], + define_macros=get_config_var('CPPFLAGS'), + extra_compile_args=get_config_var('CXXFLAGS'), + extra_link_args=get_config_var('LDFLAGS') + extra, + dsos=[ + 'epicscorelibs.lib.ca', + 'epicscorelibs.lib.Com' ], libraries=get_config_var('LDADD'), ) @@ -42,9 +43,9 @@ def get_numpy_include_dirs(): description='python channel access library', packages=['psp', 'pyca'], ext_modules=[pyca], - install_requires = [ + install_requires=[ epicscorelibs.version.abi_requires(), - 'numpy >=%s'%numpy.version.short_version, + 'numpy >=%s' % numpy.version.short_version, ], zip_safe=False, )