forked from a5chin/python-uv
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add: add pyright as a static type checker #1
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
add pyright, its settings, and CI.
add sample unit tests with pytest
PR summaries
This pull request introduces several changes to enhance the Python development environment and improve code quality. The main changes include updates to configuration files, the addition of new dependencies, and the introduction of static type checking and testing utilities.
Configuration and Environment Setup:
.devcontainer/devcontainer.json
: Added new extensions for better TOML and Python support (tamasfe.even-better-toml
,ms-python.vscode-pylance
)..env.sample
: Added a sample environment file for setting up the OpenAI API key..python-version
: Updated Python version from3.12.3
to3.12.6
.Static Type Checking:
.github/workflows/pyright.yml
: Added a GitHub Actions workflow for running Pyright for static type checking..pre-commit-config.yaml
: Configured pre-commit hook to run Pyright for static type checking.Dependency Management:
pyproject.toml
: Added new dependencies (langchain-openai
,langchain
,python-dotenv
) and configured Pyright settings for type checking.Code Quality and Testing:
pytest.ini
: Added pytest markers for categorizing tests (e.g., slow, unit_test, integration).python_uv/calc.py
: Added a new functionadd
with type annotations and error handling.tests/test_calc.py
: Added unit tests for theadd
function to check both correct and incorrect inputs.These changes collectively improve the development setup, ensure better code quality through static type checking, and enhance testing capabilities.