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

推荐订阅源

P
Palo Alto Networks Blog
大猫的无限游戏
大猫的无限游戏
Martin Fowler
Martin Fowler
GbyAI
GbyAI
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
量子位
T
The Blog of Author Tim Ferriss
Y
Y Combinator Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
CERT Recently Published Vulnerability Notes
Recent Announcements
Recent Announcements
A
About on SuperTechFans
aimingoo的专栏
aimingoo的专栏
P
Privacy International News Feed
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
博客园 - 叶小钗
L
Lohrmann on Cybersecurity
G
GRAHAM CLULEY
T
The Exploit Database - CXSecurity.com
Hugging Face - Blog
Hugging Face - Blog
P
Proofpoint News Feed
NISL@THU
NISL@THU
博客园 - Franky
C
Cybersecurity and Infrastructure Security Agency CISA
The Register - Security
The Register - Security
M
MIT News - Artificial intelligence
Know Your Adversary
Know Your Adversary
A
Arctic Wolf
F
Full Disclosure
T
Threat Research - Cisco Blogs
P
Privacy & Cybersecurity Law Blog
The Hacker News
The Hacker News
博客园 - 【当耐特】
D
Docker
T
Tailwind CSS Blog
S
SegmentFault 最新的问题
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Jina AI
Jina AI
Help Net Security
Help Net Security
V
Visual Studio Blog
小众软件
小众软件
B
Blog
Vercel News
Vercel News
云风的 BLOG
云风的 BLOG
N
News and Events Feed by Topic
Forbes - Security
Forbes - Security
N
Netflix TechBlog - Medium
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
C
Cisco Blogs
Security Archives - TechRepublic
Security Archives - TechRepublic

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.