Skip to content
Merged

Ci #13

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
4 changes: 4 additions & 0 deletions .github/workflows/code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ jobs:
# Put coverage in the output dir mounted in docker
cov_file: /output/coverage.xml
test_requires: cothread pytest-asyncio aioca
# Build an sdist here so it has the right line endings
sdist: true

- os: windows-latest
cov_file: '{project}/dist/coverage.xml'
Expand Down Expand Up @@ -78,6 +80,7 @@ jobs:
run: pip install build cibuildwheel

- name: Build Sdist
if: matrix.sdist
run: python -m build --sdist .

- name: Build Wheel
Expand All @@ -89,6 +92,7 @@ jobs:
# Disable auditwheel as it isn't compatible with setuptools_dso approach
# https://github.com/mdavidsaver/setuptools_dso/issues/17
CIBW_REPAIR_WHEEL_COMMAND: ''
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1

- name: Upload Wheel and Sdist
uses: actions/upload-artifact@v2
Expand Down
8 changes: 2 additions & 6 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,9 @@ pytest-asyncio = "*"

[packages]
# All other package requirements from setup.py
softioc = {editable = true, path = "."}
softioc = {editable = true, extras = ["useful"], path = "."}
# Apart from the epicscorelibs which comes from pyproject.toml so needs to be here too
epicscorelibs = "*"
# Add some other useful extras
cothread = "*"
scipy = "*"
aioca = ">=1.1"
# epicscorelibs = "*"

[scripts]
# Put coverage here so we don't interfere with debugging in the IDE
Expand Down
9 changes: 4 additions & 5 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ softioc =
devIocStats.dbd
iocStatsDb/*

[options.extras_require]
# Useful extras for use at DLS
useful =
cothread
scipy
aioca >=1.1

[flake8]
max-line-length = 80
extend-ignore =
Expand Down
14 changes: 13 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import epicscorelibs.version
from setuptools_dso import Extension, setup
from epicscorelibs.config import get_config_var
from wheel.bdist_wheel import bdist_wheel

# Place the directory containing _version_git on the path
for path, _, filenames in os.walk(os.path.dirname(os.path.abspath(__file__))):
Expand Down Expand Up @@ -89,8 +90,19 @@ def install_for_development(self):
if not os.path.exists(link):
os.symlink(os.path.join(self.install_dir, "epicscorelibs"), link)


class Wheel(bdist_wheel):
def get_tag(self):
impl, abi_tag, plat_name = bdist_wheel.get_tag(self)
# We want to produce manylinux tagged builds, but can't use
# auditwheel as it isn't compatible with setuptools_dso
# override the tag here as cibuildwheel won't let us do this
plat_name = os.environ.get("AUDITWHEEL_PLAT", plat_name)
return (impl, abi_tag, plat_name)


setup(
cmdclass=dict(develop=Develop, **get_cmdclass()),
cmdclass=dict(develop=Develop, bdist_wheel=Wheel, **get_cmdclass()),
version=__version__,
ext_modules = [ext],
install_requires = [
Expand Down
4 changes: 1 addition & 3 deletions tests/test_asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ async def test_asyncio_ioc(asyncio_ioc):
atexit.unregister(_catools._catools_atexit)

# Start
assert await caget(PV_PREFIX + ":UPTIME") in [
"00:00:00", "00:00:01", "00:00:02", "00:00:03"
]
assert (await caget(PV_PREFIX + ":UPTIME")).startswith("00:00:0")
# WAVEFORM
await caput(PV_PREFIX + ":SINN", 4, wait=True)
q = asyncio.Queue()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cothread.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_cothread_ioc(cothread_ioc):
from cothread.catools import ca_nothing, caget, caput, camonitor

# Start
assert caget(PV_PREFIX + ":UPTIME") in ["00:00:00", "00:00:01"]
assert caget(PV_PREFIX + ":UPTIME").startswith("00:00:0")
# WAVEFORM
caput(PV_PREFIX + ":SINN", 4, wait=True)
q = cothread.EventQueue()
Expand Down