Skip to content
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
merged 29 commits into from
Oct 6, 2024

Conversation

arrowkato
Copy link
Owner

@arrowkato arrowkato commented Oct 5, 2024

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 from 3.12.3 to 3.12.6.

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 function add with type annotations and error handling.
  • tests/test_calc.py: Added unit tests for the add 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.

@arrowkato arrowkato merged commit bd2479c into main Oct 6, 2024
16 checks passed
@arrowkato arrowkato deleted the feature/add_my_favorite_tools branch October 6, 2024 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant