Skip to content

Commit 69cdf52

Browse files
committed
Convert to use epicscorelibs
1 parent f603e8d commit 69cdf52

22 files changed

+938
-202
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*/_version_git.py export-subst

.gitignore

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
/bin
2-
/dbd
3-
/lib
4-
/db
5-
/docs/html
6-
/pythonIoc
1+
/.vscode
2+
/venv
73
*.pyc
8-
O.*
4+
/docs/html/
5+
/softioc/_extension.*
6+
7+
# Dist build output
8+
/build
9+
/dist
10+
/softioc.egg-info/
11+
12+
# Coverage reports
13+
.coverage
14+
cov.xml
915

1016
/docs/papers/*/*.aux
1117
/docs/papers/*/*.pdf

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "iocStats"]
2+
path = softioc/iocStats
3+
url = https://github.com/epics-modules/iocStats.git

Pipfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[[source]]
2+
name = "pypi"
3+
url = "https://pypi.org/simple"
4+
verify_ssl = true
5+
6+
[dev-packages]
7+
pytest-cov = "*"
8+
pytest-flake8 = "*"
9+
sphinx-rtd-theme = "*"
10+
# switch to main repo after PR https://github.com/Holzhaus/sphinx-multiversion/pull/60 is merged
11+
sphinx-multiversion = {editable = true,git = "https://github.com/dls-controls/sphinx-multiversion.git",ref = "only-arg"}
12+
setuptools-dso = "*"
13+
14+
[packages]
15+
# All other package requirements from setup.py
16+
softioc = {editable = true,path = "."}
17+
18+
[scripts]
19+
# Put coverage here so we don't interfere with debugging in the IDE
20+
tests = "python -m pytest --cov=epicsdbbuilder --cov-report term"
21+
docs = "sphinx-build -EWT --keep-going docs build/html"
22+
clean = "rm -rf build prefix */__pycache__ .coverage cov.xml *.egg-info .mypy_cache .pytest_cache"

Pipfile.lock

Lines changed: 491 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

epicscorelibs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/home/tom/.local/share/virtualenvs/pythonIoc-_YBBu27A/lib/python3.8/site-packages/epicscorelibs

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["setuptools", "wheel", "setuptools_dso", "epicscorelibs>=7.0.4.99.0.0a1"]
3+
build-backend = "setuptools.build_meta"

pythonIoc.in

Lines changed: 0 additions & 41 deletions
This file was deleted.

setup.cfg

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
[metadata]
2+
name = softioc
3+
description = EPICS IOC with Python Device Support
4+
url = https://github.com/dls-controls/pythonIoc
5+
author = Michael Abbott
6+
author_email = Michael.Abbott@diamond.ac.uk
7+
license = Apache License 2.0
8+
long_description = file: README.rst
9+
long_description_content_type = text/x-rst
10+
classifiers =
11+
Development Status :: 5 - Production/Stable
12+
License :: OSI Approved :: Apache Software License
13+
Programming Language :: Python :: 2.7
14+
Programming Language :: Python :: 3.6
15+
Programming Language :: Python :: 3.7
16+
Programming Language :: Python :: 3.8
17+
18+
[options]
19+
packages = find:
20+
21+
[options.packages.find]
22+
# Don't include our test directory in the distribution
23+
exclude = tests
24+
25+
[options.entry_points]
26+
# Include a command line script
27+
console_scripts =
28+
pythonIoc = softioc.__main__:main
29+
30+
[options.package_data]
31+
softioc =
32+
softioc/access.acf
33+
softioc/device.dbd
34+
softioc/iocStats/devIocStats/src/devIocStats.dbd
35+
softioc/iocStats/iocAdmin/Db/*.template
36+
37+
[flake8]
38+
max-line-length = 80
39+
extend-ignore =
40+
F401 F403 F405 # Allow from module import *
41+
E251 # Allow call(param = value)
42+
E301 E302 E303 E305 # Allow any number of blank lines
43+
44+
[tool:pytest]
45+
# Run pytest with all our checkers, and don't spam us with massive tracebacks on error
46+
addopts = --tb=native -vv --flake8 --doctest-modules
47+
48+
[coverage:run]
49+
# This is covered in the versiongit test suite so exclude it here
50+
omit = */_version_git.py

