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

推荐订阅源

H
Heimdal Security Blog
A
Arctic Wolf
K
Kaspersky official blog
V
Vulnerabilities – Threatpost
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Simon Willison's Weblog
Simon Willison's Weblog
L
LINUX DO - 热门话题
MongoDB | Blog
MongoDB | Blog
T
Threat Research - Cisco Blogs
D
Docker
爱范儿
爱范儿
T
Tenable Blog
C
Check Point Blog
B
Blog
C
Cisco Blogs
Vercel News
Vercel News
The Cloudflare Blog
T
Threatpost
NISL@THU
NISL@THU
T
Tor Project blog
V2EX - 技术
V2EX - 技术
P
Palo Alto Networks Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Tailwind CSS Blog
G
GRAHAM CLULEY
P
Privacy & Cybersecurity Law Blog
SecWiki News
SecWiki News
博客园 - 司徒正美
S
Security @ Cisco Blogs
GbyAI
GbyAI
S
Secure Thoughts
Microsoft Security Blog
Microsoft Security Blog
The Register - Security
The Register - Security
Recorded Future
Recorded Future
Cloudbric
Cloudbric
Webroot Blog
Webroot Blog
N
News and Events Feed by Topic
Y
Y Combinator Blog
博客园_首页
T
Troy Hunt's Blog
The Hacker News
The Hacker News
雷峰网
雷峰网
Google DeepMind News
Google DeepMind News
U
Unit 42
AWS News Blog
AWS News Blog
PCI Perspectives
PCI Perspectives
V
Visual Studio Blog
博客园 - 聂微东
有赞技术团队
有赞技术团队
酷 壳 – CoolShell
酷 壳 – CoolShell

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 uv: Unified Python packaging Ruff v0.6.0 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.7.0
alex@astral. · 2024-10-17 · via Blog - Astral

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

uv 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.7 #

As with most Ruff minor releases, 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.

With that said, here are a few things to keep in mind when upgrading:

  • Some users will experience new default settings for the rules PT001 and PT023 (in our flake8-pytest category). This was a change we tried to make in Ruff v0.6 but, due to an error on our part, not all users saw the change in behavior. See below for more details.
  • The useless-try-except rule (in our tryceratops category) has been recoded from TRY302 to TRY203. This ensures Ruff's code is consistent with the same rule in the tryceratops linter.
  • The lint.allow-unused-imports setting has been removed. Use lint.pyflakes.allow-unused-imports instead.
  • open-file-with-context-handler (SIM115), a rule which looks for files opened without the use of context managers, now has more expansive behavior. Whereas before it would only look for files opened using the builtin open() function or pathlib.Path(...).open(), it can now detect files being opened using a wide range of other standard-library functions and classes. This improved capability has been available to users of preview mode for several months, but has now been promoted to stable.

Default behavior changed for flake8-pytest-style rules #

(This time with feeling.)

In Ruff v0.6, we tried to change the default behavior for pytest-fixture-incorrect-parentheses-style and pytest-incorrect-mark-parentheses-style (PT001 and PT023 respectively). The default behavior did indeed change in Ruff v0.6 for many of our users.

Unfortunately, however, some users were still experiencing the old defaults. The specific details of whether users would receive the updated behavior depended on exactly which configuration options were specified (or unspecified) in their Ruff configuration file (pyproject.toml, ruff.toml, or similar).

This bug has now been fixed, thanks to a contribution from Alexey Preobrazhenskiy: in Ruff v0.7, all users will experience the new default behavior.

To recap on the changes that were only partially made in Ruff v0.6: 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 fixes, 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.


View the full changelog on GitHub.

Read more about Astral — the company behind Ruff.