inducer / pyopencl

OpenCL integration for Python, plus shiny features
http://mathema.tician.de/software/pyopencl
Other
1.04k stars 237 forks source link

Move more configs to pyproject.toml #770

Closed alexfikl closed 1 week ago

alexfikl commented 2 weeks ago

It's the future! :tada:

This mostly removes pytest.ini and moves most of the things from setup.cfg here.

Flake8 doesn't support pyproject, so it's not moved, but there is a project that hacks support in there if we want: https://github.com/john-hen/Flake8-pyproject

alexfikl commented 2 weeks ago

The failures seem to be related to the release of numpy 2.0, but I'm not sure what it doesn't like since pyopencl should be built from source on the CI. Right?

EDIT: For reference, this fails on main too: https://github.com/inducer/pyopencl/actions/runs/9630426577/job/26560978801

matthiasdiener commented 1 week ago

Flake8 doesn't support pyproject, so it's not moved, but there is a project that hacks support in there if we want: https://github.com/john-hen/Flake8-pyproject

FWIW, I've been using flake8-pyproject in some of my projects, and it seems to work fine (see e.g. https://github.com/matthiasdiener/orderedsets/blob/551786a5b254372c097b3f676808d8e49dc0dcc8/pyproject.toml#L33)

alexfikl commented 1 week ago

FWIW, I've been using flake8-pyproject in some of my projects, and it seems to work fine (see e.g. matthiasdiener/orderedsets@551786a/pyproject.toml#L33)

Yeah, I've used it too and it worked without any issues.

One small problem with flake8 at the moment is also that the scripts in ci-support look for some strings in setup.cfg (e.g. # enable-isort), so that requires some more work..

inducer commented 1 week ago

https://github.com/inducer/ci-support/commit/3cbd99af89b67ac2a616100a430168354329a19e should allow seamless use of flake8-pyproject.

alexfikl commented 1 week ago

With https://github.com/inducer/ci-support/pull/32 we could also remove setup.cfg completely. The only one that remains is pylint with the special .pylintrc-local.yml :confounded:

alexfikl commented 1 week ago

@inducer This is looking good to me and all the pieces from ci-support seem to be working nicely. Is there anything else missing? I would leave the transition to ruff for another PR.

inducer commented 1 week ago

So I tried moving the whole thing to ruff, and I liked what I saw. :shrug: It's a bit of churn, but it's just really quite nice. I rather like the LSP integration. I imagine we'll do that (with time) across the whole stack.

inducer commented 1 week ago

LMK how you feel about this.

inducer commented 1 week ago

It's certainly much less of a mess than flake8.

alexfikl commented 1 week ago

So I tried moving the whole thing to ruff, and I liked what I saw. 🤷 It's a bit of churn, but it's just really quite nice. I rather like the LSP integration. I imagine we'll do that (with time) across the whole stack.

I'm all for it! It looks very nice and it seems to have caught some extra stuff :grin:

It's a bit of churn

Have you tried ruff check --fix? I mostly replaced isort with ruff check --fix --select=I and it works very well, not sure about the other rules..