Skip to content

Commit 588b5b4

Browse files
authored
Merge pull request #66 from QuLogic/gha
Switch to GitHub Actions and fix flake8
2 parents 723d82b + 396d235 commit 588b5b4

File tree

9 files changed

+154
-95
lines changed

9 files changed

+154
-95
lines changed

.github/workflows/reviewdog.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: Linting
3+
on: [pull_request]
4+
5+
jobs:
6+
flake8:
7+
name: flake8
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
12+
- name: Set up Python 3
13+
uses: actions/setup-python@v1
14+
with:
15+
python-version: 3.8
16+
17+
- name: Install flake8
18+
run: pip3 install -r flake8
19+
20+
- name: Set up reviewdog
21+
run: |
22+
mkdir -p "$HOME/bin"
23+
curl -sfL \
24+
https://github.com/reviewdog/reviewdog/raw/master/install.sh | \
25+
sh -s -- -b "$HOME/bin"
26+
echo "$HOME/bin" >> $GITHUB_PATH
27+
28+
- name: Run flake8
29+
env:
30+
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
run: |
32+
set -o pipefail
33+
flake8 --docstring-convention=all | \
34+
reviewdog -f=pep8 -name=flake8 \
35+
-tee -reporter=github-check -filter-mode nofilter

.github/workflows/tests.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
3+
name: Tests
4+
5+
on:
6+
push:
7+
branches-ignore:
8+
- auto-backport-of-pr-[0-9]+
9+
- v[0-9]+.[0-9]+.[0-9x]+-doc
10+
pull_request:
11+
12+
jobs:
13+
test:
14+
name: "Python ${{ matrix.python-version }} ${{ matrix.name-suffix }}"
15+
runs-on: ubuntu-18.04
16+
17+
strategy:
18+
matrix:
19+
python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9"]
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Set up Python ${{ matrix.python-version }}
27+
uses: actions/setup-python@v2
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
31+
- name: Install Python dependencies
32+
run: |
33+
python -m pip install --upgrade pip setuptools wheel
34+
python -m pip install --upgrade pytest pytest-cov pytest-xdist
35+
36+
- name: Install cycler
37+
run: |
38+
python -m pip install --no-deps .
39+
40+
- name: Run pytest
41+
run: |
42+
pytest -raR -n auto --cov --cov-report=
43+
44+
- name: Upload code coverage
45+
uses: codecov/codecov-action@v1

.travis.yml

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

MANIFEST.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
include run_tests.py
21
include test_cycler.py
32
include LICENSE
43
recursive-include conda-recipe *
5-
recursive-include doc Makefile make.bat *.rst *.py
4+
recursive-include doc Makefile make.bat *.rst *.py

appveyor.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ install:
2020
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
2121

2222
# Install the build and runtime dependencies of the project.
23-
- "pip install -v nose pytest pytest-cov coverage"
23+
- "pip install -v pytest pytest-cov pytest-xdist"
2424

2525
# Install the generated wheel package to test it
2626
- "python setup.py install"
@@ -31,8 +31,8 @@ build: false
3131

3232
test_script:
3333

34-
# Run unit tests with nose
35-
- "python run_tests.py"
34+
# Run unit tests with pytest
35+
- "python -m pytest -raR -n auto"
3636

3737
artifacts:
3838
# Archive the generated wheel package in the ci.appveyor.com build report.

cycler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ def __getitem__(self, key):
242242

243243
def __iter__(self):
244244
if self._right is None:
245-
for l in self._left:
246-
yield dict(l)
245+
for left in self._left:
246+
yield dict(left)
247247
else:
248248
for a, b in self._op(self._left, self._right):
249249
out = dict()

doc/source/conf.py

Lines changed: 47 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,10 @@
1313
# All configuration values have a default; values that are commented out
1414
# serve to show the default.
1515

16-
import sys
17-
import os
18-
1916
# If extensions (or modules to document with autodoc) are in another directory,
2017
# add these directories to sys.path here. If the directory is relative to the
2118
# documentation root, use os.path.abspath to make it absolute, like shown here.
22-
#sys.path.insert(0, os.path.abspath('.'))
19+
# sys.path.insert(0, os.path.abspath('.'))
2320

2421
# -- General configuration ------------------------------------------------
2522

@@ -56,7 +53,7 @@
5653
source_suffix = '.rst'
5754

5855
# The encoding of source files.
59-
#source_encoding = 'utf-8-sig'
56+
# source_encoding = 'utf-8-sig'
6057

6158
# The master toctree document.
6259
master_doc = 'index'
@@ -76,13 +73,13 @@
7673

7774
# The language for content autogenerated by Sphinx. Refer to documentation
7875
# for a list of supported languages.
79-
#language = None
76+
# language = None
8077

8178
# There are two options for replacing |today|: either, you set today to some
8279
# non-false value, then it is used:
83-
#today = ''
80+
# today = ''
8481
# Else, today_fmt is used as the format for a strftime call.
85-
#today_fmt = '%B %d, %Y'
82+
# today_fmt = '%B %d, %Y'
8683

8784
# List of patterns, relative to source directory, that match files and
8885
# directories to ignore when looking for source files.
@@ -93,24 +90,24 @@
9390
default_role = 'obj'
9491

9592
# If true, '()' will be appended to :func: etc. cross-reference text.
96-
#add_function_parentheses = True
93+
# add_function_parentheses = True
9794

9895
# If true, the current module name will be prepended to all description
9996
# unit titles (such as .. function::).
100-
#add_module_names = True
97+
# add_module_names = True
10198

10299
# If true, sectionauthor and moduleauthor directives will be shown in the
103100
# output. They are ignored by default.
104-
#show_authors = False
101+
# show_authors = False
105102

106103
# The name of the Pygments (syntax highlighting) style to use.
107104
pygments_style = 'sphinx'
108105

109106
# A list of ignored prefixes for module index sorting.
110-
#modindex_common_prefix = []
107+
# modindex_common_prefix = []
111108

112109
# If true, keep warnings as "system message" paragraphs in the built documents.
113-
#keep_warnings = False
110+
# keep_warnings = False
114111

115112

116113
# -- Options for HTML output ----------------------------------------------
@@ -122,26 +119,26 @@
122119
# Theme options are theme-specific and customize the look and feel of a theme
123120
# further. For a list of options available for each theme, see the
124121
# documentation.
125-
#html_theme_options = {}
122+
# html_theme_options = {}
126123

127124
# Add any paths that contain custom themes here, relative to this directory.
128-
#html_theme_path = []
125+
# html_theme_path = []
129126

130127
# The name for this set of Sphinx documents. If None, it defaults to
131128
# "<project> v<release> documentation".
132-
#html_title = None
129+
# html_title = None
133130

134131
# A shorter title for the navigation bar. Default is the same as html_title.
135-
#html_short_title = None
132+
# html_short_title = None
136133

137134
# The name of an image file (relative to this directory) to place at the top
138135
# of the sidebar.
139-
#html_logo = None
136+
# html_logo = None
140137

141138
# The name of an image file (within the static path) to use as favicon of the
142139
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
143140
# pixels large.
144-
#html_favicon = None
141+
# html_favicon = None
145142

146143
# Add any paths that contain custom static files (such as style sheets) here,
147144
# relative to this directory. They are copied after the builtin static files,
@@ -151,48 +148,48 @@
151148
# Add any extra paths that contain custom files (such as robots.txt or
152149
# .htaccess) here, relative to this directory. These files are copied
153150
# directly to the root of the documentation.
154-
#html_extra_path = []
151+
# html_extra_path = []
155152

156153
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
157154
# using the given strftime format.
158-
#html_last_updated_fmt = '%b %d, %Y'
155+
# html_last_updated_fmt = '%b %d, %Y'
159156

160157
# If true, SmartyPants will be used to convert quotes and dashes to
161158
# typographically correct entities.
162-
#html_use_smartypants = True
159+
# html_use_smartypants = True
163160

164161
# Custom sidebar templates, maps document names to template names.
165-
#html_sidebars = {}
162+
# html_sidebars = {}
166163

167164
# Additional templates that should be rendered to pages, maps page names to
168165
# template names.
169-
#html_additional_pages = {}
166+
# html_additional_pages = {}
170167

