Add ruff formatting and linting (#65)
This commit is contained in:
Родитель
f2058b49ee
Коммит
3e2dff02bc
|
@ -27,6 +27,20 @@ jobs:
|
|||
path: "dist/*"
|
||||
if-no-files-found: error
|
||||
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depths: 0
|
||||
- uses: actions/setup-python@v4
|
||||
- name: Install Ruff
|
||||
run: pip install ruff
|
||||
- name: Check format
|
||||
run: ruff format --check
|
||||
- name: Check lints
|
||||
run: ruff check
|
||||
|
||||
test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
needs: build
|
||||
|
|
|
@ -32,7 +32,7 @@ def get_mono(
|
|||
jit_options: Optional[Sequence[str]] = None,
|
||||
assembly_dir: Optional[str] = None,
|
||||
config_dir: Optional[str] = None,
|
||||
set_signal_chaining: bool = False
|
||||
set_signal_chaining: bool = False,
|
||||
) -> Runtime:
|
||||
"""Get a Mono runtime instance
|
||||
|
||||
|
|
|
@ -86,7 +86,8 @@ class MethodDesc:
|
|||
def __init__(self, typename, function):
|
||||
self._desc = f"{typename}:{function}"
|
||||
self._ptr = _MONO.mono_method_desc_new(
|
||||
self._desc.encode("utf8"), 1 # include_namespace
|
||||
self._desc.encode("utf8"),
|
||||
1, # include_namespace
|
||||
)
|
||||
|
||||
def search(self, image):
|
||||
|
|
|
@ -137,8 +137,9 @@ def find_libmono(*, assembly_dir: str = None, sgen: bool = True) -> Path:
|
|||
)
|
||||
|
||||
else:
|
||||
if assembly_dir == None:
|
||||
if assembly_dir is None:
|
||||
from ctypes.util import find_library
|
||||
|
||||
path = find_library(unix_name)
|
||||
else:
|
||||
libname = "lib" + unix_name + ".so"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
project = "clr-loader"
|
||||
copyright = "2022, Benedikt Reinartz"
|
||||
author = "Benedikt Reinartz"
|
||||
|
@ -5,9 +8,7 @@ author = "Benedikt Reinartz"
|
|||
extensions = ["sphinx.ext.autodoc"]
|
||||
|
||||
# Add parent to path for autodoc
|
||||
import sys, os
|
||||
|
||||
sys.path.append(os.path.abspath(".."))
|
||||
sys.path.append(str(Path("..").absolute()))
|
||||
|
||||
# autodoc_typehints = "both"
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import shutil
|
||||
import pytest
|
||||
from subprocess import check_call
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче