Skip to content

Commit

Permalink
Migrated some invoke tasks to python-tools-scripts
Browse files Browse the repository at this point in the history
* `tasks/docs.py` -> `tools/precommit/docs.py`
* `tasks/docstrings.py` -> `tools/precommit/docstrings.py`

Refs saltstack#64374

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
  • Loading branch information
s0undt3ch committed May 27, 2023
1 parent 03d54a4 commit f12ca89
Show file tree
Hide file tree
Showing 16 changed files with 508 additions and 409 deletions.
184 changes: 94 additions & 90 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ repos:
)$
- repo: https://github.com/s0undt3ch/python-tools-scripts
rev: "0.12.0"
rev: "0.13.2"
hooks:
- id: tools
alias: check-changelog-entries
Expand All @@ -55,12 +55,7 @@ repos:
- pre-commit
- changelog
- pre-commit-checks
additional_dependencies:
- boto3==1.21.46
- pyyaml==6.0
- jinja2==3.1.2
- packaging==23.0
- virustotal3==1.0.8

- id: tools
alias: generate-workflows
name: Generate GitHub Workflow Templates
Expand All @@ -70,12 +65,7 @@ repos:
- pre-commit
- workflows
- generate-workflows
additional_dependencies:
- boto3==1.21.46
- pyyaml==6.0
- jinja2==3.1.2
- packaging==23.0
- virustotal3==1.0.8

- id: tools
alias: actionlint
name: Lint GitHub Actions Workflows
Expand All @@ -86,17 +76,51 @@ repos:
- pre-commit
- workflows
- actionlint
additional_dependencies:
- boto3==1.21.46
- pyyaml==6.0
- jinja2==3.1.2
- packaging==23.0

- id: tools
alias: check-docs
name: Check Docs
files: ^(salt/.*\.py|doc/ref/.*\.rst)$
args:
- pre-commit
- docs
- check

- id: tools
alias: check-docstrings
name: Check docstrings
files: salt/.*\.py$
exclude: >
(?x)^(
templates/.*|
salt/ext/.*|
)$
args:
- pre-commit
- docstrings
- check

- id: tools
alias: check-known-missing-docstrings
name: Check Known Missing Docstrings
stages: [manual]
files: salt/.*\.py$
exclude: >
(?x)^(
templates/.*|
salt/ext/.*|
)$
args:
- pre-commit
- docstrings
- check

# ----- Packaging Requirements ------------------------------------------------------------------------------------>

- repo: https://github.com/saltstack/pip-tools-compile-impersonate
rev: "4.8"
hooks:

# ----- Packaging Requirements ------------------------------------------------------------------------------------>
- id: pip-tools-compile
alias: compile-pkg-linux-3.7-zmq-requirements
name: Linux Packaging Py3.7 ZeroMQ Requirements
Expand Down Expand Up @@ -1024,6 +1048,50 @@ repos:
- --py-version=3.10
- --pip-args=--constraint=requirements/static/ci/py{py_version}/linux.txt
- requirements/static/ci/tools.in

- id: pip-tools-compile
alias: compile-ci-tools-base-3.9-requirements
name: Linux CI Py3.9 Tools Base Requirements
files: ^requirements/static/ci/(tools-base\.in|py3.9/(tools-base|linux)\.txt)$
pass_filenames: false
args:
- -v
- --py-version=3.9
- --pip-args=--constraint=requirements/static/ci/py{py_version}/linux.txt
- requirements/static/ci/tools-base.in

- id: pip-tools-compile
alias: compile-ci-tools-base-3.10-requirements
name: Linux CI Py3.10 Tools Base Requirements
files: ^requirements/static/ci/(tools-base\.in|py3.10/(tools-base|linux)\.txt)$
pass_filenames: false
args:
- -v
- --py-version=3.10
- --pip-args=--constraint=requirements/static/ci/py{py_version}/linux.txt
- requirements/static/ci/tools-base.in

