Skip to content

Commit a75224f

Browse files
Merge pull request saltstack#31 from scriptautomate-bc/update-install-guide-doc
Update pre-commit, nox, and devcontainer standards
2 parents e75a5f0 + c2a1385 commit a75224f

File tree

7 files changed

+79
-51
lines changed

7 files changed

+79
-51
lines changed

.devcontainer.json

Lines changed: 0 additions & 35 deletions
This file was deleted.

.devcontainer/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM bitnami/python:3.13
2+
3+
RUN apt update && apt upgrade -y && apt install vim -y
4+
5+
# Add dev requirements
6+
ADD requirements.txt /tmp/
7+
RUN pip3 install -r /tmp/requirements.txt
8+
RUN rm /tmp/requirements.txt
9+
10+
# Help avoid "unsupported locale setting" in Sphinx
11+
RUN echo "export LC_ALL=C.UTF-8" > ~/.bashrc

.devcontainer/devcontainer.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
{
3+
"name": "salt-install-guide",
4+
5+
// README at: https://github.com/devcontainers/templates/tree/main/src/python
6+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
7+
// Python container image is needed for running python-based tests (ex. orphaned-content.py)
8+
// "image": "mcr.microsoft.com/devcontainers/python:3.13-bookworm",
9+
10+
"build": {
11+
"dockerfile": "Dockerfile"
12+
},
13+
14+
// Features to add to the dev container. More info: https://containers.dev/features.
15+
// "features": {
16+
// node / npm is required for markdownlint-cli2
17+
// By default, installs lts version
18+
// "ghcr.io/devcontainers/features/node:1": {}
19+
// },
20+
21+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
22+
// "forwardPorts": [],
23+
24+
// Use 'postCreateCommand' to run commands after the container is created.
25+
// "postCreateCommand": ""
26+
27+
// There is also a postStartCommand that executes every time the container starts.
28+
// The parameters behave exactly like postCreateCommand, but the commands execute on start rather than create.
29+
// "postStartCommand": ""
30+
31+
// There is also a postAttachCommand that executes every time the container attaches to a workspace.
32+
// The parameters behave exactly like postCreateCommand, but the commands execute on a started container after the workspace is available under /workspaces/
33+
// "postAttachCommand": {},
34+
35+
// Configure tool-specific properties.
36+
"customizations": {
37+
// Configure properties specific to VS Code.
38+
"vscode": {
39+
// Add the IDs of extensions you want installed when the container is created.
40+
"extensions": [
41+
// Extension to work with Python
42+
"ms-python.python"
43+
]
44+
}
45+
}
46+
47+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
48+
// "remoteUser": "root"
49+
}

.github/workflows/build-sphinx-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Run pre-commit
3535
run: |
3636
pip install -U pip setuptools wheel
37-
pip install -r requirements-dev.txt
37+
pip install -r .devcontainer/requirements.txt
3838
pre-commit install
3939
pre-commit run -a -v --color always
4040
- name: Build docs

.pre-commit-config.yaml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ repos:
2929
You must provide list of target files as input in your .pre-commit-config.yaml file.
3030
files: ^(.*requirements.*\.txt|\.brokignore)$
3131
- repo: https://github.com/PyCQA/isort
32-
rev: "5.13.2"
32+
rev: "6.0.1"
3333
hooks:
3434
- id: isort
3535
description: isort is a Python utility / library to sort imports automatically.
3636
files: ^((noxfile|conf)|docs/.*)\.py$
3737
- repo: https://github.com/psf/black
38-
rev: 24.10.0
38+
rev: 25.1.0
3939
hooks:
4040
- id: black
4141
description: Forces best practice formatting of Python code files.
@@ -54,17 +54,17 @@ repos:
5454
- id: blacken-docs
5555
description: Run black on python code blocks in documentation files.
5656
files: ^(index|docs/.*|docs/_includes/.*)\.rst$
57-
additional_dependencies: [black==24.10.0]
57+
additional_dependencies: [black==25.1.0]
5858

59-
# - repo: https://github.com/saltstack/mirrors-nox
60-
# rev: v2022.11.21
61-
# hooks:
62-
# - id: nox
63-
# alias: Generate Sphinx docs
64-
# description: Generate Sphinx docs, ensure they build
65-
# pass_filenames: false
66-
# args:
67-
# - -e
68-
# - 'docs-html(download_versions=True, clean=True)'
69-
# - --
70-
# - -vv
59+
- repo: https://github.com/saltstack/mirrors-nox
60+
rev: v2022.11.21
61+
hooks:
62+
- id: nox
63+
alias: Generate Sphinx docs
64+
description: Generate Sphinx docs, ensure they build
65+
pass_filenames: false
66+
args:
67+
- -e
68+
- 'docs-html(gen_sitevars=True, clean=True)'
69+
- --
70+
- -vv

noxfile.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,5 +177,8 @@ def docs(session) -> None:
177177
args = ["--watch", ".", "--open-browser", "docs", str(build_dir)]
178178
if build_dir.exists():
179179
shutil.rmtree(build_dir)
180+
# Generate sitevars
181+
version_updater_script = Path("tools", "version-updater.py")
182+
session.run("python", str(version_updater_script), external=True)
180183

181184
session.run("sphinx-autobuild", *args)

0 commit comments

Comments
 (0)