Skip to content

Commit

Permalink
Merge pull request #37 from lkubb/copier-update
Browse files Browse the repository at this point in the history
  • Loading branch information
lkubb authored Aug 8, 2024
2 parents f347632 + b626d0d commit fb277a2
Show file tree
Hide file tree
Showing 21 changed files with 146 additions and 94 deletions.
14 changes: 10 additions & 4 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
# Autogenerated. Do not edit this by hand, use `copier update`.
---
_commit: 0.2.6
_commit: 0.3.7
_src_path: https://github.com/lkubb/salt-extension-copier
author: EITR Technologies, LLC
author_email: [email protected]
docs_url: ''
coc_contact: [email protected]
copyright_begin: 2023
deploy_docs: rolling
docs_url: https://salt-extensions.github.io/saltext-proxmox/
integration_name: Proxmox PVE
license: apache
loaders:
- cloud
max_salt_version: 3006
max_salt_version: 3007
no_saltext_namespace: false
package_name: proxmox
project_name: proxmox
python_requires: '3.8'
salt_version: '3005'
source_url: https://github.com/salt-extensions/saltext-proxmox
ssh_fixtures: false
summary: Salt Extension for interacting with Proxmox
summary: Salt Extension for interacting with Proxmox PVE
test_containers: false
tracker_url: https://github.com/salt-extensions/saltext-proxmox/issues
url: https://github.com/salt-extensions/saltext-proxmox
workflows: org
4 changes: 3 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ jobs:
name: CI
uses: salt-extensions/central-artifacts/.github/workflows/ci.yml@main
with:
setup-vault: true
deploy-docs: true
permissions:
contents: write
id-token: write
pages: write
pull-requests: read
5 changes: 3 additions & 2 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,18 @@ jobs:

- name: Extract tag name
id: get_version
run: echo "::set-output name=version::$(echo ${GITHUB_REF#refs/tags/v})"
run: echo "version=$(echo ${GITHUB_REF#refs/tags/v})" >> $GITHUB_OUTPUT

call_central_workflow:
needs: get_tag_version
uses: salt-extensions/central-artifacts/.github/workflows/ci.yml@main
with:
setup-vault: true
deploy-docs: true
release: true
version: ${{ needs.get_tag_version.outputs.version }}
permissions:
contents: write
id-token: write
pages: write
pull-requests: read
secrets: inherit
28 changes: 14 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
minimum_pre_commit_version: 2.4.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 @@ -56,7 +56,7 @@ repos:
args: [--silent, -E, fix_docstrings]

- repo: https://github.com/asottile/pyupgrade
rev: v2.37.2
rev: v3.15.2
hooks:
- id: pyupgrade
name: Rewrite Code to be Py3.8+
Expand All @@ -65,43 +65,43 @@ repos:
]
exclude: src/saltext/proxmox/version.py

- repo: https://github.com/asottile/reorder_python_imports
rev: v3.10.0
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: reorder-python-imports
- id: isort
args: [
--py38-plus,
--py 38,
]
exclude: src/saltext/proxmox/version.py
exclude: src/saltext/proxmox/(__init__|version).py

- repo: https://github.com/psf/black
rev: 22.6.0
rev: 24.2.0
hooks:
- id: black
args: [-l 100]
exclude: src/saltext/proxmox/version.py

- repo: https://github.com/adamchainz/blacken-docs
rev: v1.12.1
rev: 1.16.0
hooks:
- id: blacken-docs
args: [--skip-errors]
files: ^(docs/.*\.rst|src/saltext/proxmox/.*\.py)$
additional_dependencies:
- black==22.6.0
- black==24.2.0
# <---- Formatting -----------------------------------------------------------------------------

# ----- Security ------------------------------------------------------------------------------>
- repo: https://github.com/PyCQA/bandit
rev: "1.7.4"
rev: 1.7.8
hooks:
- id: bandit
alias: bandit-salt
name: Run bandit against the code base
args: [--silent, -lll, --skip, B701]
exclude: src/saltext/proxmox/version.py
- repo: https://github.com/PyCQA/bandit
rev: "1.7.4"
rev: 1.7.8
hooks:
- id: bandit
alias: bandit-tests
Expand All @@ -112,7 +112,7 @@ repos:

