pvergain, to python French
@pvergain@framapiaf.org avatar

#python #rust #ruff #tool

https://github.com/astral-sh/ruff/releases/tag/v0.4.0

A new, hand-written parser

Ruff's new parser is >2x faster, which translates to a 20-40% speedup for all linting and formatting invocations.

There's a lot to say about this exciting change, so check out the blog post for more details !

tchauhan, to python
@tchauhan@mastodon.mit.edu avatar

ruff looks like very interesting tooling. Trying to make it work for Emacs groundup. Has anyone been able to run it with eglot using this pylsp plugin: https://github.com/python-lsp/python-lsp-ruff ?

So finicky!

#ruff #pylsp #lsp #python #tooling #emacsgroundup #emacs

kytta, to python
@kytta@fosstodon.org avatar

A few weeks ago, I’ve written a small essay about modern tools (like and ) and things I dislike about them. I wanted to first redesign my website before posting it, but nah, that would take too long of a time 😂

https://www.kytta.dev/blog/why-i-dislike-ruff/

courtbouillon, to Blog
@courtbouillon@fosstodon.org avatar

− Astral: Beauty and the Beast

If you’re a Python user, you may have heard about ruff and Astral, the company behind.

They promise the Python Next-Gen Tooling 🌠

Is this a dream? Or maybe a nightmare? Or just the reality?

➡️ https://www.courtbouillon.org/blog/00050-astral/

nerdsitu, to python
@nerdsitu@datasci.social avatar

We created a template to start a github repo for new research projects: https://github.com/NERDSITU/research-template

Includes folder structure, gitignore, precommit hooks, linting+formatting, environment file, etc.
Feel free to use - happy for feedback!

mistersql, to python
@mistersql@mastodon.social avatar

My prediction: will soon compete directly with codeclimate, sonarqube, codacy and the like. As far as I can tell, these products take a variety of free tools, repackage them and sell them to corporate customers with a hosted SaaS, sometimes with free tiers (zero marginal costs, so why not, it is a sales pipeline). They do so quietly and so who knows if they contribute anything back, if they violate the social norms of opensource or hire or compensate maintainers.

jamescooke, to python
@jamescooke@fosstodon.org avatar

Last week @hynek
said "it looks like nobody has seen the VC playbook play out" regarding Astral and .

This week with the uv tool, I’m seeing cheerleaders right next to me like I didn’t see before with Ruff.

Regarding tooling and Python itself, I can’t stop thinking about how Astral’s business model relies on keeping Python and tools slow, so that their tools stand out. And it’s really stuck in my head. 😬

SnoopJ, to random
@SnoopJ@hachyderm.io avatar

A faster pip-tools does seem intriguing, so I gave uv pip compile (formerly puffin) a try. Here's what I learned:

  • setup.cfg is unsupported, you must declare dependencies in pyproject.toml

  • --find-links doesn't work w/ encoded package URLs (edit: fixed)

  • Installing reqs from git doesn't seem to work (failure to clone; no .gitconfig support maybe?)

  • Extras and environment markers are absent from output (i.e. pkg[extra]==1.0 ; … turns into pkg==1.0)

Not production-ready for me

SnoopJ,
@SnoopJ@hachyderm.io avatar

Somewhat relatedly, as far as I can tell, the lack of support for uv pip install . is deliberate.

It leaves me wondering what exactly the design goals behind the "drop-in" claim are, because they don't seem to be "have the same observable behavior" as a general rule, but maybe something more like "it's close".

(I guess this kvetching applies to as well as since it also claims drop-in parity and has lots of fiddly little differences that make "drop-in" mean "drop-in and then tweak")

paulox, to python
@paulox@fosstodon.org avatar

RT @charliermarsh

Ruff v0.2.0 is out now 😎

From v0.1.0 to v0.2.0, we saw...

  • 891 PRs
  • 118 contributors (including 80 new contributors)
  • Over 100 new rules

https://astral.sh/blog/ruff-v0.2.0

CC @charliermarsh

jedie,
@jedie@chaos.social avatar
jedie, to python German
@jedie@chaos.social avatar

Hab jetzt mal ein wenig Erfahrung mit gemacht... Das ist zwar schnell, aber auch nicht perfekt...

Falsche whitespaces/newlines sind ihm oft egal. Dabei kommt irgendwie darauf an, ob man "ruff check" / "ruff check --fix" oder "ruff format" nutzt. Letzteres macht mehr...

Auch wenn alle regeln an sind... Dann kann es auch nicht wirklich ersetzten. Die Reihenfolge/newlines und doppelte imports (F811) fixt ruff nicht richtig.

LucidDan, to python
@LucidDan@fosstodon.org avatar

Even after a few months of using to check and fix issues in my code, I still experience that moment of running 'ruff' manually, then spending a moment of hesitation thinking “hang on that returned too quickly, did it actually do anything or did it just return because it didn’t find any files to check?”

kubikpixel, to python German
@kubikpixel@chaos.social avatar

ASTRAL: An extremely fast Python linter and code formatter, written in Rust.

Astral’s mission is to make the Python ecosystem more productive by building high-performance developer tools, starting with Ruff.

:python: https://astral.sh

brettcannon, to random
@brettcannon@fosstodon.org avatar

has shipped their Black-compatible formatter to beta and declared it ready for production use: https://astral.sh/blog/the-ruff-formatter

astrojuanlu, to python
@astrojuanlu@social.juanlu.space avatar

It's here! ruff format is 99.9 % compatible with Black, is 30x faster, and allows changing the quoting and indentation styles:

https://astral.sh/blog/the-ruff-formatter

benfulton, to random
@benfulton@fosstodon.org avatar

Using cyclomatic complexity in code reviews. That would be an interesting experiment - I had no idea that CC was measurable in C++ code! Metrix++ is the relevant tool.

pawamoy,
@pawamoy@fosstodon.org avatar

@benfulton @leahawasser I think most Python tools that measure cyclomatic complexity are based on or use McCabe, from @nedbat (https://pypi.org/project/mccabe/). has it built-in, has plugins (McCabe is one), probably has it built-in too.

tek, to random
@tek@freeradical.zone avatar

If you use Ruff in CI to check your Python code (and if not, what’s wrong with you, start ASAP!), there’s a breaking change in the new 0.1.0 version released yesterday. Change the --output= arg to --output-format and you’ll be back up and running.

The Ruff team did bump the minor version when they made the change. If you’re like me and hadn’t bothered pinning it because “they’ve had 293 releases so far, what’s the likelihood it’ll change?”, fix that too while you’re in there.

clacke,

> An extremely fast Python linter, written in Rust.
[ . . . ]
> Near-parity with the built-in Flake8 rule set
> 🔌 Native re-implementations of dozens of Flake8 plugins, like flake8-bugbear
[ . . . ]
> Ruff can be used to replace Flake8 (plus dozens of plugins), isort, pydocstyle, yesqa, eradicate, pyupgrade, and autoflake, all while executing tens or hundreds of times faster than any individual tool.

Used by well-renowned projects like pandas and FastAPI.

pypi.org/project/ruff/

Yeah, this really does look like a no-brainer once you know about it.

@tek

@python

scy, to python
@scy@chaos.social avatar

So, what’s your current go-to #Python #QA & #codestyle stack? Thinking of doing black, isort, mypy, pytest, but open for suggestions.

My main project currently uses flake8 instead of black, with flake8-quotes to enforce double quotes, but this breaks in Python 3.12 because of nested quotes in f-strings: https://github.com/zheller/flake8-quotes/issues/117

slackline,
@slackline@mastodon.social avatar

@scy ruff its a great alternative to flake8, much faster too and is already up-to-date with 3.12

Pylint is worth using in conjunction with both black and ruff it picks up code-smells the others don't.

https://docs.astral.sh/ruff/
https://pylint.org/

jugmac00, to random German
@jugmac00@fosstodon.org avatar

The blazing fast linter has landed in Prague at @pyconcz

cc @charliermarsh

jankatins, to random
@jankatins@fosstodon.org avatar

can now format python files in the same format as can:

> Alpha release of the Ruff formatter, out now in Ruff v0.0.289.
> The formatter is designed to be a drop-in replacement for Black... At present, it achieves over > 99.9% compatibility on significant Black-formatted projects like Django and Zulip.
> For the Alpha, our focus is on collecting feedback that we can address prior to a Beta release later this year.

https://github.com/astral-sh/ruff/issues/1904#issuecomment-1716130700

ChristianHeinze, to random
@ChristianHeinze@digitalcourage.social avatar

I've been using for quite a while now but I never bothered configuring it much. Now @brianokken mentioned this article on one of the more recent @pythonbytes episodes and I had a closer look at what's possible. Seems like I missed out on quite a bit.

koxudaxi, to python

ruff-pycharm-plugin v0.0.20 has been released.
The version supports the native LSP feature of PyCharm Professional.

You can enable it in Preferences/Settings -> Tools -> Ruff -> Use ruff-lsp (Experimental) for PyCharm Pro/IDEA Ultimate

The LSP integration applies only below features:

  • Errors/warnings highlighting (textDocument/publishDiagnostics)
  • Quick-fixes for these errors/warnings (textDocument/codeAction

https://plugins.jetbrains.com/plugin/20574-ruff
https://github.com/koxudaxi/ruff-pycharm-plugin

image/png

_chrismay, to python
@_chrismay@fosstodon.org avatar

I recently heard that the vulnerability that enabled the Equifax breach was in a dependency… that was fixed two months before the breach.

So I'm wondering, friends, how and when do you check on and update your dependencies for your production projects? What is your process?

diji,
@diji@mastodon.social avatar

@_chrismay We use pipenv for dependency management. Our "build" pipeline runs pipenv check after the sync, which uses the safety underneath if I am not mistaken. Builds fail if this check fails.

From there, it is usually easy to pipenv update, run unit tests and , fix failures, and commit the changes.

pawamoy, to random
@pawamoy@fosstodon.org avatar

Is it me or just got a whole lot faster? It feels like it runs as fast as now! 😄

oliverandrich, to vscode
@oliverandrich@fosstodon.org avatar

Today is extremely annoying me again. Random hangs while running formatters and linters, that normally just works. Some hangs result in crashes which again result in lost code. I am reaching again the point, where I want to look into a different editor.

norambna,
@norambna@fosstodon.org avatar

@oliverandrich Try instead of ! It works very well on VSCode and also on Sublime.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • provamag3
  • rosin
  • InstantRegret
  • ethstaker
  • DreamBathrooms
  • mdbf
  • magazineikmin
  • thenastyranch
  • Youngstown
  • GTA5RPClips
  • slotface
  • Durango
  • khanakhh
  • kavyap
  • megavids
  • everett
  • vwfavf
  • tacticalgear
  • osvaldo12
  • cisconetworking
  • cubers
  • modclub
  • ngwrru68w68
  • Leos
  • anitta
  • normalnudes
  • tester
  • JUstTest
  • All magazines