171168
# If false, no module index is generated.
172-
#html_domain_indices = True
169+
# html_domain_indices = True
173170

174171
# If false, no index is generated.
175-
#html_use_index = True
172+
# html_use_index = True
176173

177174
# If true, the index is split into individual pages for each letter.
178-
#html_split_index = False
175+
# html_split_index = False
179176

180177
# If true, links to the reST sources are added to the pages.
181-
#html_show_sourcelink = True
178+
# html_show_sourcelink = True
182179

183180
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
184-
#html_show_sphinx = True
181+
# html_show_sphinx = True
185182

186183
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
187-
#html_show_copyright = True
184+
# html_show_copyright = True
188185

189186
# If true, an OpenSearch description file will be output, and all pages will
190187
# contain a <link> tag referring to it. The value of this option must be the
191188
# base URL from which the finished HTML is served.
192-
#html_use_opensearch = ''
189+
# html_use_opensearch = ''
193190

194191
# This is the file name suffix for HTML files (e.g. ".xhtml").
195-
#html_file_suffix = None
192+
# html_file_suffix = None
196193

197194
# Output file base name for HTML help builder.
198195
htmlhelp_basename = 'cyclerdoc'
@@ -201,14 +198,14 @@
201198
# -- Options for LaTeX output ---------------------------------------------
202199

203200
latex_elements = {
204-
# The paper size ('letterpaper' or 'a4paper').
205-
#'papersize': 'letterpaper',
201+
# The paper size ('letterpaper' or 'a4paper').
202+
# 'papersize': 'letterpaper',
206203

207-
# The font size ('10pt', '11pt' or '12pt').
208-
#'pointsize': '10pt',
204+
# The font size ('10pt', '11pt' or '12pt').
205+
# 'pointsize': '10pt',
209206

210-
# Additional stuff for the LaTeX preamble.
211-
#'preamble': '',
207+
# Additional stuff for the LaTeX preamble.
208+
# 'preamble': '',
212209
}
213210

214211
# Grouping the document tree into LaTeX files. List of tuples
@@ -221,23 +218,23 @@
221218

222219
# The name of an image file (relative to this directory) to place at the top of
223220
# the title page.
224-
#latex_logo = None
221+
# latex_logo = None
225222

226223
# For "manual" documents, if this is true, then toplevel headings are parts,
227224
# not chapters.
228-
#latex_use_parts = False
225+
# latex_use_parts = False
229226

230227
# If true, show page references after internal links.
231-
#latex_show_pagerefs = False
228+
# latex_show_pagerefs = False
232229

233230
# If true, show URL addresses after external links.
234-
#latex_show_urls = False
231+
# latex_show_urls = False
235232

236233
# Documents to append as an appendix to all manuals.
237-
#latex_appendices = []
234+
# latex_appendices = []
238235

239236
# If false, no module index is generated.
240-
#latex_domain_indices = True
237+
# latex_domain_indices = True
241238

242239

243240
# -- Options for manual page output ---------------------------------------
@@ -250,7 +247,7 @@
250247
]
251248

252249
# If true, show URL addresses after external links.
253-
#man_show_urls = False
250+
# man_show_urls = False
254251

255252

256253
# -- Options for Texinfo output -------------------------------------------
@@ -265,19 +262,19 @@
265262
]
266263

267264
# Documents to append as an appendix to all manuals.
268-
#texinfo_appendices = []
265+
# texinfo_appendices = []
269266

270267
# If false, no module index is generated.
271-
#texinfo_domain_indices = True
268+
# texinfo_domain_indices = True
272269

273270
# How to display URL addresses: 'footnote', 'no', or 'inline'.
274-
#texinfo_show_urls = 'footnote'
271+
# texinfo_show_urls = 'footnote'
275272

276273
# If true, do not generate a @detailmenu in the "Top" node's menu.
277-
#texinfo_no_detailmenu = False
274+
# texinfo_no_detailmenu = False
278275

279276
intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),
280277
'matplotlb': ('https://matplotlib.org', None)}
281278

282-
################# numpydoc config ####################
279+
# ################ numpydoc config ####################
283280
numpydoc_show_class_members = False

0 commit comments

Comments
 (0)