# ----- Code Analysis ------------------------------------------------------------------------->
- repo: https://github.com/saltstack/mirrors-nox
rev: v2021.6.12
rev: v2022.11.21
hooks:
- id: nox
alias: lint-src
Expand All @@ -125,7 +125,7 @@ repos:
- --

- repo: https://github.com/saltstack/mirrors-nox
rev: v2021.6.12
rev: v2022.11.21
hooks:
- id: nox
alias: lint-tests
Expand Down
1 change: 0 additions & 1 deletion .pre-commit-hooks/make-autodocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import subprocess
from pathlib import Path


repo_path = Path(subprocess.check_output(["git", "rev-parse", "--show-toplevel"]).decode().strip())
src_dir = repo_path / "src" / "saltext" / "proxmox"
doc_dir = repo_path / "docs"
Expand Down
2 changes: 1 addition & 1 deletion CODE-OF-CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Our Pledge

We as members, contributors, and leaders pledge to make participation in Salt
Extension Modules for Proxmox cloud project and our community a
Extension Modules for Proxmox PVE project and our community a
harassment-free experience for everyone, regardless of age, body size, visible
or invisible disability, ethnicity, sex characteristics, gender identity and
expression, level of experience, education, socio-economic status, nationality,
Expand Down
14 changes: 14 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Thanks for your interest in contributing to the Salt Extension Modules for
Proxmox PVE! We welcome any contribution, large or small - from
adding a new feature to fixing a single letter typo.

This is a companion to the Salt Project and the [Salt Contributing
Guide][salt-contributing] should be considered the default for this project.
Where this project disagrees with the Salt Project, the guidelines here take
precedence. Where this project is silent, the Salt guidelines should be used.

See the **Contributing** section in the [README][README.md] for a quickstart.


[README.md]: README.md
[salt-contributing]: https://docs.saltproject.io/en/master/topics/development/contributing.html
2 changes: 1 addition & 1 deletion NOTICE.txt → NOTICE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Salt Extension Modules for Proxmox cloud
Salt Extension Modules for Proxmox PVE
Copyright 2023 EITR Technologies, LLC

This product is licensed to you under the Apache 2.0 license (the "License").
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Salt Extension for Proxmox
# Salt Extension for Proxmox PVE

Salt Extension for interacting with Proxmox PVE

## Security

