-
Notifications
You must be signed in to change notification settings - Fork 61
/
Makefile
126 lines (93 loc) · 3.11 KB
/
Makefile
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# -*- mode:makefile; coding:utf-8 -*-
# Copyright (c) 2020 IBM Corp. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
submodules:
git submodule update --init
# switch the nist oscal submodules to the develop branch to work with future oscal schemas
nist-dev:
git submodule set-branch --branch develop nist-source
git submodule update --remote
# switch the nist oscal submodules back to the default supported release tag
nist-default:
git submodule set-branch --branch release-1.0 nist-source
git submodule update --remote
develop: submodules
python -m pip install -e .[dev] --upgrade --upgrade-strategy eager --
pre-commit:
pre-commit install
pre-commit-update:
pre-commit autoupdate
install:
python -m pip install --upgrade pip setuptools
python -m pip install . --upgrade --upgrade-strategy eager
code-format:
pre-commit run yapf --all-files
code-lint:
pre-commit run flake8 --all-files
code-typing:
mypy --pretty trestle
test-all::
python -m pytest -n auto
test::
python -m pytest --exitfirst -n auto
test-cov::
python -m pytest --cov=trestle --exitfirst -n auto -vv --cov-report=xml --cov-fail-under=96
test-all-random::
python -m pytest --cov=trestle --cov-report=xml --random-order
test-verbose:
python -m pytest -vv -n auto
test-speed-measure:
python -m pytest -n auto --durations=30
test-fast:
python -m pytest -n auto --exitfirst -k "not fetcher and not from_nist and not from_url"
test-bdist:: clean
. tests/manual_tests/test_binary.sh
release::
git config --global user.name "semantic-release (via Github actions)"
git config --global user.email "semantic-release@github-actions"
semantic-release publish
gen-oscal::
python ./scripts/gen_oscal.py
docs-osx-deps:
brew install cairo freetype libffi libjpeg libpng zlib
docs-ubuntu-deps:
sudo apt-get -y install libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev
docs-automation::
python ./scripts/website_automation.py
docs-validate:: docs-automation
mkdocs build -c -s
rm -rf site
docs-serve: docs-automation
mkdocs serve
mdformat:
pre-commit run mdformat --all-files
simplified-catalog:
python ./scripts/simplify_retain_ac.py ./nist-content/nist.gov/SP800-53/rev5/json/NIST_SP-800-53_rev5_catalog.json ./tests/data/json/simplified_nist_catalog.json
# POSIX ONLY
clean::
rm -rf build
rm -rf dist
rm -rf .pytest_cache
rm -rf tmp_bin_test
rm -rf cov_html
rm -rf coverage.xml
rm -rf .coverage*
rm -rf .mypy_cache
find . | grep -E "__pycache__|\.pyc|\.pyo" | xargs rm -rf
pylint:
pylint trestle
pylint-test:
pylint tests --rcfile=.pylintrc_tests
check-for-changes:
python scripts/have_files_changed.py -u