- id: pip-tools-compile
alias: compile-ci-tools-virustotal-3.9-requirements
name: Linux CI Py3.9 Tools virustotal Requirements
files: ^requirements/static/ci/(tools-virustotal\.in|py3.9/(tools-virustotal|linux)\.txt)$
pass_filenames: false
args:
- -v
- --py-version=3.9
- --pip-args=--constraint=requirements/static/ci/py{py_version}/linux.txt
- requirements/static/ci/tools-virustotal.in

- id: pip-tools-compile
alias: compile-ci-tools-virustotal-3.10-requirements
name: Linux CI Py3.10 Tools virustotal Requirements
files: ^requirements/static/ci/(tools-virustotal\.in|py3.10/(tools-virustotal|linux)\.txt)$
pass_filenames: false
args:
- -v
- --py-version=3.10
- --pip-args=--constraint=requirements/static/ci/py{py_version}/linux.txt
- requirements/static/ci/tools-virustotal.in
# <---- Tools -----------------------------------------------------------------------------------------------------

# ----- Code Formatting ------------------------------------------------------------------------------------------->
Expand Down Expand Up @@ -1137,24 +1205,6 @@ repos:
# <---- Security ---------------------------------------------------------------------------------------------------

# ----- Pre-Commit ------------------------------------------------------------------------------------------------>
- repo: https://github.com/saltstack/invoke-pre-commit
rev: v1.9.0
hooks:
- id: invoke
alias: check-docs
name: Check Docs
files: ^(salt/.*\.py|doc/ref/.*\.rst)$
args:
- docs.check
additional_dependencies:
- blessings==1.7
- pyyaml==6.0
- distro==1.7.0
- jinja2==3.0.3
- msgpack==1.0.3
- packaging
- looseversion

- repo: https://github.com/saltstack/invoke-pre-commit
rev: v1.9.0
hooks:
Expand All @@ -1174,9 +1224,6 @@ repos:
- packaging
- looseversion

- repo: https://github.com/saltstack/invoke-pre-commit
rev: v1.9.0
hooks:
- id: invoke
alias: loader-check-virtual
name: Check loader modules __virtual__
Expand All @@ -1197,68 +1244,25 @@ repos:
- packaging
- looseversion

- repo: https://github.com/saltstack/invoke-pre-commit
rev: v1.9.0
hooks:
- id: invoke
alias: check-docstrings
name: Check docstrings
files: salt/.*\.py$
exclude: >
(?x)^(
templates/.*|
salt/ext/.*|
)$
args:
- docstrings.check
additional_dependencies:
- blessings==1.7
- pyyaml==6.0
- distro==1.7.0
- jinja2==3.0.3
- msgpack==1.0.3
- packaging
- looseversion

- repo: https://github.com/saltstack/invoke-pre-commit
rev: v1.9.0
hooks:
- id: invoke
alias: check-known-missing-docstrings
name: Check Known Missing Docstrings
stages: [manual]
files: salt/.*\.py$
exclude: >
(?x)^(
templates/.*|
salt/ext/.*|
)$
args:
- docstrings.check
- --error-on-known-failures
additional_dependencies:
- blessings==1.7
- pyyaml==6.0
- distro==1.7.0
- jinja2==3.0.3
- msgpack==1.0.3
- packaging
- looseversion

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.0.0
rev: v1.3.0
hooks:
- id: mypy
alias: mypy-tools
name: Run mypy against tools
files: ^tools/.*\.py$
#args: [--strict]
exclude: >
(?x)^(
templates/.*|
salt/.*|
)$
additional_dependencies:
- attrs
- rich
- types-attrs
- types-pyyaml
- types-requests
- python-tools-scripts

