Skip to content

Commit 14ce05f

Browse files
committed
Switch travis, optimize editorconfig
Signed-off-by: Aleksei Stepanov <penguinolog@gmail.com>
1 parent b7cee77 commit 14ce05f

File tree

3 files changed

+36
-32
lines changed

3 files changed

+36
-32
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ indent_style = space
88
insert_final_newline = true
99
trim_trailing_whitespace = true
1010

11-
[*.{py,pyx,pxd}]
11+
[*.{py,pyx,pxd,pyi}]
1212
indent_size = 4
1313
max_line_length = 120
1414

README.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
exec-helpers
22
============
33

4-
.. image:: https://travis-ci.org/python-useful-helpers/exec-helpers.svg?branch=master
5-
:target: https://travis-ci.org/python-useful-helpers/exec-helpers
4+
.. image:: https://travis-ci.com/python-useful-helpers/exec-helpers.svg?branch=master
5+
:target: https://travis-ci.com/python-useful-helpers/exec-helpers
66
.. image:: https://dev.azure.com/python-useful-helpers/exec-helpers/_apis/build/status/python-useful-helpers.exec-helpers?branchName=master
7-
:target: https://dev.azure.com/python-useful-helpers/exec-helpers/_apis/build/status/python-useful-helpers.exec-helpers?branchName=master
7+
:target: https://dev.azure.com/python-useful-helpers/exec-helpers/_build
88
.. image:: https://coveralls.io/repos/github/python-useful-helpers/exec-helpers/badge.svg?branch=master
99
:target: https://coveralls.io/github/python-useful-helpers/exec-helpers?branch=master
1010
.. image:: https://readthedocs.org/projects/exec-helpers/badge/?version=latest
@@ -377,8 +377,8 @@ CI systems
377377
==========
378378
For code checking several CI systems is used in parallel:
379379

380-
1. `Travis CI: <https://travis-ci.org/python-useful-helpers/exec-helpers>`_ is used for checking: PEP8, pylint, bandit, installation possibility and unit tests. Also it's publishes coverage on coveralls.
380+
1. `Travis CI: <https://travis-ci.com/python-useful-helpers/exec-helpers>`_ is used for checking: PEP8, pylint, bandit, installation possibility and unit tests. Also it's publishes coverage on coveralls.
381381

382-
2. `Azure Pipelines: <https://dev.azure.com/python-useful-helpers/exec-helpers/_apis/build/status/python-useful-helpers.exec-helpers?branchName=master>`_ is used for windows compatibility checking.
382+
2. `Azure Pipelines: <https://dev.azure.com/python-useful-helpers/exec-helpers/_build>`_ is used for windows compatibility checking.
383383

384384
3. `coveralls: <https://coveralls.io/github/python-useful-helpers/exec-helpers>`_ is used for coverage display.

setup.py

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@
4040
cythonize = None
4141

4242
with open(os.path.join(os.path.dirname(__file__), "exec_helpers", "__init__.py")) as f:
43-
source = f.read()
43+
SOURCE = f.read()
4444

4545
with open("requirements.txt") as f:
46-
required = f.read().splitlines()
46+
REQUIRED = f.read().splitlines()
4747

4848
with open("README.rst") as f:
49-
long_description = f.read()
49+
LONG_DESCRIPTION = f.read()
5050

5151

5252
def _extension(modpath):
@@ -55,7 +55,7 @@ def _extension(modpath):
5555
return setuptools.Extension(modpath, [source_path])
5656

5757

