Skip to content

Commit a604e4e

Browse files
authored
Merge pull request #317 from ISISComputingGroup/modernise_lewis
add github action, create pyproject.toml, remove some ess specific st…
2 parents a657661 + 1bc59fe commit a604e4e

File tree

93 files changed

+740
-877
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+740
-877
lines changed

.flake8

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Lint-and-test
2+
on: [pull_request, workflow_call]
3+
jobs:
4+
call-linter-workflow:
5+
uses: ISISComputingGroup/reusable-workflows/.github/workflows/linters.yml@main
6+
with:
7+
compare-branch: origin/main
8+
python-ver: '3.11'
9+
tests:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
version: ['3.10','3.11']
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-python@v5
17+
with:
18+
python-version: ${{ matrix.version }}
19+
- name: install requirements
20+
run: pip install -e .[dev]
21+
- name: run unit tests
22+
run: python -m pytest .
23+
- name: run system tests
24+
working-directory: ./system_tests
25+
run: python -m pytest --approvaltests-use-reporter='PythonNativeReporter' lewis_tests.py
26+
results:
27+
if: ${{ always() }}
28+
runs-on: ubuntu-latest
29+
name: Final Results
30+
needs: [call-linter-workflow, tests]
31+
steps:
32+
- run: exit 1
33+
# see https://stackoverflow.com/a/67532120/4907315
34+
if: >-
35+
${{
36+
contains(needs.*.result, 'failure')
37+
|| contains(needs.*.result, 'cancelled')
38+
}}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: sphinx
2+
3+
on: [push, pull_request, workflow_call]
4+
5+
jobs:
6+
call_sphinx_builder:
7+
uses: ISISComputingGroup/reusable-workflows/.github/workflows/sphinx.yml@main
8+
secrets: inherit

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
.cache
66
dist/
77
build/
8-
docs/_build/
8+
doc/_build/
99
lewis.egg-info
1010
.DS_Store
11+
.venv
12+
doc/generated
13+
_build
14+
.approval_tests_temp

.isort.cfg

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

Jenkinsfile

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

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
Lewis - Let's write intricate simulators.
33

44
Lewis is a Python framework for simulating hardware devices. It is
5-
compatible with Python 3.7 to 3.11.
5+
compatible with Python 3.10 to 3.11.
66

77
It is currently not compatible with 3.12 as the asyncchat module has been removed from Python.
88
We are going to fix this at some point.
99

1010
Lewis can be installed via pip or ran from source. See relevant usage sections of the docs for more details.
1111

1212
Resources:
13-
[GitHub](https://github.com/ess-dmsc/lewis)
13+
[GitHub](https://github.com/ISISComputingGroup/lewis)
1414
[PyPI](https://pypi.python.org/pypi/lewis)
1515

1616
Lewis was previously named "Plankton" but, due to a

doc/_api.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
:orphan:
2+
3+
API
4+
===
5+
6+
.. autosummary::
7+
:toctree: generated
8+
:template: custom-module-template.rst
9+
:recursive:
10+
11+
lewis
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
3+
{{ ('``' + fullname + '``') | underline }}
4+
5+
{%- set filtered_members = [] %}
6+
{%- for item in members %}
7+
{%- if item in functions + classes + exceptions + attributes %}
8+
{% set _ = filtered_members.append(item) %}
9+
{%- endif %}
10+
{%- endfor %}
11+
12+
.. automodule:: {{ fullname }}
13+
:members:
14+
:show-inheritance:
15+
16+
{% block modules %}
17+
{% if modules %}
18+
.. rubric:: Submodules
19+
20+
.. autosummary::
21+
:toctree:
22+
:template: custom-module-template.rst
23+
:recursive:
24+
{% for item in modules %}
25+
{{ item }}
26+
{%- endfor %}
27+
{% endif %}
28+
{% endblock %}
29+
30+
{% block members %}
31+
{% if filtered_members %}
32+
.. rubric:: Members
33+
34+
.. autosummary::
35+
:nosignatures:
36+
{% for item in filtered_members %}
37+
{{ item }}
38+
{%- endfor %}
39+
{% endif %}
40+
{% endblock %}

doc/conf.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# lewis documentation build configuration file, created by
4+
# sphinx-quickstart on Wed Nov 9 16:42:53 2016.
5+
import os
6+
import sys
7+
sys.path.insert(0, os.path.abspath("../lewis"))
8+
9+
10+
# -- General configuration ------------------------------------------------
11+
extensions = [
12+
"myst_parser",
13+
"sphinx.ext.autodoc",
14+
# and making summary tables at the top of API docs
15+
"sphinx.ext.autosummary",
16+
# This can parse google style docstrings
17+
"sphinx.ext.napoleon",
18+
# For linking to external sphinx documentation
19+
"sphinx.ext.intersphinx",
20+
# Add links to source code in API docs
21+
"sphinx.ext.viewcode",
22+
]
23+
templates_path = ["_templates"]
24+
# General information about the project.
25+
project = u"lewis"
26+
language = 'en'
27+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
28+
# -- Options for HTML output ---------------------------------------------
29+
suppress_warnings =["docutils"]
30+
html_theme = "sphinx_rtd_theme"
31+
html_logo = "resources/logo/lewis-logo.png"
32+
33+
autoclass_content = "both"
34+
myst_heading_anchors = 3
35+
36+
napoleon_google_docstring = False
37+
napoleon_numpy_docstring = True

0 commit comments

Comments
 (0)