If you think you've found a security vulnerability, see
If you think you have found a security vulnerability, see
[Salt's security guide][security].

## User Documentation

This README is for people aiming to contribute to the project.
If you just want to get started with the extension, check out the
module docstrings (for now, documentation is coming!).
[User Documentation][docs].

## Contributing

Expand Down Expand Up @@ -64,11 +64,11 @@ these areas:
You could also contribute in other ways:

* Writing blog posts
* Posting on social media about how you used Salt+Proxmox to solve your
* Posting on social media about how you used Salt + Proxmox PVE to solve your
problems, including videos
* Giving talks at conferences
* Publishing videos
* Asking/answering questions in IRC, Slack, or email groups
* Asking/answering questions in IRC, Discord or email groups

Any of these things are super valuable to our community, and we sincerely
appreciate every contribution!
Expand All @@ -84,3 +84,4 @@ that's where you'll find the rest of the documentation.
[PRs]: https://github.com/salt-extensions/saltext-proxmox/pulls
[discussions]: https://github.com/salt-extensions/saltext-proxmox/discussions
[comments]: https://conventionalcomments.org/
[docs]: https://salt-extensions.github.io/saltext-proxmox/
18 changes: 18 additions & 0 deletions docs/_ext/saltdomain.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""
Copied/distilled from Salt doc/_ext/saltdomain.py in order to be able
to use Salt's custom doc refs.
"""


def setup(app):
app.add_crossref_type(
directivename="conf_master",
rolename="conf_master",
indextemplate="pair: %s; conf/master",
)
app.add_crossref_type(
directivename="conf_minion",
rolename="conf_minion",
indextemplate="pair: %s; conf/minion",
)
return {"parallel_read_safe": True, "parallel_write_safe": True}
11 changes: 7 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@

# -- Project information -----------------------------------------------------
this_year = datetime.datetime.today().year
if this_year == 2021:
copyright_year = 2021
if this_year == 2023:
copyright_year = "2023"
else:
copyright_year = f"2021 - {this_year}"
copyright_year = f"2023 - {this_year}"
project = dist.metadata["Summary"]
author = dist.metadata["Author"]
author = dist.metadata.get("Author")

if author is None:
# Core metadata is serialized differently with pyproject.toml:
Expand Down Expand Up @@ -79,6 +79,8 @@

# -- General configuration ---------------------------------------------------

linkcheck_ignore = [r"http://localhost:\d+"]

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
Expand All @@ -92,6 +94,7 @@
"sphinx.ext.coverage",
"sphinx_copybutton",
"sphinxcontrib.spelling",
"saltdomain",
"sphinxcontrib.towncrier.ext",
"myst_parser",
"sphinx_inline_tabs",
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
``saltext-proxmox``: Integrate Salt with Proxmox
================================================

Salt Extension for interacting with Proxmox
Salt Extension for interacting with Proxmox PVE

.. toctree::
:maxdepth: 2
Expand Down
8 changes: 0 additions & 8 deletions docs/topics/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,7 @@ pip install saltext-proxmox
```
:::

:::{important}
Currently, there is [an issue][issue-second-saltext] where the installation of a Saltext fails silently
if the environment already has another one installed. You can workaround this by
removing all Saltexts and reinstalling them in one transaction.
:::

:::{hint}
Saltexts are not distributed automatically via the fileserver like custom modules, they need to be installed
on each node you want them to be available on.
:::

[issue-second-saltext]: https://github.com/saltstack/salt/issues/65433
10 changes: 4 additions & 6 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
nox.options.error_on_missing_interpreters = False

# Python versions to test against
PYTHON_VERSIONS = ("3", "3.8", "3.9", "3.10")
PYTHON_VERSIONS = ("3", "3.8", "3.9", "3.10", "3.11", "3.12")
# Be verbose when running under a CI context
CI_RUN = (
os.environ.get("JENKINS_URL") or os.environ.get("CI") or os.environ.get("DRONE") is not None
)
PIP_INSTALL_SILENT = CI_RUN is False
SKIP_REQUIREMENTS_INSTALL = "SKIP_REQUIREMENTS_INSTALL" in os.environ
SKIP_REQUIREMENTS_INSTALL = os.environ.get("SKIP_REQUIREMENTS_INSTALL", "0") == "1"
EXTRA_REQUIREMENTS_INSTALL = os.environ.get("EXTRA_REQUIREMENTS_INSTALL")

COVERAGE_VERSION_REQUIREMENT = "coverage==5.2"
COVERAGE_REQUIREMENT = os.environ.get("COVERAGE_REQUIREMENT") or "coverage==7.5.1"
SALT_REQUIREMENT = os.environ.get("SALT_REQUIREMENT") or "salt>=3005"
if SALT_REQUIREMENT == "salt==master":
SALT_REQUIREMENT = "git+https://github.com/saltstack/salt.git@master"
Expand Down Expand Up @@ -89,9 +89,7 @@ def _install_requirements(
# Always have the wheel package installed
session.install("--progress-bar=off", "wheel", silent=PIP_INSTALL_SILENT)
if install_coverage_requirements:
session.install(
"--progress-bar=off", COVERAGE_VERSION_REQUIREMENT, silent=PIP_INSTALL_SILENT
)
session.install("--progress-bar=off", COVERAGE_REQUIREMENT, silent=PIP_INSTALL_SILENT)

if install_salt:
session.install("--progress-bar=off", SALT_REQUIREMENT, silent=PIP_INSTALL_SILENT)
Expand Down
Loading

0 comments on commit fb277a2

Please sign in to comment.