Skip to content

Commit

Permalink
Updated pre-commit, GitHub actions, and support of Salt (#407)
Browse files Browse the repository at this point in the history
* Updated pre-commit, GitHub actions, and support of Salt

* Updates files due to modified pre-commit

* Restored black to pre-commit

* Updated pre-commit and blackened files

* Reduced rstcheck to v 5.0.0

* Trying adding setuptools to install requirements for Windows and MacOS building

* Trying latest pyvmomi

* Dropping minimum Python version to 3.9

* Forcing setuptools 68.2.2

* Debugging pyvmomi installation

* Retrying after successful build, with mimimizing changes

* Reversed to Python 3.10 and forced install of setuptools and pyvmomi for Windows and MacOS

* Removed missed Python 3.9
  • Loading branch information
dmurphy18 authored Sep 13, 2024
1 parent 1fa6a84 commit 4b9121d
Show file tree
Hide file tree
Showing 185 changed files with 1,023 additions and 942 deletions.
34 changes: 19 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ jobs:
Pre-Commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Set Cache Key
Expand All @@ -18,11 +18,11 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y libxml2 libxml2-dev libxslt-dev
- uses: actions/cache@v1
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- uses: pre-commit/action@v1.0.1
- uses: pre-commit/action@v3.0.1

Docs:
runs-on: ubuntu-latest
Expand All @@ -31,10 +31,10 @@ jobs:
timeout-minutes: 10

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python 3.10 For Nox
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"

Expand Down Expand Up @@ -69,10 +69,10 @@ jobs:
- 3006.9

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand Down Expand Up @@ -166,7 +166,7 @@ jobs:
- name: Upload Logs
if: always()
uses: actions/upload-artifact@main
uses: actions/upload-artifact@v4
with:
name: runtests-${{ runner.os }}-py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}.log
path: artifacts/runtests-*.log
Expand All @@ -187,17 +187,19 @@ jobs:
- 3006.9

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Nox
run: |
python -m pip install --upgrade pip
pip install nox
pip install setuptools==68.2.2
pip install pyvmomi==7.0.3
- name: Install Test Requirements
shell: bash
Expand Down Expand Up @@ -288,7 +290,7 @@ jobs:
- name: Upload Logs
if: always()
uses: actions/upload-artifact@main
uses: actions/upload-artifact@v4
with:
name: runtests-${{ runner.os }}-py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}.log
path: artifacts/runtests-*.log
Expand All @@ -309,17 +311,19 @@ jobs:
- 3006.9

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Nox
run: |
python -m pip install --upgrade pip
pip install nox
pip install setuptools==68.2.2
pip install pyvmomi==7.0.3
- name: Install Test Requirements
env:
Expand Down Expand Up @@ -406,7 +410,7 @@ jobs:
- name: Upload Logs
if: always()
uses: actions/upload-artifact@main
uses: actions/upload-artifact@v4
with:
name: runtests-${{ runner.os }}-py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}.log
path: artifacts/runtests-*.log
147 changes: 23 additions & 124 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ default_language_version:
python: python3

exclude: ^(doc/_static/.*|doc/_themes/.*)$
minimum_pre_commit_version: 2.4.0
minimum_pre_commit_version: 3.6.0
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: check-merge-conflict # Check for files that contain merge conflict strings.
- id: trailing-whitespace # Trims trailing whitespace.
Expand Down Expand Up @@ -47,11 +47,11 @@ repos:
# ----- Formatting ---------------------------------------------------------------------------->
- repo: https://github.com/asottile/pyupgrade
rev: v2.37.2
rev: v3.17.0
hooks:
- id: pyupgrade
name: Rewrite Code to be Py3.7+, drop six usage and Py2 support
args: [--py3-plus, --keep-mock]
name: Rewrite Code to be Py3.10+, drop six usage and Py2 support
args: [--py310-plus, --keep-mock]
exclude: src/saltext/vcenter/version.py

- repo: https://github.com/saltstack/pre-commit-remove-import-headers
Expand All @@ -75,9 +75,9 @@ repos:
language: system
pass_filenames: false

- repo: https://github.com/s0undt3ch/salt-rewrite
- repo: https://github.com/saltstack/salt-rewrite
# Automatically rewrite code with known rules
rev: "2.2.0"
rev: 2.5.2
hooks:
- id: salt-rewrite
alias: rewrite-docstrings
Expand All @@ -91,34 +91,32 @@ repos:
files: ^tests/.*\.py$
args: [--silent, -E, fix_asserts, -E, fix_docstrings]

- repo: https://github.com/asottile/reorder_python_imports
rev: v3.10.0
hooks:
- id: reorder-python-imports
args: [
--py3-plus,
]
exclude: src/saltext/vcenter/version.py
## - repo: https://github.com/asottile/reorder_python_imports
## rev: v3.13.0
## hooks:
## - id: reorder-python-imports
## args: [
## --py310-plus,
## ]
## exclude: src/saltext/vcenter/version.py

