diff --git a/.codecov.yml b/.codecov.yml index 50979600..db247200 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1,2 +1 @@ comment: off - diff --git a/.coveragerc b/.coveragerc index f25962cc..31175756 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,3 +1,2 @@ [run] source=threadpoolctl - diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e295b162..29ea90f4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,15 +30,13 @@ jobs: uses: actions/setup-python@v4 with: python-version: "3.14" - - name: Install ruff - run: | - pip install ruff==0.16.8 - - name: Run ruff check + + - name: Install pre-commit run: | - ruff check . - - name: Run ruff format + pip install pre-commit==4.6.2 + - name: Run pre-commit checks run: | - ruff format --diff . + pre-commit run --all-files --show-diff-on-failure testing: needs: linting diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..e3120d6e --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,21 @@ +default_language_version: + python: python3 + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 + hooks: + - id: end-of-file-fixer + - id: trailing-whitespace + - id: check-yaml + - id: check-toml + - id: check-case-conflict + - id: check-added-large-files + - id: detect-private-key + + - repo: https://github.com/charliermarsh/ruff-pre-commit + rev: 'v0.17.0' + hooks: + - id: ruff + args: ["--fix"] + - id: ruff-format diff --git a/LICENSE b/LICENSE index f2927f5f..1d7302bf 100644 --- a/LICENSE +++ b/LICENSE @@ -21,4 +21,4 @@ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tests/_openmp_test_helper/openmp_helpers_outer.pyx b/tests/_openmp_test_helper/openmp_helpers_outer.pyx index 9e668f5c..8ac5550c 100644 --- a/tests/_openmp_test_helper/openmp_helpers_outer.pyx +++ b/tests/_openmp_test_helper/openmp_helpers_outer.pyx @@ -20,5 +20,5 @@ def check_nested_openmp_loops(int n, nthreads=None): for i in prange(n, num_threads=num_threads, nogil=True): inner_num_threads = inner_openmp_loop(n) outer_num_threads = openmp.omp_get_num_threads() - + return outer_num_threads, inner_num_threads