- repo: https://github.com/saltstack/mirrors-nox
rev: v2021.6.12
Expand Down
4 changes: 4 additions & 0 deletions changelog/64374.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Migrated some [`invoke`](https://www.pyinvoke.org/) tasks to [`python-tools-scripts`](https://github.com/s0undt3ch/python-tools-scripts).

* `tasks/docs.py` -> `tools/precommit/docs.py`
* `tasks/docstrings.py` -> `tools/precommit/docstrings.py`
34 changes: 34 additions & 0 deletions requirements/static/ci/py3.10/tools-base.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --output-file=requirements/static/ci/py3.10/tools-base.txt --pip-args='--constraint=requirements/static/ci/py3.10/linux.txt' requirements/static/ci/tools-base.in
#
boto3==1.26.142
# via -r requirements/static/ci/tools-base.in
botocore==1.29.142
# via
# boto3
# s3transfer
jinja2==3.1.2
# via -r requirements/static/ci/tools-base.in
jmespath==1.0.1
# via
# boto3
# botocore
markupsafe==2.1.2
# via jinja2
packaging==23.1
# via -r requirements/static/ci/tools-base.in
python-dateutil==2.8.2
# via botocore
pyyaml==6.0
# via -r requirements/static/ci/tools-base.in
s3transfer==0.6.1
# via boto3
six==1.16.0
# via python-dateutil
urllib3==1.26.16
# via
# -c requirements/static/ci/py3.10/tools.txt
# botocore
28 changes: 28 additions & 0 deletions requirements/static/ci/py3.10/tools-virustotal.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --output-file=requirements/static/ci/py3.10/tools-virustotal.txt --pip-args='--constraint=requirements/static/ci/py3.10/linux.txt' requirements/static/ci/tools-virustotal.in
#
certifi==2023.5.7
# via
# -c requirements/static/ci/py3.10/tools.txt
# requests
charset-normalizer==3.1.0
# via
# -c requirements/static/ci/py3.10/tools.txt
# requests
idna==3.4
# via
# -c requirements/static/ci/py3.10/tools.txt
# requests
requests==2.31.0
# via
# -c requirements/static/ci/py3.10/tools.txt
# virustotal3
urllib3==1.26.16
# via
# -c requirements/static/ci/py3.10/tools.txt
# requests
virustotal3==1.0.8
# via -r requirements/static/ci/tools-virustotal.in
62 changes: 16 additions & 46 deletions requirements/static/ci/py3.10/tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,57 +4,27 @@
#
# pip-compile --output-file=requirements/static/ci/py3.10/tools.txt --pip-args='--constraint=requirements/static/ci/py3.10/linux.txt' requirements/static/ci/tools.in
#
attrs==22.1.0
# via
# -r requirements/static/ci/tools.in
# python-tools-scripts
boto3==1.21.46
# via -r requirements/static/ci/tools.in
botocore==1.24.46
# via
# boto3
# s3transfer
certifi==2022.12.7
attrs==23.1.0
# via python-tools-scripts
certifi==2023.5.7
# via requests
charset-normalizer==3.0.1
charset-normalizer==3.1.0
# via requests
commonmark==0.9.1
# via rich
idna==3.4
# via requests
jinja2==3.1.2
# via -r requirements/static/ci/tools.in
jmespath==1.0.1
# via
# boto3
# botocore
markupsafe==2.1.2
# via jinja2
packaging==23.0
# via -r requirements/static/ci/tools.in
pygments==2.13.0
markdown-it-py==2.2.0
# via rich
python-dateutil==2.8.2
# via botocore
python-tools-scripts==0.12.0
# via -r requirements/static/ci/tools.in
pyyaml==6.0
mdurl==0.1.2
# via markdown-it-py
pygments==2.15.1
# via rich
python-tools-scripts==0.13.2
# via -r requirements/static/ci/tools.in
requests==2.28.2
# via
# python-tools-scripts
# virustotal3
rich==12.5.1
requests==2.31.0
# via python-tools-scripts
s3transfer==0.5.2
# via boto3
six==1.16.0
# via python-dateutil
typing-extensions==4.4.0
rich==13.3.5
# via python-tools-scripts
urllib3==1.26.12
# via
# botocore
# requests
virustotal3==1.0.8
# via -r requirements/static/ci/tools.in
typing-extensions==4.6.2
# via python-tools-scripts
urllib3==1.26.16
# via requests
Loading

0 comments on commit f12ca89

Please sign in to comment.