- repo: https://github.com/psf/black
rev: 22.6.0
rev: 24.8.0
hooks:
- id: black
args: [-l 100]
exclude: src/saltext/vcenter/version.py
additional_dependencies:
- click<8.1.0
args: [-tpy310]
exclude: ^src/saltext/vcenter/version.py

- repo: https://github.com/asottile/blacken-docs
rev: v1.7.0
rev: 1.18.0
hooks:
- id: blacken-docs
args: [--skip-errors]
files: ^docs/.*\.rst
additional_dependencies: [black==20.8b1]
additional_dependencies: [black==24.8.0]

- repo: https://github.com/myint/rstcheck
rev: 3f92957
rev: v5.0.0
hooks:
- id: rstcheck
name: Check reST files using rstcheck
Expand All @@ -128,7 +126,7 @@ repos:

# ----- Security ------------------------------------------------------------------------------>
- repo: https://github.com/PyCQA/bandit
rev: "1.7.4"
rev: "1.7.9"
hooks:
- id: bandit
alias: bandit-salt
Expand All @@ -137,7 +135,7 @@ repos:
exclude: src/saltext/vcenter/version.py
additional_dependencies: ['importlib_metadata<5']
- repo: https://github.com/PyCQA/bandit
rev: "1.7.4"
rev: "1.7.9"
hooks:
- id: bandit
alias: bandit-tests
Expand Down Expand Up @@ -180,39 +178,6 @@ repos:
- repo: https://github.com/saltstack/pip-tools-compile-impersonate
rev: '4.8'
hooks:
- id: pip-tools-compile
alias: compile-3.7-test-requirements
name: Py3.7 Test Requirements
files: ^requirements/tests.in$
pass_filenames: false
args:
- -v
- --py-version=3.7
- --platform=linux
- requirements/tests.in

- id: pip-tools-compile
alias: compile-3.8-test-requirements
name: Py3.8 Test Requirements
files: ^requirements/tests.in$
pass_filenames: false
args:
- -v
- --py-version=3.8
- --platform=linux
- requirements/tests.in

- id: pip-tools-compile
alias: compile-3.9-test-requirements
name: Py3.9 Test Requirements
files: ^requirements/tests.in$
pass_filenames: false
args:
- -v
- --py-version=3.9
- --platform=linux
- requirements/tests.in

- id: pip-tools-compile
alias: compile-3.10-test-requirements
name: Py3.10 Test Requirements
Expand All @@ -226,39 +191,6 @@ repos:
# <---- Static Test Requirements ---------------------------------------------------------------

# ----- Static Lint Requirements -------------------------------------------------------------->
- id: pip-tools-compile
alias: compile-3.7-test-requirements
name: Py3.7 Lint Requirements
files: ^requirements/lint.in$
pass_filenames: false
args:
- -v
- --py-version=3.7
- --platform=linux
- requirements/lint.in

- id: pip-tools-compile
alias: compile-3.8-test-requirements
name: Py3.8 Lint Requirements
files: ^requirements/lint.in$
pass_filenames: false
args:
- -v
- --py-version=3.8
- --platform=linux
- requirements/lint.in

- id: pip-tools-compile
alias: compile-3.9-test-requirements
name: Py3.9 Lint Requirements
files: ^requirements/lint.in$
pass_filenames: false
args:
- -v
- --py-version=3.9
- --platform=linux
- requirements/lint.in

- id: pip-tools-compile
alias: compile-3.10-test-requirements
name: Py3.10 Lint Requirements
Expand All @@ -272,39 +204,6 @@ repos:
# <---- Static Lint Requirements ---------------------------------------------------------------

# ----- Static Docs Requirements -------------------------------------------------------------->
- id: pip-tools-compile
alias: compile-3.7-test-requirements
name: Py3.7 Docs Requirements
files: ^requirements/docs.in$
pass_filenames: false
args:
- -v
- --py-version=3.7
- --platform=linux
- requirements/docs.in

- id: pip-tools-compile
alias: compile-3.8-test-requirements
name: Py3.8 Docs Requirements
files: ^requirements/docs.in$
pass_filenames: false
args:
- -v
- --py-version=3.8
- --platform=linux
- requirements/docs.in

- id: pip-tools-compile
alias: compile-3.9-test-requirements
name: Py3.9 Docs Requirements
files: ^requirements/docs.in$
pass_filenames: false
args:
- -v
- --py-version=3.9
- --platform=linux
- requirements/docs.in

- id: pip-tools-compile
alias: compile-3.10-test-requirements
name: Py3.10 Docs Requirements
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
if this_year == 2020:
copyright_year = 2020
else:
copyright_year = "2020 - {}".format(this_year)
copyright_year = f"2020 - {this_year}"
project = dist.metadata["Summary"]
author = dist.metadata["Author"]
copyright = "{}, {}".format(copyright_year, author)
copyright = f"{copyright_year}, {author}"

# The full version, including alpha/beta/rc tags
release = dist.version
Expand Down
Loading

0 comments on commit 4b9121d

Please sign in to comment.