Skip to content

Commit 4fede77

Browse files
committed
Initial commit
0 parents  commit 4fede77

33 files changed

Lines changed: 5272 additions & 0 deletions

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dockerfiles/Dockerfile

.github/workflows/build-test.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Build and Test
2+
3+
on: push
4+
5+
concurrency:
6+
group: "${{ github.ref }}"
7+
cancel-in-progress: true
8+
9+
env:
10+
NDIP_DOCKER_REPOSITORY: "${{ secrets.NDIP_DOCKER_REPOSITORY }}"
11+
READTHEDOCS_WEBHOOK_URL: "${{ secrets.READTHEDOCS_WEBHOOK_URL }}"
12+
READTHEDOCS_WEBHOOK_SECRET: "${{ secrets.READTHEDOCS_WEBHOOK_SECRET }}"
13+
14+
jobs:
15+
build-and-test:
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 60
18+
env:
19+
GIT_STRATEGY: clone
20+
IMAGE_NAME: "${NDIP_DOCKER_REPOSITORY}/${{ github.repository }}"
21+
steps:
22+
- name: Set up QEMU
23+
uses: docker/setup-qemu-action@v3
24+
- name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v3
26+
- name: Checkout repo
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 20
30+
lfs: true
31+
- name: Build
32+
uses: docker/build-push-action@v6
33+
id: build
34+
with:
35+
file: dockerfiles/Dockerfile
36+
load: true
37+
target: source
38+
- name: Run ruff check
39+
run: docker run --rm ${{ steps.build.outputs.imageid }} ruff check
40+
- name: Run format check
41+
run: docker run --rm ${{ steps.build.outputs.imageid }} ruff format --check
42+
- name: Run mypy
43+
run: docker run --rm ${{ steps.build.outputs.imageid }} mypy .
44+
- name: Unit tests
45+
run: docker run --rm ${{ steps.build.outputs.imageid }} pytest
46+
- name: Run coverage
47+
run: docker run --rm ${{ steps.build.outputs.imageid }} sh -c "coverage run && coverage report"
48+
- name: Docs test
49+
run: docker run --rm ${{ steps.build.outputs.imageid }} bash build_docs.sh

.github/workflows/nova-epics.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Publish Package
2+
3+
on: workflow_dispatch
4+
5+
concurrency:
6+
group: "${{ github.ref }}"
7+
cancel-in-progress: true
8+
9+
env:
10+
PYPI_API_TOKEN: "${{ secrets.PYPI_API_TOKEN }}"
11+
12+
jobs:
13+
tag-release:
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 60
16+
permissions: write-all
17+
env:
18+
GIT_STRATEGY: clone
19+
steps:
20+
- name: Checkout repo
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 20
24+
lfs: true
25+
- name: Parse version
26+
run: echo "VERSION=$(cat pyproject.toml | grep "version =" | head -n 1 | awk '{ print $3 }' | tr -d '"')" >> $GITHUB_ENV
27+
- name: Create release
28+
uses: actions/create-release@v1
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
with:
32+
tag_name: ${{ env.VERSION }}
33+
release_name: ${{ env.VERSION }}
34+
35+
publish-package:
36+
needs: tag-release
37+
runs-on: ubuntu-latest
38+
if: github.event_name == 'workflow_dispatch'
39+
timeout-minutes: 60
40+
env:
41+
GIT_STRATEGY: clone
42+
steps:
43+
- name: Set up QEMU
44+
uses: docker/setup-qemu-action@v3
45+
- name: Set up Docker Buildx
46+
uses: docker/setup-buildx-action@v3
47+
- name: Checkout repo
48+
uses: actions/checkout@v4
49+
with:
50+
fetch-depth: 20
51+
lfs: true
52+
- name: Build
53+
uses: docker/build-push-action@v6
54+
id: build
55+
with:
56+
file: dockerfiles/Dockerfile
57+
load: true
58+
target: package
59+
- name: Publish
60+
run: docker run --rm ${{ steps.build.outputs.imageid }} sh -c "hatch build && hatch publish -u __token__ -a ${PYPI_API_TOKEN}"

