Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*/_version_git.py export-subst
9 changes: 9 additions & 0 deletions .github/pages/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Redirecting to master branch</title>
<meta charset="utf-8">
<meta http-equiv="refresh" content="0; url=./master/index.html">
<link rel="canonical" href="master/index.html">
</head>
</html>
121 changes: 121 additions & 0 deletions .github/workflows/code.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: Code CI

on:
push:
pull_request:

jobs:
lint:
runs-on: "ubuntu-latest"
steps:
- name: Checkout Source
uses: actions/checkout@v2

- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.7'

- name: Install Python Dependencies
run: pip install flake8

- name: Lint
run: flake8

build:
name: ${{ matrix.os }}/${{ matrix.python }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python: [cp27, cp37, cp38, cp39]

exclude:
- os: windows-latest
# No cothread or asyncio so doesn't work
python: cp27

include:
- os: ubuntu-latest
# Put coverage in the output dir mounted in docker
cov_file: /output/coverage.xml
test_requires: cothread pytest-asyncio aioca

- os: windows-latest
cov_file: '{project}/dist/coverage.xml'
# cothread doesn't work on windows
test_requires: pytest-asyncio aioca

- os: macos-latest
cov_file: '{project}/dist/coverage.xml'
test_requires: cothread pytest-asyncio aioca

- os: ubuntu-latest
python: cp27
# asyncio doesn't work on Python2.7
test_requires: cothread

- os: macos-latest
python: cp27
# asyncio doesn't work on Python2.7
test_requires: cothread


steps:
- name: Checkout Source
uses: actions/checkout@v2
with:
submodules: true

- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.7'

- name: Install Python Dependencies
run: pip install twine build cibuildwheel

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

- name: Build Wheel
run: cibuildwheel --output-dir dist
env:
CIBW_BUILD: ${{ matrix.python }}*64
CIBW_TEST_REQUIRES: pytest-cov ${{ matrix.test_requires }}
CIBW_TEST_COMMAND: pytest --cov=softioc {project}/tests --cov-report xml:${{ matrix.cov_file }}
# Disable auditwheel as it isn't compatible with setuptools_dso approach
# https://github.com/mdavidsaver/setuptools_dso/issues/17
CIBW_REPAIR_WHEEL_COMMAND: ''

- name: Upload Wheel and Sdist
uses: actions/upload-artifact@v2
with:
name: dist
path: dist/softioc*

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
name: ${{ matrix.os }}/${{ matrix.python }}
directory: dist

upload_pypi:
needs: [build]
runs-on: ubuntu-latest
# upload to PyPI on every tag
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/download-artifact@v2
with:
name: dist
path: dist

- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.pypi_token }}
run: twine upload dist/*

70 changes: 70 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@

name: Docs CI

on:
push:
pull_request:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Source
uses: actions/checkout@v2
with:
# require all of history to see all tagged versions' docs
fetch-depth: 0
submodules: true

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.7"

- name: Install Packages
# Can delete this if you don't use graphviz in your docs
run: sudo apt-get install graphviz

- name: Install Python Dependencies
run: |
pip install pipenv
pipenv install --dev --deploy --python $(which python) && pipenv graph

- name: Deploy index
# We pin to the SHA, not the tag, for security reasons.
# https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: .github/pages
keep_files: true

- name: Checkout gh-pages
# As we already did a deploy of gh-pages above, it is guaranteed to be there
# so check it out so we can selectively build docs below
uses: actions/checkout@v2
with:
ref: gh-pages
path: build/html

- name: Maybe use sphinx-multiversion
# If we are building master or a tag we will publish
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')
# So use the args we normally pass to sphinx-build, but run sphinx-multiversion
run: mv $(pipenv --venv)/bin/sphinx-multiversion $(pipenv --venv)/bin/sphinx-build

- name: Build Docs
run: pipenv run docs

- name: Publish Docs to gh-pages
# Only master and tags are published
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')
# We pin to the SHA, not the tag, for security reasons.
# https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: build/html
keep_files: true

67 changes: 59 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,67 @@
/bin
/dbd
/lib
/db
/docs/html
/pythonIoc
*.pyc
O.*
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
*.mypy_cache
*.pytest_cache
cov.xml

# DLS build dir and virtual environment
/prefix/
/venv/
/lightweight-venv/
/installed.files

# Docs output
/docs/papers/*/*.aux
/docs/papers/*/*.pdf
/docs/papers/*/*.nav
/docs/papers/*/*.out
/docs/papers/*/*.snm
/docs/papers/*/*.toc
/docs/papers/*/*.vrb

# setup.py develop (via pipenv install) places this link here
# so editable installs work. Related:
# https://github.com/mdavidsaver/setuptools_dso/issues/11
/epicscorelibs
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "iocStats"]
path = iocStats
url = https://github.com/epics-modules/iocStats.git
46 changes: 0 additions & 46 deletions Makefile

This file was deleted.

31 changes: 31 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
pytest-cov = "*"
pytest-flake8 = "*"
sphinx-rtd-theme = "*"
# switch to main repo after PR https://github.com/Holzhaus/sphinx-multiversion/pull/60 is merged
sphinx-multiversion = {editable = true,git = "https://github.com/dls-controls/sphinx-multiversion.git",ref = "only-arg"}
setuptools-dso = "*"
aioca = "*"
pytest-asyncio = "*"

[packages]
# All other package requirements from setup.py
softioc = {editable = true, 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 = "*"

[scripts]
# Put coverage here so we don't interfere with debugging in the IDE
# Put flake8 here so we don't run it during cibuildwheel tests
tests = "python -m pytest --cov=softioc --cov-report term --flake8"
docs = "sphinx-build -EWT --keep-going docs build/html"
gitclean = "git clean -fdX"
Loading