Skip to content

Commit 7b76ca0

Browse files
mgautierfrrenaud gaudin
authored andcommitted
Replace rebuild.sh by a task.py
`task.py` is a description file for invoke (https://www.pyinvoke.org/)
1 parent 683590e commit 7b76ca0

File tree

4 files changed

+51
-7
lines changed

4 files changed

+51
-7
lines changed

rebuild.sh

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

requirements-dev.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
isort
2+
black
3+
flake8
4+
pytest

setup.cfg

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,8 @@ packages =
3939
libzim
4040
python_requires =
4141
>=3.6
42-
42+
setup_requires =
43+
cython
44+
test_requires =
45+
pytest
4346

tasks.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/env python3
2+
3+
4+
"""
5+
A description file for invoke (https://www.pyinvoke.org/)
6+
"""
7+
8+
from invoke import task
9+
10+
11+
@task
12+
def build_ext(c):
13+
c.run("python setup.py build_ext -i")
14+
15+
16+
@task
17+
def test(c):
18+
c.run(f"python -m pytest --color=yes --ff")
19+
20+
21+
@task
22+
def clean(c):
23+
c.run("rm -rf build")
24+
c.run("rm *.so")
25+
26+
27+
@task
28+
def install_dev(c):
29+
c.run("pip install -r requirements-dev.txt")
30+
31+
32+
@task
33+
def lint(c):
34+
c.run("isort .")
35+
c.run("black .")
36+
c.run("flake8 .")
37+
38+
39+
if __name__ == "__main__":
40+
print("""\
41+
This file is not intended to be directly run.
42+
Install invoke and run the `invoke` command line.
43+
""")

0 commit comments

Comments
 (0)