惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
News | PayPal Newsroom
P
Proofpoint News Feed
Cyberwarzone
Cyberwarzone
C
Cisco Blogs
SecWiki News
SecWiki News
Know Your Adversary
Know Your Adversary
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Vercel News
Vercel News
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
罗磊的独立博客
NISL@THU
NISL@THU
WordPress大学
WordPress大学
Hacker News - Newest:
Hacker News - Newest: "LLM"
T
Threat Research - Cisco Blogs
AI
AI
Simon Willison's Weblog
Simon Willison's Weblog
Security Archives - TechRepublic
Security Archives - TechRepublic
有赞技术团队
有赞技术团队
L
LINUX DO - 热门话题
Hacker News: Ask HN
Hacker News: Ask HN
V
V2EX
G
GRAHAM CLULEY
TaoSecurity Blog
TaoSecurity Blog
Hugging Face - Blog
Hugging Face - Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
F
Fortinet All Blogs
博客园 - 叶小钗
博客园 - 三生石上(FineUI控件)
云风的 BLOG
云风的 BLOG
Recorded Future
Recorded Future
Latest news
Latest news
The Hacker News
The Hacker News
aimingoo的专栏
aimingoo的专栏
T
Troy Hunt's Blog
S
Schneier on Security
I
Intezer
Google DeepMind News
Google DeepMind News
A
Arctic Wolf
Apple Machine Learning Research
Apple Machine Learning Research
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Threatpost
爱范儿
爱范儿
The Register - Security
The Register - Security
S
SegmentFault 最新的问题
Blog — PlanetScale
Blog — PlanetScale
博客园 - 聂微东
宝玉的分享
宝玉的分享
Recent Commits to openclaw:main
Recent Commits to openclaw:main
美团技术团队
B
Blog RSS Feed

Blog - Astral

Vulnerability and malware checks in uv Open source security at Astral Astral to join OpenAI Ruff v0.15.0 ty: An extremely fast Python type checker and language server Python 3.14 Ruff v0.13.0 Astral OSS Fund: One Year Later pyx: a Python-native package registry, now in Beta An experimental, variant-enabled build of uv uv security advisory: ZIP payload obfuscation Ruff v0.12.0 Ruff v0.10.0 Ruff v0.9.0 A new home for python-build-standalone Ruff v0.8.0 Ruff v0.7.0 uv: Unified Python packaging Announcing the Astral OSS Fund Ruff v0.5.0 Ruff v0.4.5: Ruff's language server is now written in Rust Ruff v0.4.0: a hand-written recursive descent parser for Python Ruff v0.3.0 uv: Python packaging in Rust Ruff v0.2.0 Ruff v0.1.8 Ruff v0.1.5 The Ruff Formatter: An extremely fast, Black-compatible Python formatter Ruff v0.1.0 Ruff v0.0.292 Ruff v0.0.285 Ruff v0.0.283 Ruff v0.0.281 Ruff v0.0.278 Ruff v0.0.276 Announcing Astral, the company behind Ruff
Ruff v0.6.0
alex@astral. · 2024-08-15 · via Blog - Astral

Ruff v0.6.0 is available now! Install it from PyPI, or your package manager of choice:

pip install --upgrade ruff

As a reminder: Ruff is an extremely fast Python linter and formatter, written in Rust. Ruff can be used to replace Black, Flake8 (plus dozens of plugins), isort, pydocstyle, pyupgrade, and more, all while executing tens or hundreds of times faster than any individual tool.


Migrating to v0.6 #

As with Ruff 0.5, this release contains few breaking changes: most of our users should be able to upgrade to the latest Ruff version without having to make any significant edits to their code or configuration. But with that said, here are a few things to keep in mind when upgrading:

  • Several rules have been deprecated after it was decided that they made recommendations that were either inaccurate or unhelpful:

  • By default, our isort rules now search inside src/ directories when determining the list of package names that are likely to represent first-party code. This was always configurable, but it was suprising for many users that Ruff didn't understand this common project structure "out of the box".

    This change may result in some of your imports being reordered or recategorised, as import statements that these rules previously considered to be third-party imports will now be correctly understood as first-party.

  • The unnecessary-dict-comprehension-for-iterable rule has been recoded from RUF025 to C420, ensuring Ruff's code is consistent with the same rule in the flake8-comprehensions plugin.

Jupyter notebooks are now linted and formatted by default #

Ruff has supported linting and formatting Jupyter notebooks for a long time. In previous Ruff versions, however, Ruff would only lint and format notebooks if you added extend-include = ["*.ipynb"] to your Ruff configuration file. (Ruff would also lint any files that you explicitly passed to Ruff on the command line, including .ipynb files.)

In Ruff 0.6, this behavior has changed. When passed a directory of files to lint or format, Ruff will now search for .ipynb files within that directory in exactly the same way as it would for .py or .pyi files — with no extra configuration necessary. We added this as a preview-mode feature in Ruff 0.5.6; this release promotes it to stable.

If you'd rather Ruff left your notebooks alone, you'll still be able to get the old behavior by setting a custom extend-exclude setting in your Ruff configuration. For example, in a pyproject.toml file:

[tool.ruff]
extend-exclude = ["*.ipynb"]

For more fine-grained control over how Ruff handles notebook files, here's how you'd tell Ruff that you'd like your notebooks formatted, but not linted:

[tool.ruff.lint]
exclude = ["*.ipynb"]

Here's how you'd tell Ruff that you'd like your notebooks linted, but not formatted:

[tool.ruff.format]
exclude = ["*.ipynb"]

And to disable specific lint rules on notebooks, you can use Ruff's per-file-ignores setting:

[tool.ruff.lint.per-file-ignores]
"*.ipynb" = ["E501"]  # disable line-too-long in notebooks

Default behavior changed for flake8-pytest-style rules #

We've changed the default behaviour for pytest-fixture-incorrect-parentheses-style and pytest-incorrect-mark-parentheses-style (PT001 and PT023 respectively).

Previously, PT001 would by default change @pytest.fixture decorators to @pytest.fixture(), and PT023 would change @pytest.mark.foo decorators to @pytest.mark.foo(). They will now both remove parentheses by default, rather than adding them. This means that these rules now adhere more closely to the style recommendations made by the official pytest project.

These rules are both configurable. To revert to Ruff's previous default behaviors, use the lint.flake8-pytest-style.mark-parentheses and lint.flake8-pytest-style.fixture-parentheses settings in your Ruff configuration file. For example, in a pyproject.toml file:

[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = true
mark-parentheses = true

These rules also both come with safe autofixes, so you should be able to easily fix any new violations of these rules caused by this change by running ruff check . --fix --select=PT001 --select=PT023.

Rule stabilizations #

This release stabilizes nine rules originally derived from the pylint linter, all of which were previously only available with --preview:

Two PYI rules (originally derived from the flake8-pyi linter), and one RUF rule, have also been stabilised:

Other behavior stabilizations #

This release also stabilizes several preview-mode features relating to our ASYNC rules. ASYNC100, ASYNC109, ASYNC110, ASYNC115 and ASYNC116 have all had their scope increased so that they detect antipatterns in asyncio and anyio code as well as antipatterns in trio code:

Finally, autofixes have been promoted to stable for the following rules in our flake8-return category:


View the full changelog on GitHub.

Read more about Astral — the company behind Ruff.