Skip to content

Commit 049f248

Browse files
authored
Merge pull request #28 from octue/doc-build
Fix documentation builds
2 parents 2b688f9 + 29a3b52 commit 049f248

File tree

5 files changed

+79
-66
lines changed

5 files changed

+79
-66
lines changed

.devcontainer/devcontainer.json

Lines changed: 36 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -10,57 +10,52 @@
1010
"customizations": {
1111
"vscode": {
1212
"settings": {
13-
"austin.mode": "Wall time",
13+
"[python]": {
14+
"editor.defaultFormatter": "ms-python.black-formatter",
15+
"editor.formatOnSave": true,
16+
"editor.codeActionsOnSave": {
17+
"source.organizeImports": "always",
18+
"source.fixAll": "always"
19+
}
20+
},
1421
"black-formatter.args": ["--line-length", "120"],
22+
"black-formatter.importStrategy": "fromEnvironment",
23+
"isort.args": ["--profile", "black"],
24+
"isort.importStrategy": "fromEnvironment",
25+
"austin.mode": "Wall time",
1526
"editor.defaultFormatter": "esbenp.prettier-vscode",
1627
"editor.formatOnSave": true,
17-
"esbonio.server.enabled": true,
18-
"esbonio.sphinx.confDir": "${workspaceFolder}/docs/source",
1928
"jupyter.widgetScriptSources": ["jsdelivr.com", "unpkg.com"],
20-
"prettier.prettierPath": "/usr/local/prettier",
21-
"python.defaultInterpreterPath": "/usr/local/bin/python",
22-
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
23-
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
24-
"python.formatting.provider": "black",
25-
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
26-
"python.languageServer": "Pylance",
27-
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
28-
"python.linting.enabled": true,
29-
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
30-
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
31-
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
32-
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
33-
// Disabling specific messages:
29+
// Line length to match black settings
30+
// Disable specific messages:
3431
// - To find the details do: /usr/local/py-utils/bin/pylint --list-msgs
3532
// - Disable missing-module-docstring (C0114) because we don't document modules routinely, just their members
3633
// - Disable invalid-name (C0103) because pylint thinks that eg 'x', 'df', 'np' are invalid due to their lengths
37-
"python.linting.pylintArgs": [
34+
"pylint.args": [
3835
"--max-line-length=120",
39-
"--disable=missing-module-docstring,invalid-name"
40-
],
41-
"python.linting.pylintEnabled": true,
42-
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint",
43-
"python.pythonPath": "/usr/local/bin/python",
44-
"python.testing.pytestArgs": [
45-
"--cov=django_svelte_jsoneditor",
46-
"--cov-report=xml:cov.xml"
36+
"--disable=missing-module-docstring,invalid-name",
37+
"--load-plugins=pylint_django"
4738
],
48-
// Scrolling the editor is a nice idea but it doesn't work, always out of sync and impossible to manage
49-
"restructuredtext.preview.scrollEditorWithPreview": false,
50-
"restructuredtext.preview.scrollPreviewWithEditor": false,
51-
"restructuredtext.linter.doc8.extraArgs": ["--max-line-length 180"],
52-
"terminal.integrated.defaultProfile.linux": "zsh"
39+
"python.testing.pytestEnabled": true,
40+
"python.testing.unittestEnabled": false,
41+
"terminal.integrated.defaultProfile.linux": "zsh",
42+
// Handle this: https://github.com/microsoft/vscode-python/issues/693
43+
"python.testing.pytestArgs": ["--no-cov"]
5344
},
54-
5545
// Add the IDs of extensions you want installed when the container is created.
5646
"extensions": [
57-
47+
"erikphansen.vscode-toggle-column-selection",
48+
"esbenp.prettier-vscode",
49+
"GitHub.copilot",
50+
"GitHub.copilot-chat",
51+
"github.vscode-github-actions",
5852
"irongeek.vscode-env",
59-
"me-dutour-mathieu.vscode-github-actions",
60-
"mikestead.dotenv",
6153
"ms-python.python",
6254
"ms-python.vscode-pylance",
6355
"ms-python.pylint",
56+
"ms-python.black-formatter",
57+
"ms-python.flake8",
58+
"ms-python.isort",
6459
"ms-toolsai.jupyter",
6560
"ms-toolsai.jupyter-renderers",
6661
"ms-toolsai.jupyter-keymap",
@@ -70,20 +65,19 @@
7065
"shamanu4.django-intellisense",
7166
"thebarkman.vscode-djaneiro",
7267
"trond-snekvik.simple-rst",
73-
"ms-azuretools.vscode-docker",
74-
"ryanluker.vscode-coverage-gutters",
75-
"ms-python.black-formatter",
76-
"GitHub.copilot"
68+
"4ops.terraform"
7769
]
7870
}
7971
},
8072

8173
// Use 'forwardPorts' to make a list of ports inside the container available locally.
8274
"forwardPorts": [80, 443, 5500, 8000],
8375

84-
// Use 'postCreateCommand' to run commands after the container is created.
85-
// Note: Reverting to use pip requirements until we can install private dependencies in GHA with poetry
86-
"postCreateCommand": ". .devcontainer/postcreate.sh",
76+
// Use 'postAttachCommand' to run commands after the container is created and attached (ie git is available).
77+
// This is preferential to postCreateCommand as invoking git (eg for private poetry installs or addition of
78+
// git config preferences) doesn't override injected git configs
79+
// https://stackoverflow.com/a/73097009/3556110
80+
"postAttachCommand": ". .devcontainer/postattach.sh",
8781

8882
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
8983
"remoteUser": "vscode",

.devcontainer/postattach.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/zsh
2+
3+
# Install dependencies
4+
poetry install
5+
6+
# Auto set up remote when pushing new branches
7+
git config --global --add push.autoSetupRemote 1
8+
9+
# Allow precommit to install properly
10+
git config --global --add safe.directory /workspace
11+
12+
# Install precommit hooks
13+
pre-commit install && pre-commit install -t commit-msg
14+
15+
# Set zsh history location
16+
# This is done in postAttach so it's not overridden by the oh-my-zsh devcontainer feature
17+
#
18+
# We leave you to decide, but if you put this into a folder that's been mapped
19+
# into the container, then history will persist over container rebuilds :)
20+
#
21+
# !!!IMPORTANT!!!
22+
# Make sure your .zsh_history file is NOT committed into your repository, as it can contain
23+
# sensitive information. So in this case, you should add
24+
# .devcontainer/.zsh_history
25+
# to your .gitignore file.
26+
export HISTFILE="/workspace/.devcontainer/.zsh_history"
27+
28+
# Add aliases to zshrc file
29+
echo '# Aliases to avoid typing "python manage.py" repeatedly' >> ~/.zshrc
30+
echo 'alias dj="python manage.py"' >> ~/.zshrc
31+
echo 'alias djmm="python manage.py makemigrations"' >> ~/.zshrc
32+
echo 'alias djm="python manage.py migrate"' >> ~/.zshrc
33+
echo 'alias djr="python manage.py runserver"' >> ~/.zshrc
34+
echo 'alias djreset="python manage.py reset_db -c"' >> ~/.zshrc
35+
echo 'alias djs="python manage.py shell_plus"' >> ~/.zshrc
36+
echo 'alias dju="python manage.py show_urls"' >> ~/.zshrc

.devcontainer/postcreate.sh

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

.readthedocs.yaml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Read the Docs configuration file
2-
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
32

43
# Required
54
version: 2
@@ -13,19 +12,13 @@ build:
1312
# nodejs: "19"
1413
# rust: "1.64"
1514
# golang: "1.19"
15+
jobs:
16+
post_create_environment:
17+
- pip install poetry
18+
- poetry config virtualenvs.create false
19+
post_install:
20+
- poetry install
1621

1722
# Build documentation in the "docs/" directory with Sphinx
1823
sphinx:
1924
configuration: docs/source/conf.py
20-
21-
# Optionally build your docs in additional formats such as PDF and ePub
22-
# formats:
23-
# - pdf
24-
# - epub
25-
26-
# Optional but recommended, declare the Python requirements required
27-
# to build your documentation
28-
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
29-
python:
30-
install:
31-
- requirements: docs/requirements.txt

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "django-svelte-jsoneditor"
3-
version = "0.4.1"
3+
version = "0.4.2"
44
description = "A widget for django's JSONField using the latest-and-greatest Json Editor"
55
authors = ["Tom Clark <[email protected]>"]
66
license = "MIT"

0 commit comments

Comments
 (0)