-
Notifications
You must be signed in to change notification settings - Fork 8
Submission of Team 3 #2
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| version: 2.1 | ||
|
|
||
| jobs: | ||
| test: | ||
| docker: | ||
| - image: cimg/python:3.12 | ||
| steps: | ||
| - checkout | ||
| - run: | ||
| name: Install uv | ||
| command: | | ||
| curl -sSL https://install.uv.tools | bash | ||
| - run: | ||
| name: Install dependencies | ||
| command: uv init # Installs dependencies from pyproject.toml | ||
| - run: | ||
| name: Run pytest tests | ||
| command: pytest tests | ||
| - run: | ||
| name: Run ruff for linting | ||
| command: ruff check . | ||
| - run: | ||
| name: Run mypy for type checking | ||
| command: mypy . | ||
|
|
||
| workflows: | ||
| version: 2 | ||
| test_and_static_analysis: | ||
| jobs: | ||
| - test |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 3.12 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,116 @@ | ||
| # mAIgic-nyu | ||
| # mAIgic | ||
|
|
||
| ## Project Description | ||
| **mAIgic** is an AI-powered assistant designed to enhance productivity and organization by tracking messages and important information across multiple platforms. It identifies and reminds users about follow-ups, ensuring timely responses and efficient information management. With intelligent search capabilities, mAIgic enables users to easily locate conversations and details tied to specific individuals or tasks. | ||
|
|
||
| The project supports popular platforms such as Slack, Trello, and Gmail, providing seamless follow-up tracking, reminders, and contextual search across these communication channels. This integration leverages AI to automate the reminder process, making it easier to stay on top of essential follow-ups and tasks. | ||
|
|
||
| ## Features | ||
| - Unit testing with `pytest` | ||
| - Static code analysis with `ruff` (linter) | ||
| - Type checking with `mypy` | ||
| - Continuous Integration (CI) pipeline with CircleCI, running both tests and static analysis automatically on every push. | ||
|
|
||
| --- | ||
|
|
||
| ## Setup Instructions | ||
|
|
||
| ### 1. Clone the Repository | ||
| ```bash | ||
| git clone https://github.com/your-username/mAIgic.git | ||
| cd mAIgic | ||
| ``` | ||
|
|
||
| ### 2. Install Dependencies | ||
| ```bash | ||
| pip install -r requirements.txt | ||
| ``` | ||
|
|
||
| Alternatively, if using the `uv` package manager: | ||
| ```bash | ||
| uv sync | ||
| ``` | ||
|
|
||
| The above command will create a virtual environment `.venv` and install all the dependencies from the `uv.lock` file. Activate the environment by executing | ||
| ```bash | ||
| source .venv/bin/activate | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## Running Tests | ||
|
|
||
| ### 1. Pytest | ||
| You can run unit tests using `pytest` by running the following command: | ||
| ```bash | ||
| pytest tests | ||
| ``` | ||
|
|
||
| **Example Tests in `tests/test_samples.py`:** | ||
| - Basic arithmetic (addition, subtraction, multiplication, division) | ||
| - String operations (case-insensitive checks) | ||
| - List and dictionary operations | ||
| - Exception handling tests (checking for specific exceptions) | ||
|
|
||
| ### 2. Ruff (Linter) | ||
| Use `ruff` to run static analysis (linting) on your code: | ||
| ```bash | ||
| ruff check . | ||
| ``` | ||
|
|
||
| ### 3. Mypy (Type Checking) | ||
| To perform static type checking using `mypy`, run: | ||
| ```bash | ||
| mypy . | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what checks are enabled?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In our mypy.ini, these following checks are enabled: python_version = 3.8: This specifies that mypy will assume your project is using Python 3.8. Any type hints or language features not supported by Python 3.8 will raise an error. ignore_missing_imports = True: This setting tells mypy to ignore any missing type stubs (type information) for third-party libraries that do not have type hints. This prevents mypy from raising errors about missing types in libraries that aren’t type-annotated. do you want us to include any specific checks?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i would lean towards enabling all available checks and then disabling ones that don't make sense.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have made made the changes to python version and have changed to enable all the checks |
||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## CircleCI Configuration | ||
|
|
||
| The project is integrated with CircleCI for continuous integration. Every push to the repository automatically triggers the following steps: | ||
| 1. **Install dependencies**: Installs `pytest`, `ruff`, and `mypy`. | ||
| 2. **Run tests**: Executes all tests in the `tests/` folder using `pytest`. | ||
| 3. **Run static analysis**: Runs `ruff` for linting and `mypy` for type checking. | ||
|
|
||
|
|
||
|
|
||
| ### View CircleCI Status: | ||
| The latest CircleCI build can be viewed [here](https://app.circleci.com/pipelines/circleci/L7kpZ5X2tZyEgUBhR4SB2j/NxWta8V9bEwRzTNu9Vzc3c/9/workflows/be567b6f-0c9c-41c8-91f7-e4789784b41f). | ||
|
|
||
| --- | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### Common Errors: | ||
| 1. **Missing Dependencies**: If any dependency-related issues arise, ensure all dependencies are installed by running: | ||
| ```bash | ||
| pip install -r requirements.txt | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is better!
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will remove the mention of packages from there |
||
| ``` | ||
| or | ||
| ```bash | ||
| uv init | ||
| ``` | ||
|
|
||
|
|
||
| ## License | ||
| This project is licensed under the MIT License. | ||
|
|
||
|
|
||
| ### Explanation of the Sections: | ||
|
|
||
| 1. **Project Description**: Provides an overview of what the project does. | ||
| 2. **Features**: Highlights the major tools and features used. | ||
| 3. **Setup Instructions**: Guides users on how to clone the repo, install dependencies, and initialize the project. | ||
| 4. **Running Tests**: Explains how to run unit tests, static analysis, and type checks. | ||
| 5. **CircleCI Configuration**: Outlines how CircleCI automates the process of testing and analysis, including the YAML configuration. | ||
| 6. **Troubleshooting**: Offers solutions for common errors like string comparison and missing dependencies. | ||
| 7. **License**: A placeholder for your project's license type. | ||
|
|
||
| ## Teammates | ||
| - Siddharth Singh - sms10221@nyu.edu | ||
| - Adittya Mittal - am14079@nyu.edu | ||
| - Anushka Tawte - at5849@nyu.edu | ||
| - Rafael de Leon - rdl404@nyu.edu | ||
| - Alex Ying - aty2009@nyu.edu | ||
| - Mridul Mittal - mm13171@nyu.edu | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| [mypy] | ||
| python_version = 3.12 | ||
| ignore_missing_imports = True |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| [project] | ||
| name = "mAIgic" | ||
| version = "0.1.0" | ||
| description = "An AI-powered assistant designed to enhance productivity and organization by tracking messages and important information across multiple platforms" | ||
| readme = "README.md" | ||
| requires-python = ">=3.12" | ||
| dependencies = [ | ||
| "pytest", | ||
| "ruff", | ||
| "mypy" | ||
| ] | ||
|
|
||
| [tool.ruff.lint] | ||
| select = ["ALL"] | ||
| extend-ignore = ["S101", "D211", "D213"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| def main() -> None: | ||
| print("Hello from maigic!") | ||
|
|
||
| if __name__ == "__main__": | ||
| main() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| """Make maigic_nyu directory a referenceable package.""" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| """Placeholder API file to test imports.""" | ||
|
|
||
| def add(num1:int, num2:int) -> int: | ||
| return num1 + num2 | ||
|
|
||
| def subtract(num1:int, num2:int) -> int: | ||
| return num1 - num2 | ||
|
|
||
| def multiply(num1:int, num2:int) -> int: | ||
| return num1 * num2 | ||
|
|
||
| def divide(num1:int, num2:int) -> float: | ||
| return num1 / num2 | ||
|
|
||
| def modulo(num1:int, num2:int) -> int: | ||
| return num1 % num2 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| from ._temp_math import ( | ||
| add as add, | ||
| divide as divide, | ||
| modulo as modulo, | ||
| multiply as multiply, | ||
| subtract as subtract, | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| """Make tests directory as a referenceable package.""" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| from src.maigic_nyu.api import ( | ||
| add as add, | ||
| divide as divide, | ||
| modulo as modulo, | ||
| multiply as multiply, | ||
| subtract as subtract, | ||
| ) | ||
|
|
||
| def test_api_add() -> None: | ||
| assert add(7, 2) == 9 | ||
|
|
||
| def test_api_subtract() -> None: | ||
| assert subtract(7, 2) == 5 | ||
|
|
||
| def test_api_multiply() -> None: | ||
| assert multiply(7, 2) == 14 | ||
|
|
||
| def test_api_divide() -> None: | ||
| assert divide(7, 2) == 3.5 | ||
|
|
||
| def test_api_modulo() -> None: | ||
| assert modulo(7, 2) == 1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import pytest | ||
|
|
||
|
|
||
| def test_addition() -> None: | ||
| assert 2 + 2 == 4 | ||
|
|
||
| def test_subtraction() -> None: | ||
| assert 5 - 3 == 2 | ||
|
|
||
| def test_multiplication() -> None: | ||
| assert 3 * 3 == 9 | ||
|
|
||
| def test_division() -> None: | ||
| assert 8 / 2 == 4 | ||
|
|
||
| def test_string_equality() -> None: | ||
| assert "hello".upper() == "HELLO" | ||
|
|
||
| def test_list_append() -> None: | ||
| lst = [1, 2, 3] | ||
| lst.append(4) | ||
| assert lst == [1, 2, 3, 4] | ||
|
|
||
| def test_dictionary_key() -> None: | ||
| d = {"name": "Alice", "age": 30} | ||
| assert "name" in d | ||
| assert d["name"] == "Alice" | ||
|
|
||
| def test_raise_error() -> None: | ||
| with pytest.raises(ZeroDivisionError): | ||
| 1 / 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what checks are enabled?
can we make sure all checks are enabled?
discuss which checks you need to disable because they did not make sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
select = ["E", "F", "W"]:
This is selecting the following categories of checks:
E: PEP 8 style errors (e.g., indentation, whitespace issues)
F: PyFlakes checks (e.g., undefined names, unused variables)
W: PEP 8 style warnings (e.g., line breaks around operators)
Do you want us to enable all the checks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you enable all the checks and then tell me which ones are too pesky and you felt like you wanted to disable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have enabled all the checks.