Skip to content

Commit

Permalink
Removed all remaining invoke support
Browse files Browse the repository at this point in the history
Fixes saltstack#64374

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
  • Loading branch information
s0undt3ch committed Nov 22, 2023
1 parent ea77548 commit 696f859
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 307 deletions.
104 changes: 10 additions & 94 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,16 @@ repos:
- salt-loaders
- check-virtual

- id: tools
alias: check-filemap
name: Check Filename Map Change Matching
files: ^tests/(filename_map\.yml|.*\.py)$
pass_filenames: false
args:
- pre-commit
- filemap
- check

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

- repo: https://github.com/saltstack/pip-tools-compile-impersonate
Expand Down Expand Up @@ -1039,56 +1049,6 @@ repos:
- requirements/static/ci/changelog.in
# <---- Changelog --------------------------------------------------------------------------------------------------

# ----- Invoke ---------------------------------------------------------------------------------------------------->
- id: pip-tools-compile
alias: compile-ci-invoke-3.7-requirements
name: Linux CI Py3.7 Invoke Requirements
files: ^requirements/static/ci/(invoke\.in|py3.7/(invoke|linux)\.txt)$
pass_filenames: false
args:
- -v
- --build-isolation
- --py-version=3.7
- --no-emit-index-url
- requirements/static/ci/invoke.in

- id: pip-tools-compile
alias: compile-ci-invoke-3.8-requirements
name: Linux CI Py3.8 Invoke Requirements
files: ^requirements/static/ci/(invoke\.in|py3.8/(invoke|linux)\.txt)$
pass_filenames: false
args:
- -v
- --build-isolation
- --py-version=3.8
- --no-emit-index-url
- requirements/static/ci/invoke.in

- id: pip-tools-compile
alias: compile-ci-invoke-3.9-requirements
name: Linux CI Py3.9 Invoke Requirements
files: ^requirements/static/ci/(invoke\.in|py3.9/(invoke|linux)\.txt)$
pass_filenames: false
args:
- -v
- --build-isolation
- --py-version=3.9
- --no-emit-index-url
- requirements/static/ci/invoke.in

- id: pip-tools-compile
alias: compile-ci-invoke-3.10-requirements
name: Linux CI Py3.10 Invoke Requirements
files: ^requirements/static/ci/(invoke\.in|py3.10/(invoke|linux)\.txt)$
pass_filenames: false
args:
- -v
- --build-isolation
- --py-version=3.10
- --no-emit-index-url
- requirements/static/ci/invoke.in
# <---- Invoke -----------------------------------------------------------------------------------------------------

# ----- Tools ---------------------------------------------------------------------------------------------------->
- id: pip-tools-compile
alias: compile-ci-tools-3.9-requirements
Expand Down Expand Up @@ -1242,50 +1202,6 @@ repos:
# <---- Security ---------------------------------------------------------------------------------------------------

# ----- Pre-Commit ------------------------------------------------------------------------------------------------>
- repo: https://github.com/saltstack/invoke-pre-commit
rev: v1.9.0
hooks:
- id: invoke
alias: check-filemap
name: Check Filename Map Change Matching
files: ^tests/(filename_map\.yml|.*\.py)$
pass_filenames: false
args:
- filemap.check
additional_dependencies:
- blessings==1.7
- pyyaml==6.0.1
- 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.1
- distro==1.7.0
- jinja2==3.0.3
- msgpack==1.0.3
- packaging
- looseversion

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.3.0
hooks:
Expand Down
2 changes: 1 addition & 1 deletion changelog/64374.fixed.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Migrated some [`invoke`](https://www.pyinvoke.org/) tasks to [`python-tools-scripts`](https://github.com/s0undt3ch/python-tools-scripts).
Migrated all [`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`
Expand Down
33 changes: 1 addition & 32 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1536,7 +1536,7 @@ def lint_salt(session):
paths = session.posargs
else:
# TBD replace paths entries when implement pyproject.toml
paths = ["setup.py", "noxfile.py", "salt/", "tasks/"]
paths = ["setup.py", "noxfile.py", "salt/"]
_lint(session, ".pylintrc", flags, paths)


Expand Down Expand Up @@ -1648,37 +1648,6 @@ def docs_man(session, compress, update, clean):
os.chdir("..")


@nox.session(name="invoke", python="3")
def invoke(session):
"""
Run invoke tasks
"""
if _upgrade_pip_setuptools_and_wheel(session):
_install_requirements(session)
requirements_file = os.path.join(
"requirements", "static", "ci", _get_pydir(session), "invoke.txt"
)
install_command = ["--progress-bar=off", "-r", requirements_file]
session.install(*install_command, silent=PIP_INSTALL_SILENT)

cmd = ["inv"]
files = []

# Unfortunately, invoke doesn't support the nargs functionality like argpase does.
# Let's make it behave properly
for idx, posarg in enumerate(session.posargs):
if idx == 0:
cmd.append(posarg)
continue
if posarg.startswith("--"):
cmd.append(posarg)
continue
files.append(posarg)
if files:
cmd.append("--files={}".format(" ".join(files)))
session.run(*cmd)


@nox.session(name="changelog", python="3")
@nox.parametrize("draft", [False, True])
@nox.parametrize("force", [False, True])
Expand Down
5 changes: 0 additions & 5 deletions requirements/static/ci/invoke.in

This file was deleted.

18 changes: 0 additions & 18 deletions requirements/static/ci/py3.10/invoke.txt

This file was deleted.

18 changes: 0 additions & 18 deletions requirements/static/ci/py3.7/invoke.txt

This file was deleted.

18 changes: 0 additions & 18 deletions requirements/static/ci/py3.8/invoke.txt

This file was deleted.

18 changes: 0 additions & 18 deletions requirements/static/ci/py3.9/invoke.txt

This file was deleted.

28 changes: 0 additions & 28 deletions tasks/README.md

This file was deleted.

11 changes: 0 additions & 11 deletions tasks/__init__.py

This file was deleted.

64 changes: 0 additions & 64 deletions tasks/utils.py

This file was deleted.

0 comments on commit 696f859

Please sign in to comment.