Skip to content

Commit

Permalink
Promote usage of .venv
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Jul 21, 2023
1 parent cf002d1 commit 043bb8d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
__pycache__/

# Distribution / packaging
.venv/
env/
build/
dist/
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
// https://github.com/microsoft/vscode-mypy/issues/37#issuecomment-1602702174
"--config-file=mypy.ini",
],
"python.terminal.activateEnvironment": true,
// Important to follow the config in pyrightconfig.json
"python.analysis.useLibraryCodeForTypes": false,
"python.analysis.diagnosticMode": "workspace",
Expand Down
4 changes: 2 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
{
"label": "Compile resources",
"type": "shell",
"command": "scripts/compile_resources.ps1"
"command": ".venv/Scripts/Activate.ps1; scripts/compile_resources.ps1"
},
{
"label": "Build AutoSplit",
"type": "shell",
"command": "scripts/build.ps1",
"command": ".venv/Scripts/Activate.ps1; scripts/build.ps1",
"group": {
"kind": "build",
"isDefault": true
Expand Down
8 changes: 8 additions & 0 deletions docs/build instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,20 @@
- [Python](https://www.python.org/downloads/) 3.9+.
- [Node](https://nodejs.org) is optional, but required for complete linting.
- Alternatively you can install the [pyright python wrapper](https://pypi.org/project/pyright/) which has a bit of an overhead delay.
- [PowerShell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell)
- [VSCode](https://code.visualstudio.com/Download) is not required, but highly recommended.
- Everything already configured in the workspace, including Run (F5) and Build (Ctrl+Shift+B) commands, default shell, and recommended extensions.
- [PyCharm](https://www.jetbrains.com/pycharm/) is also a good Python IDE, but nothing is configured. If you are a PyCharm user, feel free to open a PR with all necessary workspace configurations!

## Install and Build steps

- Create and activate a virtual environment:
- Windows / PowerShell:
- `python -m venv .venv`
- `& ./.venv/Scripts/Activate.ps1`
- Unix / Bash:
- `python3 -m venv .venv`
- `source .venv/bin/activate`
- Run `./scripts/install.ps1` to install all dependencies.
- If you're having issues with the PySide generated code, you might want to first run `pip uninstall -y shiboken6 PySide PySide-Essentials`
- Run the app directly with `./scripts/start.ps1 [--auto-controlled]`.
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ max-branches = 15
[tool.autopep8]
max_line_length = 120
aggressive = 3
exclude = "src/gen/*"
exclude = ".venv/*,src/gen/*"
ignore = [
"E124", # Closing bracket may not match multi-line method invocation style (enforced by add-trailing-comma)
"E70", # Allow ... on same line as def
Expand Down Expand Up @@ -150,7 +150,9 @@ reportUninitializedInstanceVariable = "error"
reportUnnecessaryTypeIgnoreComment = "error"
# Exclude from scanning when running pyright
exclude = [
".venv/",
# Auto generated, fails some strict pyright checks
"build/",
"src/gen/",
]
# Ignore must be specified for Pylance to stop displaying errors
Expand Down

0 comments on commit 043bb8d

Please sign in to comment.