setup.py

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
import os
2+
import sys
3+
4+
from setuptools.command.develop import develop
5+
import epicscorelibs.path
6+
import epicscorelibs.version
7+
from setuptools_dso import DSO, Extension, setup
8+
from epicscorelibs.config import get_config_var
9+
10+
# Place the directory containing _version_git on the path
11+
for path, _, filenames in os.walk(os.path.dirname(os.path.abspath(__file__))):
12+
if "_version_git.py" in filenames:
13+
sys.path.append(path)
14+
break
15+
16+
from _version_git import __version__, get_cmdclass # noqa
17+
18+
devIocStats_OSI = [
19+
"devIocStatsAnalog.c",
20+
"devIocStatsString.c",
21+
"devIocStatsWaveform.c",
22+
"devIocStatsSub.c",
23+
"devIocStatsTest.c"
24+
]
25+
26+
devIocStats_OSD = [
27+
"osdCpuUsage.c",
28+
"osdCpuUtilization.c",
29+
"osdFdUsage.c",
30+
"osdMemUsage.c",
31+
"osdWorkspaceUsage.c",
32+
"osdClustInfo.c",
33+
"osdSuspTasks.c",
34+
"osdIFErrors.c",
35+
"osdBootInfo.c",
36+
"osdSystemInfo.c",
37+
"osdHostInfo.c",
38+
"osdPIDInfo.c",
39+
]
40+
41+
devIocStats_srcs = []
42+
devIocStats_src = os.path.join("softioc", "iocStats", "devIocStats")
43+
devIocStats_default = os.path.join(devIocStats_src, "os", "default")
44+
devIocStats_os = os.path.join(devIocStats_src, "os", get_config_var('OS_CLASS'))
45+
46+
for f in devIocStats_OSI:
47+
devIocStats_srcs.append(os.path.join(devIocStats_src, f))
48+
for f in devIocStats_OSD:
49+
if os.path.exists(os.path.join(devIocStats_os, f)):
50+
devIocStats_srcs.append(os.path.join(devIocStats_os, f))
51+
else:
52+
devIocStats_srcs.append(os.path.join(devIocStats_default, f))
53+
54+
#dso = DSO(
55+
# 'softioc.lib.devIocStats',
56+
# devIocStats_srcs,
57+
# include_dirs=[epicscorelibs.path.include_path, devIocStats_src, devIocStats_os, devIocStats_default],
58+
# dsos=['epicscorelibs.lib.Com']
59+
#)
60+
61+
# Extension with all our C code
62+
ext = Extension(
63+
name='softioc._extension',
64+
sources = ['softioc/extension.c'] + devIocStats_srcs,
65+
include_dirs=[epicscorelibs.path.include_path, devIocStats_src, devIocStats_os, devIocStats_default],
66+
dsos = ['epicscorelibs.lib.dbCore', 'epicscorelibs.lib.Com'],
67+
define_macros = get_config_var('CPPFLAGS'),
68+
extra_compile_args = get_config_var('CXXFLAGS'),
69+
extra_link_args = get_config_var('LDFLAGS'),
70+
)
71+
72+
# Add custom develop to add soft link to epicscorelibs in .
73+
class Develop(develop):
74+
def install_for_development(self):
75+
develop.install_for_development(self)
76+
# Make a link here to epicscorelibs so `pip install -e .` works
77+
# If we don't do this dbCore can't be found when _extension is
78+
# built into .
79+
link = os.path.join(self.egg_path, "epicscorelibs")
80+
if not os.path.exists(link):
81+
os.symlink(os.path.join(self.install_dir, "epicscorelibs"), link)
82+
83+
setup(
84+
cmdclass=dict(develop=Develop, **get_cmdclass()),
85+
version=__version__,
86+
ext_modules = [ext],
87+
install_requires = [
88+
"epicscorelibs==7.0.4.99.0.0a1",
89+
#epicscorelibs.version.abi_requires(),
90+
"numpy>=1.18",
91+
"epicsdbbuilder>=1.4"
92+
],
93+
#x_dsos = [dso],
94+
zip_safe = False, # setuptools_dso is not compatible with eggs!
95+
)

0 commit comments

Comments
 (0)