-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add mypy and ruff configuration and github actions
Resolve missing type annotations. Resolve ruff reported errors. Make it easier to call generate_script.
- Loading branch information
Showing
74 changed files
with
264 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
day: "thursday" | ||
|
||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
day: "thursday" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Run tests | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
rufftest: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
cache: 'pip' | ||
cache-dependency-path: 'requirements-ruff.txt' | ||
- run: make ruffinstall | ||
- run: make rufftest | ||
env: | ||
RUFF_FORMAT: github | ||
|
||
typingtest: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
cache: 'pip' | ||
cache-dependency-path: 'pyproject.toml' | ||
- run: make devinstall | ||
- run: make typingtest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
.PHONY: mypyinstall | ||
mypyinstall: | ||
pip install --upgrade pip | ||
pip install --upgrade --upgrade-strategy eager -r requirements-mypy.txt | ||
|
||
.PHONY: ruffinstall | ||
ruffinstall: | ||
pip install --upgrade pip | ||
pip install --upgrade --upgrade-strategy eager -r requirements-ruff.txt | ||
|
||
.PHONY: install | ||
install: | ||
pip install --upgrade pip | ||
pip install --upgrade --upgrade-strategy eager -r requirements.txt | ||
|
||
.PHONY: test | ||
test: rufftest typingtest | ||
|
||
.PHONY: rufftest | ||
rufftest: | ||
ruff . | ||
|
||
.PHONY: typingtest | ||
typingtest: | ||
mypy . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
[tool.mypy] | ||
ignore_missing_imports = true | ||
show_column_numbers = true | ||
show_error_codes = true | ||
strict = true | ||
warn_return_any = true | ||
warn_unused_configs = true | ||
|
||
[tool.ruff] | ||
target-version = 'py311' | ||
line-length = 120 | ||
select = [ | ||
# https://github.com/charliermarsh/ruff#supported-rules | ||
'ALL', | ||
'E111', 'E112', 'E113', 'E114', 'E115', 'E116', 'E117', | ||
'E201', 'E202', 'E203', | ||
'E211', | ||
'E221', 'E222', 'E223', 'E224', 'E225', 'E226', 'E227', 'E228', | ||
'E231', | ||
'E251', 'E252', | ||
'E261', 'E262', 'E265', 'E266', | ||
'E271', 'E272', 'E273', 'E274', 'E275', | ||
] | ||
ignore = [ | ||
'ANN101', # No need to add type to self | ||
'D', # Ignore docstring checks | ||
'DTZ007', # Ignore missing timezone | ||
'E501', # Some paths are very long | ||
'EM', # Allow messages directly in exceptions | ||
'FBT001', # Allow positional for boolean arguments | ||
'FBT002', # Allow default value for boolean arguments | ||
'N999', # Allow invalid module names for scripts | ||
'PD', # Not using pandas | ||
'PLR0913', # Allow functions with many arguments | ||
'PT', # Not using pytest | ||
'Q000', # Use single quotes | ||
'RET504', # Allow variable assignment before return | ||
'S311', # Allow pseudo-random generators for non-cryptographic purpose | ||
'SIM108', # Allow if-else block instead of ternary | ||
'SLF001', # Allo private member access | ||
'T201', # Allow using print | ||
'TRY003', # Specific messages for common exception classes | ||
] | ||
|
||
[tool.ruff.isort] | ||
lines-between-types = 1 | ||
section-order = [ | ||
'future', | ||
'standard-library', | ||
'third-party', | ||
'time_lapse', | ||
'first-party', | ||
'local-folder', | ||
] | ||
|
||
[tool.ruff.isort.sections] | ||
time_lapse = ['time_lapse'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
-r requirements.txt | ||
mypy==1.4.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ruff==0.0.275 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
time-lapse==4.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.