Skip to content

Commit a64546c

Browse files
authored
Merge pull request #1 from JunAishima/add-ci
Add ci
2 parents ed8054d + f2903a8 commit a64546c

20 files changed

+658
-486
lines changed

.github/workflows/black.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Check Code Style - BLACK
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- uses: actions/setup-python@v2
11+
- name: Install Dependencies
12+
run: |
13+
# These packages are installed in the base environment but may be older
14+
# versions. Explicitly upgrade them because they often create
15+
# installation problems if out of date.
16+
python -m pip install --upgrade pip setuptools numpy
17+
18+
pip install black
19+
- name: Run black
20+
run: |
21+
bash ./scripts/black.sh --check

.github/workflows/flake8.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Check Code Style - FLAKE8
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- uses: actions/setup-python@v2
11+
- name: Install Dependencies
12+
run: |
13+
# These packages are installed in the base environment but may be older
14+
# versions. Explicitly upgrade them because they often create
15+
# installation problems if out of date.
16+
python -m pip install --upgrade pip setuptools numpy
17+
18+
pip install flake8
19+
- name: Run flake8
20+
run: |
21+
bash ./scripts/flake8.sh

.github/workflows/isort.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Check Code Style - ISORT
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- uses: actions/setup-python@v2
11+
- name: Install Dependencies
12+
run: |
13+
# These packages are installed in the base environment but may be older
14+
# versions. Explicitly upgrade them because they often create
15+
# installation problems if out of date.
16+
python -m pip install --upgrade pip setuptools numpy
17+
18+
pip install isort
19+
- name: Run isort
20+
run: |
21+
bash ./scripts/isort.sh --check
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# This workflow will upload a Python Package using flit when a release is
2+
# created. For more information see:
3+
# https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
4+
5+
name: Upload Python Package
6+
7+
on:
8+
release:
9+
types: [created]
10+
11+
jobs:
12+
deploy:
13+
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Set up Python
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: '3.x'
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install wheel twine setuptools
26+
- name: Build and publish
27+
env:
28+
TWINE_USERNAME: __token__
29+
# The PYPI_PASSWORD must be a pypi token with the "pypi-" prefix with sufficient permissions to upload this package
30+
# https://pypi.org/help/#apitoken
31+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
32+
run: |
33+
python setup.py sdist bdist_wheel
34+
twine upload dist/*

docs/source/conf.py

Lines changed: 42 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@
3232
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3333
# ones.
3434
extensions = [
35-
'sphinx.ext.autodoc',
36-
'sphinx.ext.autosummary',
37-
'sphinx.ext.githubpages',
38-
'sphinx.ext.intersphinx',
39-
'sphinx.ext.mathjax',
40-
'sphinx.ext.viewcode',
41-
'IPython.sphinxext.ipython_directive',
42-
'IPython.sphinxext.ipython_console_highlighting',
43-
'matplotlib.sphinxext.plot_directive',
44-
'numpydoc',
45-
'sphinx_copybutton',
35+
"sphinx.ext.autodoc",
36+
"sphinx.ext.autosummary",
37+
"sphinx.ext.githubpages",
38+
"sphinx.ext.intersphinx",
39+
"sphinx.ext.mathjax",
40+
"sphinx.ext.viewcode",
41+
"IPython.sphinxext.ipython_directive",
42+
"IPython.sphinxext.ipython_console_highlighting",
43+
"matplotlib.sphinxext.plot_directive",
44+
"numpydoc",
45+
"sphinx_copybutton",
4646
]
4747

4848
# Configuration options for plot_directive. See:
@@ -55,27 +55,28 @@
5555
numpydoc_show_class_members = False
5656

5757
# Add any paths that contain templates here, relative to this directory.
58-
templates_path = ['_templates']
58+
templates_path = ["_templates"]
5959

6060
# The suffix(es) of source filenames.
6161
# You can specify multiple suffix as a list of string:
6262
#
6363
# source_suffix = ['.rst', '.md']
64-
source_suffix = '.rst'
64+
source_suffix = ".rst"
6565

6666
# The master toctree document.
67-
master_doc = 'index'
67+
master_doc = "index"
6868

6969
# General information about the project.
70-
project = 'qt-epics'
71-
copyright = '2020, Jun Aishima'
72-
author = 'Jun Aishima'
70+
project = "qt-epics"
71+
copyright = "2020, Jun Aishima"
72+
author = "Jun Aishima"
7373

7474
# The version info for the project you're documenting, acts as replacement for
7575
# |version| and |release|, also used in various other places throughout the
7676
# built documents.
7777
#
7878
import qt_epics
79+
7980
# The short X.Y version.
8081
version = qt_epics.__version__
8182
# The full version, including alpha/beta/rc tags.
@@ -94,7 +95,7 @@
9495
exclude_patterns = []
9596

9697
# The name of the Pygments (syntax highlighting) style to use.
97-
pygments_style = 'sphinx'
98+
pygments_style = "sphinx"
9899

99100
# If true, `todo` and `todoList` produce output, else they produce nothing.
100101
todo_include_todos = False
@@ -105,8 +106,9 @@
105106
# The theme to use for HTML and HTML Help pages. See the documentation for
106107
# a list of builtin themes.
107108
#
108-
html_theme = 'sphinx_rtd_theme'
109+
html_theme = "sphinx_rtd_theme"
109110
import sphinx_rtd_theme
111+
110112
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
111113

112114
# Theme options are theme-specific and customize the look and feel of a theme
@@ -118,25 +120,25 @@
118120
# Add any paths that contain custom static files (such as style sheets) here,
119121
# relative to this directory. They are copied after the builtin static files,
120122
# so a file named "default.css" will overwrite the builtin "default.css".
121-
html_static_path = ['_static']
123+
html_static_path = ["_static"]
122124

123125
# Custom sidebar templates, must be a dictionary that maps document names
124126
# to template names.
125127
#
126128
# This is required for the alabaster theme
127129
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
128130
html_sidebars = {
129-
'**': [
130-
'relations.html', # needs 'show_related': True theme option to display
131-
'searchbox.html',
131+
"**": [
132+
"relations.html", # needs 'show_related': True theme option to display
133+
"searchbox.html",
132134
]
133135
}
134136

135137

136138
# -- Options for HTMLHelp output ------------------------------------------
137139

138140
# Output file base name for HTML help builder.
139-
htmlhelp_basename = 'qt-epics'
141+
htmlhelp_basename = "qt-epics"
140142

141143

142144
# -- Options for LaTeX output ---------------------------------------------
@@ -145,15 +147,12 @@
145147
# The paper size ('letterpaper' or 'a4paper').
146148
#
147149
# 'papersize': 'letterpaper',
148-
149150
# The font size ('10pt', '11pt' or '12pt').
150151
#
151152
# 'pointsize': '10pt',
152-
153153
# Additional stuff for the LaTeX preamble.
154154
#
155155
# 'preamble': '',
156-
157156
# Latex figure (float) alignment
158157
#
159158
# 'figure_align': 'htbp',
@@ -163,19 +162,15 @@
163162
# (source start file, target name, title,
164163
# author, documentclass [howto, manual, or own class]).
165164
latex_documents = [
166-
(master_doc, 'qt-epics.tex', 'qt-epics Documentation',
167-
'Contributors', 'manual'),
165+
(master_doc, "qt-epics.tex", "qt-epics Documentation", "Contributors", "manual"),
168166
]
169167

170168

171169
# -- Options for manual page output ---------------------------------------
172170

173171
# One entry per manual page. List of tuples
174172
# (source start file, name, description, authors, manual section).
175-
man_pages = [
176-
(master_doc, 'qt-epics', 'qt-epics Documentation',
177-
[author], 1)
178-
]
173+
man_pages = [(master_doc, "qt-epics", "qt-epics Documentation", [author], 1)]
179174

180175

181176
# -- Options for Texinfo output -------------------------------------------
@@ -184,19 +179,23 @@
184179
# (source start file, target name, title, author,
185180
# dir menu entry, description, category)
186181
texinfo_documents = [
187-
(master_doc, 'qt-epics', 'qt-epics Documentation',
188-
author, 'qt-epics', 'Qt-based widgets for PyEpics devices',
189-
'Miscellaneous'),
182+
(
183+
master_doc,
184+
"qt-epics",
185+
"qt-epics Documentation",
186+
author,
187+
"qt-epics",
188+
"Qt-based widgets for PyEpics devices",
189+
"Miscellaneous",
190+
),
190191
]
191192

192193

193-
194-
195194
# Example configuration for intersphinx: refer to the Python standard library.
196195
intersphinx_mapping = {
197-
'python': ('https://docs.python.org/3/', None),
198-
'numpy': ('https://docs.scipy.org/doc/numpy/', None),
199-
'scipy': ('https://docs.scipy.org/doc/scipy/reference/', None),
200-
'pandas': ('https://pandas.pydata.org/pandas-docs/stable', None),
201-
'matplotlib': ('https://matplotlib.org', None),
196+
"python": ("https://docs.python.org/3/", None),
197+
"numpy": ("https://docs.scipy.org/doc/numpy/", None),
198+
"scipy": ("https://docs.scipy.org/doc/scipy/reference/", None),
199+
"pandas": ("https://pandas.pydata.org/pandas-docs/stable", None),
200+
"matplotlib": ("https://matplotlib.org", None),
202201
}

0 commit comments

Comments
 (0)