-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from tangkong/tst_basic_gha
TST: try standard pcds build test
- Loading branch information
Showing
9 changed files
with
171 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: PCDS Standard Testing | ||
|
||
on: | ||
push: | ||
pull_request: | ||
release: | ||
types: | ||
- created | ||
|
||
jobs: | ||
pre-commit: | ||
name: "pre-commit checks" | ||
uses: pcdshub/pcds-ci-helpers/.github/workflows/pre-commit.yml@master | ||
with: | ||
args: "--all-files" | ||
|
||
conda-test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- python-version: "3.9" | ||
deploy-on-success: true | ||
- python-version: "3.10" | ||
- python-version: "3.11" | ||
experimental: true | ||
- python-version: "3.12" | ||
experimental: true | ||
|
||
name: "Conda" | ||
uses: pcdshub/pcds-ci-helpers/.github/workflows/python-conda-test.yml@master | ||
secrets: inherit | ||
with: | ||
package-name: "pyca" | ||
python-version: ${{ matrix.python-version }} | ||
experimental: ${{ matrix.experimental || false }} | ||
deploy-on-success: ${{ matrix.deploy-on-success || false }} | ||
testing-extras: "" | ||
system-packages: "" | ||
use-setuptools-scm: true | ||
|
||
pip-test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- python-version: "3.9" | ||
deploy-on-success: true | ||
- python-version: "3.10" | ||
- python-version: "3.11" | ||
experimental: true | ||
- python-version: "3.12" | ||
experimental: true | ||
|
||
name: "Pip" | ||
uses: pcdshub/pcds-ci-helpers/.github/workflows/python-pip-test.yml@master | ||
secrets: inherit | ||
with: | ||
package-name: "pyca" | ||
python-version: ${{ matrix.python-version }} | ||
experimental: ${{ matrix.experimental || false }} | ||
deploy-on-success: ${{ matrix.deploy-on-success || false }} | ||
system-packages: "" | ||
testing-extras: "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
pcaspy | ||
pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
numpy | ||
epicscorelibs | ||
numpy>1.23 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,50 @@ | ||
import os | ||
import sys | ||
|
||
import numpy as np | ||
from setuptools import Extension, setup | ||
|
||
if sys.platform == 'darwin': | ||
libsrc = 'Darwin' | ||
compiler = 'clang' | ||
elif sys.platform.startswith('linux'): | ||
libsrc = 'Linux' | ||
compiler = 'gcc' | ||
else: | ||
libsrc = None | ||
|
||
epics_inc = os.getenv("EPICS_BASE") + "/include" | ||
epics_lib = os.getenv("EPICS_BASE") + "/lib/" + os.getenv("EPICS_HOST_ARCH") | ||
numpy_inc = np.get_include() | ||
numpy_lib = np.__path__[0] | ||
|
||
pyca = Extension('pyca', | ||
language='c++', | ||
sources=['pyca/pyca.cc'], | ||
include_dirs=['pyca', epics_inc, | ||
epics_inc + '/os/' + libsrc, | ||
epics_inc + '/compiler/' + compiler, | ||
numpy_inc], | ||
library_dirs=[epics_lib, numpy_lib], | ||
runtime_library_dirs=[epics_lib, numpy_lib], | ||
libraries=['Com', 'ca']) | ||
|
||
setup(ext_modules=[pyca,]) | ||
import numpy | ||
import platform | ||
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': | ||
extra += ['-v'] | ||
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, | ||
# and you may need to use -headerpad or -headerpad_max_install_names) | ||
extra += ['-Wl,-headerpad_max_install_names'] | ||
|
||
|
||
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' | ||
], | ||
libraries=get_config_var('LDADD'), | ||
) | ||
|
||
setup( | ||
name='pyca', | ||
description='python channel access library', | ||
packages=['psp', 'pyca'], | ||
ext_modules=[pyca], | ||
install_requires = [ | ||
epicscorelibs.version.abi_requires(), | ||
'numpy >=%s'%numpy.version.short_version, | ||
], | ||
zip_safe=False, | ||
) |