Skip to content

Commit

Permalink
Merge branch 'dev' into python-3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam authored Oct 20, 2023
2 parents 645654b + c144016 commit 0b59591
Show file tree
Hide file tree
Showing 35 changed files with 4,277 additions and 6,112 deletions.
28 changes: 14 additions & 14 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
root = true

[*]
end_of_line = crlf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2

[*.py]
indent_size = 4

[*.ui]
indent_size = 1
root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2

[*.py]
indent_size = 4

[*.ui]
indent_size = 1
17 changes: 3 additions & 14 deletions .github/workflows/lint-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
fail-fast: false
# Ruff is version and platform sensible
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12"]
steps:
- name: Checkout ${{ github.repository }}/${{ github.ref }}
uses: actions/checkout@v3
Expand All @@ -58,25 +58,13 @@ jobs:
- run: scripts/install.ps1
shell: pwsh
- run: ruff check .
add-trailing-comma:
runs-on: windows-latest
steps:
- name: Checkout ${{ github.repository }}/${{ github.ref }}
uses: actions/checkout@v3
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.12"
- run: pip install add-trailing-comma
- name: Analysing the code with add-trailing-comma
run: add-trailing-comma $(git ls-files '**.py*')
Pyright:
runs-on: windows-latest
strategy:
fail-fast: false
# Pyright is version and platform sensible
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12"]
steps:
- name: Checkout ${{ github.repository }}/${{ github.ref }}
uses: actions/checkout@v3
Expand All @@ -92,6 +80,7 @@ jobs:
uses: jakebailey/pyright-action@v1
with:
working-directory: src/
python-version: ${{ matrix.python-version }}
Build:
runs-on: windows-latest
strategy:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repos:
- id: pretty-format-ini
args: [--autofix]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.0.292" # Must match requirements-dev.txt
rev: "v0.1.1" # Must match requirements-dev.txt
hooks:
- id: ruff
args: [--fix]
Expand Down
2 changes: 1 addition & 1 deletion .sonarcloud.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sonar.python.version=3.9, 3.10, 3.11
sonar.python.version=3.10, 3.11
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.eol": "\n",
"editor.comments.insertSpace": true,
"editor.insertSpaces": true,
"editor.detectIndentation": false,
Expand Down Expand Up @@ -62,7 +63,7 @@
"editor.defaultFormatter": "vscode.json-language-features",
},
"[python]": {
// Ruff is not yet a formatter: https://github.com/charliermarsh/ruff/issues/1904
// Ruff as a formatter doesn't fully satisfy our needs yet: https://github.com/astral-sh/ruff/discussions/7310
"editor.defaultFormatter": "ms-python.autopep8",
"editor.tabSize": 4,
"editor.rulers": [
Expand Down
2 changes: 0 additions & 2 deletions PyInstaller/hooks/hook-requests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import annotations

from PyInstaller.utils.hooks import collect_data_files

# Get the cacert.pem
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ This program can be used to automatically start, split, and reset your preferred
### Compatibility

- Windows 10 and 11.
- Python 3.9+ (Not required for normal use. Refer to the [build instructions](/docs/build%20instructions.md) if you'd like run the application directly in Python).
- Python 3.10+ (Not required for normal use. Refer to the [build instructions](/docs/build%20instructions.md) if you'd like run the application directly in Python).

## OPTIONS

Expand Down
2 changes: 1 addition & 1 deletion docs/build instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

### All platforms

- [Python](https://www.python.org/downloads/) 3.9+.
- [Python](https://www.python.org/downloads/) 3.10+.
- [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)
Expand Down
30 changes: 17 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# https://beta.ruff.rs/docs/configuration
# https://docs.astral.sh/ruff/configuration/
[tool.ruff]
target-version = "py39"
target-version = "py310"
line-length = 120
select = ["ALL"]
preview = true
# https://beta.ruff.rs/docs/rules
# https://docs.astral.sh/ruff/rules/
ignore = [
###
# Not needed or wanted
Expand All @@ -21,6 +21,8 @@ ignore = [
"ERA001", # eradicate: commented-out-code
# contextlib.suppress is roughly 3x slower than try/except
"SIM105", # flake8-simplify: use-contextlib-suppress
# Negative performance impact
"UP038", # non-pep604-isinstance
# Checked by type-checker (pyright)
"ANN", # flake-annotations
"PGH003", # blanket-type-ignore
Expand All @@ -34,7 +36,7 @@ ignore = [
"TD001", # flake8-todos: invalid-todo-tag

###
# These should be warnings (https://github.com/charliermarsh/ruff/issues/1256)
# These should be warnings (https://github.com/astral-sh/ruff/issues/1256 & https://github.com/astral-sh/ruff/issues/1774)
###
"FIX", # flake8-fixme
# Not all TODOs are worth an issue, this would be better as a warning
Expand All @@ -56,7 +58,7 @@ ignore = [
# Python 3.11, introduced "zero cost" exception handling
"PERF203", # try-except-in-loop

### FIXME/TODO (no warnings in Ruff yet: https://github.com/charliermarsh/ruff/issues/1256):
### FIXME/TODO (no warnings in Ruff yet: https://github.com/astral-sh/ruff/issues/1256 & https://github.com/astral-sh/ruff/issues/1774):
"CPY001", # flake8-copyright
"PTH", # flake8-use-pathlib
# Ignore until linux support
Expand All @@ -66,7 +68,7 @@ ignore = [
[tool.ruff.per-file-ignores]
"typings/**/*.pyi" = [
"F811", # Re-exports false positives
"F821", # https://github.com/charliermarsh/ruff/issues/3011
"F821", # https://github.com/astral-sh/ruff/issues/3011
# The following can't be controlled for external libraries:
"A", # Shadowing builtin names
"ICN001", # unconventional-import-alias
Expand All @@ -77,18 +79,16 @@ ignore = [
"PYI042", # CamelCase TypeAlias
]

# https://beta.ruff.rs/docs/settings/#flake8-implicit-str-concat
# https://docs.astral.sh/ruff/settings/#flake8-implicit-str-concat
[tool.ruff.flake8-implicit-str-concat]
allow-multiline = false

# https://beta.ruff.rs/docs/settings/#isort
# https://docs.astral.sh/ruff/settings/#isort
[tool.ruff.isort]
combine-as-imports = true
split-on-trailing-comma = false
required-imports = ["from __future__ import annotations"]
# Unlike isort, Ruff only counts relative imports as local-folder by default for know.
# https://github.com/charliermarsh/ruff/issues/2419
# https://github.com/charliermarsh/ruff/issues/3115
# https://github.com/astral-sh/ruff/issues/3115
known-local-folder = [
"AutoControlledThread",
"AutoSplit",
Expand All @@ -105,7 +105,7 @@ known-local-folder = [
"utils",
]

# https://beta.ruff.rs/docs/settings/#mccabe
# https://docs.astral.sh/ruff/settings/#mccabe
[tool.ruff.mccabe]
# Hard limit, arbitrary to 4 bytes
max-complexity = 31
Expand All @@ -128,7 +128,10 @@ ignore = [
"E124", # Closing bracket may not match multi-line method invocation style (enforced by add-trailing-comma)
"E70", # Allow ... on same line as def
# Autofixed by Ruff
# Check for the "Fix" flag https://beta.ruff.rs/docs/rules/#pycodestyle-e-w
# Check for the "Fix" flag https://docs.astral.sh/ruff/rules/#pycodestyle-e-w
"E20", # whitespace-after-* & whitespace-before-*
"E211", # whitespace-before-parameters
"E231", # missing-whitespace
"E401", # I001: unsorted-imports
"E71", # Comparisons
"E731", # lambda-assignment
Expand All @@ -139,6 +142,7 @@ ignore = [
# https://github.com/microsoft/pyright/blob/main/docs/configuration.md#sample-pyprojecttoml-file
[tool.pyright]
typeCheckingMode = "strict"
pythonVersion = "3.10"
# Prefer `pyright: ignore`
enableTypeIgnoreComments = false
# Extra strict
Expand Down
Loading

0 comments on commit 0b59591

Please sign in to comment.