.gitignore

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# poetry
98+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102+
#poetry.lock
103+
104+
# pdm
105+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106+
#pdm.lock
107+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108+
# in version control.
109+
# https://pdm.fming.dev/#use-with-ide
110+
.pdm.toml
111+
112+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113+
__pypackages__/
114+
115+
# Celery stuff
116+
celerybeat-schedule
117+
celerybeat.pid
118+
119+
# SageMath parsed files
120+
*.sage.py
121+
122+
# Environments
123+
.env
124+
.venv
125+
env/
126+
venv/
127+
ENV/
128+
env.bak/
129+
venv.bak/
130+
131+
# Spyder project settings
132+
.spyderproject
133+
.spyproject
134+
135+
# Rope project settings
136+
.ropeproject
137+
138+
# mkdocs documentation
139+
/site
140+
141+
# mypy
142+
.mypy_cache/
143+
.dmypy.json
144+
dmypy.json
145+
146+
# Pyre type checker
147+
.pyre/
148+
149+
# pytype static type analyzer
150+
.pytype/
151+
152+
# Cython debug symbols
153+
cython_debug/
154+
155+
# PyCharm
156+
# We ingore the whole .idea folder
157+
# For more fine tuning, JetBrains specific template is maintained in a separate JetBrains.gitignore that can
158+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
159+
# and can be added to the global gitignore or merged into this file.
160+
.idea
161+
162+
163+
.envrc
164+
165+
166+
junit.xml
167+
168+
.pixi

.pre-commit-config.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.6.0
4+
hooks:
5+
- id: check-added-large-files
6+
args: [--maxkb=8192]
7+
- id: check-merge-conflict
8+
- id: check-yaml
9+
args: [--allow-multiple-documents]
10+
- id: end-of-file-fixer
11+
- id: check-toml
12+
- id: trailing-whitespace
13+
- repo: https://github.com/astral-sh/ruff-pre-commit
14+
rev: v0.6.2
15+
hooks:
16+
- id: ruff
17+
args: [--fix, --exit-non-zero-on-fix]
18+
- id: ruff-format
19+
- repo: local
20+
hooks:
21+
- id: mypy
22+
name: mypy
23+
entry: pixi run mypy .
24+
language: system
25+
types: [python]
26+
verbose: true
27+
pass_filenames: false

.readthedocs.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Read the Docs configuration file for Sphinx projects
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
# Required
5+
version: 2
6+
7+
# Set the OS, Python version and other tools you might need
8+
build:
9+
os: ubuntu-22.04
10+
tools:
11+
python: "3.12"
12+
# You can also specify other tool versions:
13+
# nodejs: "20"
14+
# rust: "1.70"
15+
# golang: "1.20"
16+
jobs:
17+
post_create_environment:
18+
- pip install sphinx-rtd-theme==3.0.2 tomli
19+
- pip install .
20+
21+
# Build documentation in the "docs/" directory with Sphinx
22+
sphinx:
23+
configuration: docs/conf.py
24+
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
25+
# builder: "dirhtml"
26+
# Fail on all warnings to avoid broken references
27+
# fail_on_warning: true
28+
29+
# Optionally build your docs in additional formats such as PDF and ePub
30+
# formats:
31+
# - pdf
32+
# - epub
33+
34+
# Optional but recommended, declare the Python requirements required
35+
# to build your documentation
36+
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
37+
# python:
38+
# install:
39+
# - requirements: docs/requirements.txt

.vscode/extensions.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"recommendations": [
3+
"charliermarsh.ruff",
4+
"ms-python.mypy-type-checker"
5+
]
6+
}

.vscode/settings.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"[python]": {
3+
"editor.defaultFormatter": "charliermarsh.ruff"
4+
},
5+
"[restructuredtext]": {
6+
"editor.wordWrap": "wordWrapColumn",
7+
"editor.wordWrapColumn": 120
8+
},
9+
"python.testing.pytestArgs": [
10+
"tests"
11+
],
12+
"python.testing.unittestEnabled": false,
13+
"python.testing.pytestEnabled": true
14+
}

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### nova-epics, 0.1.0
2+
3+
* Adds read-only connection to EPICS Tomcat server for pulling instrument status into Trame applications (thanks to John Duggan).

0 commit comments

Comments
 (0)