58-
requires_optimization = [
58+
REQUIRES_OPTIMIZATION = [
5959
_extension("exec_helpers.async_api.api"),
6060
_extension("exec_helpers.async_api.exec_result"),
6161
_extension("exec_helpers.async_api.subprocess_runner"),
@@ -76,13 +76,13 @@ def _extension(modpath):
7676
]
7777

7878
if "win32" != sys.platform:
79-
requires_optimization.append(_extension("exec_helpers.__init__"))
80-
requires_optimization.append(_extension("exec_helpers.async_api.__init__"))
79+
REQUIRES_OPTIMIZATION.append(_extension("exec_helpers.__init__"))
80+
REQUIRES_OPTIMIZATION.append(_extension("exec_helpers.async_api.__init__"))
8181

8282
# noinspection PyCallingNonCallable
83-
ext_modules = (
83+
EXT_MODULES = (
8484
cythonize(
85-
requires_optimization,
85+
REQUIRES_OPTIMIZATION,
8686
compiler_directives=dict(
8787
always_allow_keywords=True, binding=True, embedsignature=True, overflowcheck=True, language_level=3
8888
),
@@ -95,14 +95,15 @@ def _extension(modpath):
9595
class BuildFailed(Exception):
9696
"""For install clear scripts."""
9797

98-
pass
99-
10098

10199
class AllowFailRepair(build_ext.build_ext):
102100
"""This class allows C extension building to fail and repairs init."""
103101

104102
def run(self):
105-
"""Run."""
103+
"""Run.
104+
105+
:raises BuildFailed: Build is failed and clean python code should be used.
106+
"""
106107
try:
107108
build_ext.build_ext.run(self)
108109

@@ -126,7 +127,10 @@ def run(self):
126127
raise BuildFailed()
127128

128129
def build_extension(self, ext):
129-
"""build_extension."""
130+
"""build_extension.
131+
132+
:raises BuildFailed: Build is failed and clean python code should be used.
133+
"""
130134
try:
131135
build_ext.build_ext.build_extension(self, ext)
132136
except (
@@ -207,9 +211,9 @@ def get_simple_vars_from_src(src):
207211
return result
208212

209213

210-
variables = get_simple_vars_from_src(source)
214+
VARIABLES = get_simple_vars_from_src(SOURCE)
211215

212-
classifiers = [
216+
CLASSIFIERS = [
213217
"Development Status :: 5 - Production/Stable",
214218
"Intended Audience :: Developers",
215219
"Topic :: Software Development :: Libraries :: Python Modules",
@@ -221,21 +225,21 @@ def get_simple_vars_from_src(src):
221225
"Programming Language :: Python :: Implementation :: PyPy",
222226
]
223227

224-
keywords = ["logging", "debugging", "development"]
228+
KEYWORDS = ["logging", "debugging", "development"]
225229

226230
setup_args = dict(
227231
name="exec-helpers",
228-
author=variables["__author__"],
229-
author_email=variables["__author_email__"],
232+
author=VARIABLES["__author__"],
233+
author_email=VARIABLES["__author_email__"],
230234
maintainer=", ".join(
231-
"{name} <{email}>".format(name=name, email=email) for name, email in variables["__maintainers__"].items()
235+
"{name} <{email}>".format(name=name, email=email) for name, email in VARIABLES["__maintainers__"].items()
232236
),
233-
url=variables["__url__"],
234-
license=variables["__license__"],
235-
description=variables["__description__"],
236-
long_description=long_description,
237-
classifiers=classifiers,
238-
keywords=keywords,
237+
url=VARIABLES["__url__"],
238+
license=VARIABLES["__license__"],
239+
description=VARIABLES["__description__"],
240+
long_description=LONG_DESCRIPTION,
241+
classifiers=CLASSIFIERS,
242+
keywords=KEYWORDS,
239243
python_requires=">=3.6",
240244
# While setuptools cannot deal with pre-installed incompatible versions,
241245
# setting a lower bound is not harmful - it makes error messages cleaner. DO
@@ -250,11 +254,11 @@ def get_simple_vars_from_src(src):
250254
"setuptools_scm",
251255
],
252256
use_scm_version=True,
253-
install_requires=required,
257+
install_requires=REQUIRED,
254258
package_data={"exec_helpers": ["py.typed"]},
255259
)
256260
if cythonize is not None:
257-
setup_args["ext_modules"] = ext_modules
261+
setup_args["ext_modules"] = EXT_MODULES
258262
setup_args["cmdclass"] = dict(build_ext=AllowFailRepair)
259263

260264
try:

0 commit comments

Comments
 (0)