Skip to content

Commit

Permalink
Merge pull request #16 from r9y9/lint
Browse files Browse the repository at this point in the history
enable pysen on CI
  • Loading branch information
r9y9 authored Aug 11, 2021
2 parents 8fd091b + 7e6b386 commit a930829
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 24 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
- name: Lint with flake8
pip install -e ".[lint]"
- name: Lint with pysen
run: |
pip install flake8
flake8
pysen run lint
- name: Test with pytest
run: |
pip install pytest
Expand Down
60 changes: 40 additions & 20 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,18 @@ def test_quoted_arg_change():
file_encoding = "utf8"
arg_value = '"ARG"'

spawn([
sys.executable,
"-c",
child_script,
package_build_dir,
file_name,
output_mode,
file_encoding,
arg_value
])
spawn(
[
sys.executable,
"-c",
child_script,
package_build_dir,
file_name,
output_mode,
file_encoding,
arg_value,
]
)

# read
with open(file_name, mode="r", encoding=file_encoding) as fd:
Expand All @@ -114,7 +116,7 @@ def test_quoted_arg_change():


def escape_string_macro_arg(s):
return s.replace('\\', '\\\\').replace('"', '\\"')
return s.replace("\\", "\\\\").replace('"', '\\"')


def escape_macro_element(x):
Expand Down Expand Up @@ -177,14 +179,16 @@ def escape_macros(macros):
extra_compile_args=[],
extra_link_args=[],
language="c++",
define_macros=custom_define_macros([
("HAVE_CONFIG_H", None),
("DIC_VERSION", 102),
("MECAB_DEFAULT_RC", '"dummy"'),
("PACKAGE", '"open_jtalk"'),
("VERSION", '"1.10"'),
("CHARSET_UTF_8", None),
]),
define_macros=custom_define_macros(
[
("HAVE_CONFIG_H", None),
("DIC_VERSION", 102),
("MECAB_DEFAULT_RC", '"dummy"'),
("PACKAGE", '"open_jtalk"'),
("VERSION", '"1.10"'),
("CHARSET_UTF_8", None),
]
),
)
]

Expand Down Expand Up @@ -269,7 +273,23 @@ def run(self):
],
tests_require=["nose", "coverage"],
extras_require={
"docs": ["sphinx_rtd_theme", "nbsphinx>=0.8.6", "Jinja2>=3.0.1", "pandoc", "ipython", "jupyter"],
"docs": [
"sphinx_rtd_theme",
"nbsphinx>=0.8.6",
"Jinja2>=3.0.1",
"pandoc",
"ipython",
"jupyter",
],
"lint": [
"pysen",
"types-setuptools",
"mypy<=0.910",
"black>=19.19b0,<=20.8",
"flake8>=3.7,<4",
"flake8-bugbear",
"isort>=4.3,<5.2.0",
],
"test": ["pytest", "scipy"],
},
classifiers=[
Expand Down

0 comments on commit a930829

Please sign in to comment.