-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
52 lines (44 loc) · 1.58 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
desc 'Clean project'
task :clean do
sh 'find . -print0 -name "__pycache__" -exec rm -rf {} \; > /dev/null'
sh 'find . -print0 -name "*.pyc" -exec rm -f {} \; >/dev/null'
end
namespace :test do
desc 'Python linter'
task:lint do
sh 'pylint --disable=too-many-public-methods,missing-docstring src/descriptor.py'
sh 'pylint --disable=too-many-public-methods,missing-docstring src/schema.py'
sh 'pylint --disable=too-many-public-methods,missing-docstring src/error.py'
sh 'pylint --disable=too-many-public-methods,missing-docstring test/test_schema_processing.py'
sh 'pylint --disable=too-many-public-methods,missing-docstring test/test_validation.py'
end
desc 'Type checker'
task :type do
sh 'mypy --ignore-missing-imports src/descriptor.py'
sh 'mypy --ignore-missing-imports src/schema.py'
sh 'mypy --ignore-missing-imports src/error.py'
end
desc 'Unit tests'
task :unit do
sh 'coverage run --source src test/test_schema_processing.py --verbose'
sh 'coverage run --source src test/test_validation.py --verbose'
end
desc 'Test coverage'
task :coverage => :unit do
sh 'coverage report -m'
end
desc 'All tests'
task :all => [:lint, :type, :unit, :coverage]
end
namespace :docker do
desc 'Build Docker image'
task :build do
sh 'docker build -t csizsek/jysp:latest .'
end
desc 'Push image to registry'
task :push do
sh 'docker push csizsek/jysp:latest'
end
desc 'Docker build and push'
task :all => [:build, :push]
end