Skip to content

Commit

Permalink
Merge pull request #26 from windpioneers/python-3-12
Browse files Browse the repository at this point in the history
Python 3.12
  • Loading branch information
thclark authored Nov 13, 2024
2 parents 29fcc2c + 5c8de73 commit 9227c52
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 59 deletions.
69 changes: 19 additions & 50 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,60 +10,29 @@
"GDAL_VERSION": "2.4.1"
}
},
// Set *default* container specific settings.json values on container create.
"settings": {
"austin.mode": "Wall time",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"jupyter.widgetScriptSources": ["jsdelivr.com", "unpkg.com"],
"prettier.prettierPath": "/usr/local/prettier",
"python.defaultInterpreterPath": "/usr/local/bin/python",
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
"python.formatting.provider": "black",
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
"python.languageServer": "Pylance",
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
"python.linting.enabled": true,
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
// Line length to match black settings
// Disabling specific messages:
// - To find the details do: /usr/local/py-utils/bin/pylint --list-msgs
// - Disable missing-module-docstring (C0114) because we don't document modules routinely, just their members
// - Disable invalid-name (C0103) because pylint thinks that eg 'x', 'df', 'np' are invalid due to their lengths
"python.linting.pylintArgs": [
"--max-line-length=120",
"--disable=missing-module-docstring,invalid-name"
],
"python.linting.pylintEnabled": true,
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint",
"python.pythonPath": "/usr/local/bin/python",
"terminal.integrated.defaultProfile.linux": "zsh"
},
"customizations": {
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"prettier.prettierPath": "/usr/local/prettier",
"terminal.integrated.defaultProfile.linux": "zsh"
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"esbenp.prettier-vscode",
"irongeek.vscode-env",
"mikestead.dotenv",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-toolsai.jupyter",
"ms-toolsai.jupyter-renderers",
"ms-toolsai.jupyter-keymap",
"ms-vsliveshare.vsliveshare",
"p403n1x87.austin-vscode",
"ritwickdey.liveserver"
],
// Add the IDs of extensions you want installed when the container is created.
"extensions": ["esbenp.prettier-vscode"]
}
},

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

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": ". .devcontainer/postcreate.sh",
// Use 'postAttachCommand' to run commands after the container is created and attached (ie git is available).
// This is preferential to postCreateCommand as invoking git (eg for private poetry installs or addition of
// git config preferences) doesn't override injected git configs
// https://stackoverflow.com/a/73097009/3556110
"postAttachCommand": ". .devcontainer/postattach.sh",

// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
Expand Down
27 changes: 27 additions & 0 deletions .devcontainer/postattach.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/zsh

# ..Install dependencies here if required...

# Auto set up remote when pushing new branches
git config --global --add push.autoSetupRemote 1

# Allow precommit to install properly
git config --global --add safe.directory /workspace

# Install precommit hooks
pre-commit install && pre-commit install -t commit-msg
pre-commit install-hooks

# Set zsh history location
# This is done in postAttach so it's not overridden by the oh-my-zsh devcontainer feature
#
# We leave you to decide, but if you put this into a folder that's been mapped
# into the container, then history will persist over container rebuilds :)
#
# !!!IMPORTANT!!!
# Make sure your .zsh_history file is NOT committed into your repository or docker builds,
# as it can contain sensitive information. So in this case, you should add
# .devcontainer/.zsh_history
# to your .gitignore and .dockerignore files.
export HISTFILE="/workspace/.devcontainer/.zsh_history"

7 changes: 0 additions & 7 deletions .devcontainer/postcreate.sh

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ jobs:
needs: coolname
strategy:
matrix:
python: ["3.9", "3.10", "3.11"]
python: ["3.10", "3.11", "3.12"]
gdal: ["2.4.1"]
mode: ["slim", "dev"]
runs-on: ubuntu-latest
timeout-minutes: 300
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Generate name
uses: thclark/coolname-generator-action@main
Expand Down

0 comments on commit 9227c52

Please sign in to comment.