Skip to content

Commit c315966

Browse files
authored
Merge pull request #2 from mrbuche/main
pages workflow
2 parents afb2a55 + fdea2aa commit c315966

File tree

5 files changed

+60
-11
lines changed

5 files changed

+60
-11
lines changed

.github/workflows/pages.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: pages
2+
on:
3+
push:
4+
branches: [ "main" ]
5+
pull_request:
6+
branches: [ "main" ]
7+
jobs:
8+
build:
9+
runs-on: ubuntu-22.04
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: install package
13+
run: pip install .[all]
14+
- name: pylint badge
15+
run: |
16+
python -m pylint --disable=C0103 --output-format=text src/sdynpy | tee pylint.log || pylint-exit $?
17+
PYLINT_SCORE=$(sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' pylint.log)
18+
if (( $(echo "${PYLINT_SCORE} >= 8.0" | bc -l) )); then
19+
COLOR=brightgreen
20+
elif (( $(echo "${PYLINT_SCORE} >= 4.0" | bc -l) )); then
21+
COLOR=yellow
22+
elif (( $(echo "${PYLINT_SCORE} >= 2.0" | bc -l) )); then
23+
COLOR=orange
24+
else
25+
COLOR=red
26+
fi
27+
curl "https://img.shields.io/badge/Pylint-${PYLINT_SCORE}-${COLOR}?logo=python&logoColor=FBE072" -o pylint.svg
28+
- name: build docs
29+
run: |
30+
sudo apt-get install pandoc
31+
sphinx-build -b html docs/source/ docs/build/html/
32+
sed -i -e "s/ module</</g" docs/build/html/*.html
33+
sed -i '/Built with/,/Docs<\/a>./d' docs/build/html/*.html
34+
mv docs/build/html/ public/
35+
mv pylint.svg public/
36+
- name: deploy docs to gh-pages
37+
if: github.event_name != 'pull_request'
38+
uses: peaceiris/actions-gh-pages@v3
39+
with:
40+
github_token: ${{ secrets.GITHUB_TOKEN }}
41+
publish_dir: public/

README.rst

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22
Structural Dynamics Python Libraries
33
####################################
44

5+
|build| |pylint|
6+
57
This repository houses SDynPy, a Python module built for doing structural dynamics analysis using Python.
68
It contains core objects that define test geometry and data. It contains readers and writers for common data formats.
7-
It also contains various structural dynamics and signal processing tools.
9+
It also contains various structural dynamics and signal processing tools.
10+
11+
..
12+
Badges ========================================================================
13+
14+
.. |build| image:: https://img.shields.io/github/workflow/status/sandialabs/sdynpy/main?label=GitHub&logo=github
15+
:target: https://github.com/sandialabs/sdynpy
16+
17+
.. |pylint| image:: https://raw.githubusercontent.com/sandialabs/sdynpy/gh-pages/pylint.svg
18+
:target: https://github.com/sandialabs/sdynpy

docs/source/_templates/footer.html

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

docs/source/conf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ def get_version():
3030

3131

3232
project = 'SDynPy'
33-
copyright = '2022, Sandia National Laboratories'
3433
author = 'Daniel P. Rohe'
34+
copyright = '2022 National Technology & Engineering Solutions of Sandia, \
35+
LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, \
36+
the U.S. Government retains certain rights in this software'
3537

3638
# The full version, including alpha/beta/rc tags
3739
release = get_version()

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ def get_ui_files(directory):
6363
'sphinx', 'sphinx-rtd-theme', 'sphinxcontrib-bibtex',
6464
'sphinx-copybutton'],
6565
'testing': ['pycodestyle', 'pylint', 'pytest', 'pytest-cov'],
66-
'all': ['docutils<0.18,>=0.14', 'ipykernel', 'ipython',
67-
'jinja2>=3.0', 'nbsphinx',
68-
'pycodestyle', 'pylint', 'pytest', 'pytest-cov',
69-
'sphinx', 'sphinx-rtd-theme', 'sphinxcontrib-bibtex']},
66+
'all': ['docutils<0.18,>=0.14', 'ipykernel', 'ipython', 'jinja2>=3.0',
67+
'nbsphinx', 'pycodestyle', 'pylint', 'pytest', 'pytest-cov',
68+
'sphinx', 'sphinx-copybutton',
69+
'sphinx-rtd-theme', 'sphinxcontrib-bibtex']},
7070
classifiers=['Natural Language :: English',
7171
'Operating System :: Microsoft :: Windows :: Windows 10'
7272
'Operating System :: MacOS :: MacOS X',

0 commit comments

Comments
 (0)