Skip to content

Conversation

@carljm
Copy link
Contributor

@carljm carljm commented May 13, 2025

First take on a contributing guide for ty. Lots of it is copied from the existing Ruff contribution guide.

I've put this in Ruff repo, since I think a contributing guide belongs where the code is. I also updated the Ruff contributing guide to link to the ty one.

Once this is merged, we can also add a link from the CONTRIBUTING.md in ty repo (which focuses on making contributions to things that are actually in the ty repo), to this guide.

I also updated the pull request template to mention that it might be a ty PR, and mention the [ty] PR title prefix.

Feel free to update/modify/merge this PR before I'm awake tomorrow.

@carljm carljm force-pushed the cjm/contributing-guide branch 2 times, most recently from 833d685 to 984f0fa Compare May 13, 2025 02:13
@carljm carljm force-pushed the cjm/contributing-guide branch from 984f0fa to c670424 Compare May 13, 2025 02:16
@github-actions
Copy link
Contributor

github-actions bot commented May 13, 2025

mypy_primer results

Changes were detected when running on open source projects
hydra-zen (https://github.com/mit-ll-responsible-ai/hydra-zen)
- error[invalid-return-type] src/hydra_zen/wrapper/_implementations.py:945:16: Return type does not match returned value: Expected `DataClass_`, found `@Todo(unsupported type[X] special form) | (((...) -> Any) & dict[Unknown, Unknown]) | (DataClass_ & dict[Unknown, Unknown]) | (list[Any] & dict[Unknown, Unknown]) | dict[Any, Any] | (((...) -> Any) & list[Unknown]) | (DataClass_ & list[Unknown]) | list[Any]`
+ error[invalid-return-type] src/hydra_zen/wrapper/_implementations.py:945:16: Return type does not match returned value: Expected `DataClass_`, found `@Todo(unsupported type[X] special form) | (((...) -> Any) & dict[Unknown, Unknown]) | (DataClass_ & dict[Unknown, Unknown]) | (list[Any] & dict[Unknown, Unknown]) | dict[Any, Any] | (((...) -> Any) & list[Unknown]) | (DataClass_ & list[Unknown]) | list[Any] | (dict[Any, Any] & list[Unknown])`
- error[type-assertion-failure] tests/annotations/declarations.py:956:5: Actual type `PBuilds[Unknown] | StdBuilds[Unknown]` is not the same as asserted type `PBuilds[@Todo(Support for `typing.TypeAlias`)] | StdBuilds[@Todo(Support for `typing.TypeAlias`)]`
- error[type-assertion-failure] tests/annotations/declarations.py:961:5: Actual type `PBuilds[Unknown] | StdBuilds[Unknown]` is not the same as asserted type `PBuilds[@Todo(Support for `typing.TypeAlias`)] | StdBuilds[@Todo(Support for `typing.TypeAlias`)]`
- Found 649 diagnostics
+ Found 647 diagnostics

carljm and others added 3 commits May 12, 2025 21:49
Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. We should add a link from the ty CONTRIBUTING.md to this document.

@MichaReiser MichaReiser added documentation Improvements or additions to documentation ty Multi-file analysis & type inference labels May 13, 2025
@sharkdp sharkdp merged commit 00f672a into main May 13, 2025
34 checks passed
@sharkdp sharkdp deleted the cjm/contributing-guide branch May 13, 2025 08:55
dcreager added a commit that referenced this pull request May 13, 2025
…eep-dish

* origin/main:
  [ty] __file__ is always a string inside a Python module (#18071)
  [ty] Recognize submodules in self-referential imports (#18005)
  [ty] Add a note to the diagnostic if a new builtin is used on an old Python version (#18068)
  [ty] Add tests for `else` branches of `hasattr()` narrowing (#18067)
  [ty] Improve diagnostics for `assert_type` and `assert_never` (#18050)
  [ty] contribution guide (#18061)
  [ty] Implement `DataClassInstance` protocol for dataclasses. (#18018)
  [ruff_python_ast] Fix redundant visitation of test expressions in elif clause statements (#18064)
Glyphack pushed a commit to Glyphack/ruff that referenced this pull request May 21, 2025
First take on a contributing guide for `ty`. Lots of it is copied from
the existing Ruff contribution guide.

I've put this in Ruff repo, since I think a contributing guide belongs
where the code is. I also updated the Ruff contributing guide to link to
the `ty` one.

Once this is merged, we can also add a link from the `CONTRIBUTING.md`
in ty repo (which focuses on making contributions to things that are
actually in the ty repo), to this guide.

I also updated the pull request template to mention that it might be a
ty PR, and mention the `[ty]` PR title prefix.

Feel free to update/modify/merge this PR before I'm awake tomorrow.

---------

Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
Co-authored-by: David Peter <mail@david-peter.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants