diff --git a/CHANGELOG.md b/CHANGELOG.md index ab6d007..03967a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,53 @@ # Changelog +## 0.0.1a1 + +### Enhancements + +- Add basic support for non-virtual Python environments ([#17991](https://github.com/astral-sh/ruff/pull/17991)) +- Do not allow invalid virtual environments from discovered `.venv` or `VIRTUAL_ENV` ([#18003](https://github.com/astral-sh/ruff/pull/18003)) +- Refine message for why a rule is enabled ([#18038](https://github.com/astral-sh/ruff/pull/18038)) +- Update `--python` to accept paths to executables in environments ([#17954](https://github.com/astral-sh/ruff/pull/17954)) +- Improve diagnostics for `assert_type` and `assert_never` ([#18050](https://github.com/astral-sh/ruff/pull/18050)) +- Add a note to the diagnostic if a new builtin is used on an old Python version ([#18068](https://github.com/astral-sh/ruff/pull/18068)) + +### Bug fixes + +- Fix infinite recursion bug in `is_disjoint_from` ([#18043](https://github.com/astral-sh/ruff/pull/18043)) +- Recognize submodules in self-referential imports ([#18005](https://github.com/astral-sh/ruff/pull/18005)) + +### Typing + +- Allow a class to inherit from an intersection if the intersection contains a dynamic type and the intersection is not disjoint from `type` ([#18055](https://github.com/astral-sh/ruff/pull/18055)) +- Allow classes to inherit from `type[Any]` or `type[Unknown]` ([#18060](https://github.com/astral-sh/ruff/pull/18060)) +- Apply function specialization to all overloads ([#18020](https://github.com/astral-sh/ruff/pull/18020)) +- Implement `DataClassInstance` protocol for dataclasses ([#18018](https://github.com/astral-sh/ruff/pull/18018)) +- Induct into instances and subclasses when finding and applying generics ([#18052](https://github.com/astral-sh/ruff/pull/18052)) +- Infer parameter specializations of generic aliases ([#18021](https://github.com/astral-sh/ruff/pull/18021)) +- Narrowing for `hasattr()` ([#18053](https://github.com/astral-sh/ruff/pull/18053)) +- Silence false positives for PEP-695 ParamSpec annotations ([#18001](https://github.com/astral-sh/ruff/pull/18001)) +- Understand homogeneous tuple annotations ([#17998](https://github.com/astral-sh/ruff/pull/17998)) +- `__file__` is always a string inside a Python module ([#18071](https://github.com/astral-sh/ruff/pull/18071)) + +### CLI + +- Avoid initializing progress bars early ([#18049](https://github.com/astral-sh/ruff/pull/18049)) + +### Contributors + +- [@soof-golan](https://github.com/soof-golan) +- [@ibraheemdev](https://github.com/ibraheemdev) +- [@dhruvmanila](https://github.com/dhruvmanila) +- [@charliermarsh](https://github.com/charliermarsh) +- [@MichaReiser](https://github.com/MichaReiser) +- [@carljm](https://github.com/carljm) +- [@abhijeetbodas2001](https://github.com/abhijeetbodas2001) +- [@zanieb](https://github.com/zanieb) +- [@AlexWaygood](https://github.com/AlexWaygood) +- [@dcreager](https://github.com/dcreager) +- [@mtshiba](https://github.com/mtshiba) +- [@sharkdp](https://github.com/sharkdp) + ## 0.0.0a8 ### Changes diff --git a/dist-workspace.toml b/dist-workspace.toml index 4e20ec9..8529597 100644 --- a/dist-workspace.toml +++ b/dist-workspace.toml @@ -1,7 +1,7 @@ [workspace] members = ["cargo:./ruff"] packages = ["ty"] -version = "0.0.0-alpha.8" +version = "0.0.1-alpha.1" # Config for 'dist' [dist] diff --git a/docs/reference/cli.md b/docs/reference/cli.md index e83f0cc..ac26903 100644 --- a/docs/reference/cli.md +++ b/docs/reference/cli.md @@ -56,13 +56,17 @@ ty check [OPTIONS] [PATH]...
--project project

Run the command within the given project directory.

All pyproject.toml files will be discovered by walking up the directory tree from the given project directory, as will the project's virtual environment (.venv) unless the venv-path option is set.

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

-
--python path

Path to the Python installation from which ty resolves type information and third-party dependencies.

-

If not specified, ty will look at the VIRTUAL_ENV environment variable.

-

ty will search in the path's site-packages directories for type information and third-party imports.

-

This option is commonly used to specify the path to a virtual environment.

+
--python path

Path to the Python environment.

+

ty uses the Python environment to resolve type information and third-party dependencies.

+

If not specified, ty will attempt to infer it from the VIRTUAL_ENV environment variable or discover a .venv directory in the project root or working directory.

+

If a path to a Python interpreter is provided, e.g., .venv/bin/python3, ty will attempt to find an environment two directories up from the interpreter's path, e.g., .venv. At this time, ty does not invoke the interpreter to determine the location of the environment. This means that ty will not resolve dynamic executables such as a shim.

+

ty will search in the resolved environments's site-packages directories for type information and third-party imports.

--python-platform, --platform platform

Target platform to assume when resolving types.

This is used to specialize the type of sys.platform and will affect the visibility of platform-specific functions and attributes. If the value is set to all, no assumptions are made about the target platform. If unspecified, the current system's platform will be used.

-
--python-version, --target-version version

Python version to assume when resolving types

+
--python-version, --target-version version

Python version to assume when resolving types.

+

The Python version affects allowed syntax, type definitions of the standard library, and type definitions of first- and third-party modules that are conditional on the Python version.

+

By default, the Python version is inferred as the lower bound of the project's requires-python field from the pyproject.toml, if available. Otherwise, the latest stable version supported by ty is used, which is currently 3.13.

+

ty will not infer the Python version from the Python environment at this time.

Possible values: