Skip to content

Commit 4983a9a

Browse files
authored
Lint fmt (#336)
* dev: Lint and Format * dev: Update Contributing and Setup instructions * dev: Setup lint and format workflow
1 parent ffd33e5 commit 4983a9a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+5424
-1745
lines changed

.github/workflows/code-lint.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Lint and Format
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
jobs:
9+
lint-format:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Install Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version-file: "pyproject.toml"
18+
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install ruff
23+
24+
- name: Run Ruff
25+
run: ruff check --output-format=github .

Contributing.md

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<h1 align="center">Contributors Guide⚡ </h1>
22
<h3 align="center">Welcome to our open-source project! 😍<br> We appreciate your interest in contributing.😊 <br>This guide will help you get started with the project and make your first contribution.</h3>
33

4-
---
4+
---
55

66
<h1 align="center">Creating first Pull Request 🌟</h1>
77

@@ -18,47 +18,59 @@ git clone https://github.com/<your-github-username>/Jarvis.git
1818
cd Jarvis
1919
```
2020

21-
5. Create a virtual environment.
21+
5. Install Dependencies
22+
23+
**Step 1: Install uv (Skip if Already Installed)**
24+
25+
Choose the command for your operating system:
26+
27+
On Linux/macOS (using Bash):
2228
```bash
23-
python -m venv myenv
24-
source myenv/bin/activate # On Windows, use `myenv\Scripts\activate`
29+
curl -LsSf https://astral.sh/uv/install.sh | sh
2530
```
2631

27-
6. Install the dependencies.
28-
```bash
29-
pip install -r requirements.txt
32+
On Windows (using PowerShell):
33+
```sh
34+
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
35+
```
36+
37+
**Step 2: Install Project Dependencies**
38+
39+
Run this command in your project directory. It automatically creates and uses a virtual environment named `.venv`.
40+
```sh
41+
uv sync
3042
```
3143

32-
7. Create a new branch.
44+
6. Create a new branch.
3345
```bash
3446
git checkout -b <your_branch_name>
3547
```
3648

37-
8. Make changes.
38-
9. Stage your changes and commit them.
49+
7. Make changes.
50+
8. Stage your changes and commit them.
3951
```bash
4052
git add .
4153
git commit -m "<your_commit_message"
4254
```
4355

44-
10. Push your local commits to the remote repository.
56+
9. Push your local commits to the remote repository.
4557
```bash
4658
git push -u origin <your_branch_name>
4759
```
4860

49-
11. Create your Pull Request.
50-
12. Congratulations! 🎉 you've made your contribution.
61+
10. Create your Pull Request.
62+
11. Congratulations! 🎉 you've made your contribution.
5163

52-
### Running the Application
64+
### Running the Application
5365

5466
1. Start the application.
5567
```bash
56-
streamlit run Jarvis.py
68+
uv run streamlit run Jarvis.py
5769
```
5870
2. Access the application.
5971
> Open your browser and navigate to `http://localhost:8501`
6072
61-
---
73+
---
6274

6375
### Communication and Support 💬
6476
- Join the project's communication channels to interact with other contributors and seek assistance.
@@ -80,7 +92,7 @@ You can refer to the following articles on basics of Git and Github and also con
8092
- [Getting started with Git and GitHub](https://towardsdatascience.com/getting-started-with-git-and-github-6fcd0f2d4ac6)
8193
- [Learn GitHub from Scratch](https://lab.github.com/githubtraining/introduction-to-github)
8294

83-
---
95+
---
8496

8597
### Note from Admin ❗
8698

Jarvis.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import streamlit as st
22

3-
from src.helpers.structPages import structPages
43
from src.helpers.getFolders import getFolders
4+
from src.helpers.structPages import structPages
55

66

77
def application():
@@ -23,12 +23,15 @@ def application():
2323
pages[folder_name.title()] = structPages(f"{MAIN_DIR}/{folder_dir}")
2424

2525
if st.user.email == st.secrets["general"]["ADMIN_EMAIL"] and st.user.given_name == st.secrets["general"]["ADMIN_NAME"]:
26-
pages.update({
27-
"Admin": [
28-
st.Page("src/apps/auth/env.py", title="Environment Variables", icon=":material/security:"),
29-
]
30-
})
26+
pages.update(
27+
{
28+
"Admin": [
29+
st.Page("src/apps/auth/env.py", title="Environment Variables", icon=":material/security:"),
30+
]
31+
}
32+
)
3133

3234
return st.navigation(pages)
3335

36+
3437
application().run()

SETUP.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Welcome to the Jarvis Virtual Assistant! This guide will walk you through settin
99
Ensure you have the following installed:
1010

1111
- [Python 3.9+](https://www.python.org/downloads/)
12-
- [pip](https://pip.pypa.io/en/stable/)
12+
- [uv](https://docs.astral.sh/uv/)
1313
- [Git](https://git-scm.com/downloads)
1414
- [Streamlit](https://docs.streamlit.io/)
1515

@@ -27,28 +27,26 @@ cd jarvis
2727

2828
---
2929

30-
### 🧰 Set Up a Virtual Environment (Recommended)
30+
### 🧰 Install uv
3131

3232
#### ▶️ Windows
3333

3434
```bash
35-
python -m venv venv
36-
venv\Scripts\activate
35+
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
3736
```
3837

3938
#### 🐧 macOS/Linux
4039

4140
```bash
42-
python3 -m venv venv
43-
source venv/bin/activate
41+
curl -LsSf https://astral.sh/uv/install.sh | sh
4442
```
4543

4644
---
4745

4846
### 🧪 Install Dependencies
4947

5048
```bash
51-
pip install -r requirements.txt
49+
uv sync
5250
```
5351

5452
---
@@ -104,7 +102,7 @@ This will let you access all core features locally during development.
104102
Launch the application:
105103

106104
```bash
107-
streamlit run src/apps/public/home.py
105+
uv run streamlit run src/apps/public/home.py
108106
```
109107

110108
It should open in your browser at `http://localhost:8501`.

pyproject.toml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
[project]
2+
name = "jarvis"
3+
version = "0.1.0"
4+
description = "Jarvis is a powerful virtual AI assistant designed to simplify your daily tasks through voice command integration."
5+
readme = "README.md"
6+
requires-python = ">=3.13"
7+
dependencies = [
8+
"authlib>=1.6.5",
9+
"deep-translator>=1.11.4",
10+
"deepface>=0.0.95",
11+
"faiss-cpu>=1.12.0",
12+
"google-generativeai>=0.8.5",
13+
"groq>=0.32.0",
14+
"kaggle>=1.7.4.5",
15+
"langchain-community>=0.3.30",
16+
"langchain-core>=0.3.78",
17+
"langchain-google-genai>=2.0.10",
18+
"langchain-groq>=0.3.8",
19+
"langchain-text-splitters>=0.3.11",
20+
"matplotlib>=3.10.6",
21+
"mtcnn>=1.0.0",
22+
"opencv-python-headless>=4.12.0.88",
23+
"pint>=0.25",
24+
"plotly>=6.3.1",
25+
"pygame>=2.6.1",
26+
"pymultidictionary>=1.3.2",
27+
"pypdf>=6.1.1",
28+
"pypdf2>=3.0.1",
29+
"pyperclip>=1.11.0",
30+
"pyshorteners>=1.0.1",
31+
"python-barcode>=0.16.1",
32+
"python-dotenv>=1.1.1",
33+
"pytz>=2025.2",
34+
"qrcode>=8.2",
35+
"speedtest-cli>=2.1.3",
36+
"spotipy>=2.25.1",
37+
"streamlit>=1.50.0",
38+
"tensorflow>=2.20.0",
39+
"tf-keras>=2.20.1",
40+
"transformers>=4.57.0",
41+
]
42+
43+
[dependency-groups]
44+
lint = [
45+
"ruff>=0.13.3",
46+
]
47+
48+
[tool.ruff.lint]
49+
select = [
50+
"E",
51+
"F",
52+
"UP",
53+
"B",
54+
"SIM",
55+
"I",
56+
]
57+
58+
[tool.ruff.format]
59+
indent-style = "space"
60+
61+
[tool.ruff]
62+
line-length = 150
63+
indent-width = 2

src/apps/auth/auth.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
from datetime import datetime
2-
import streamlit as st
32
from time import sleep
3+
44
import pytz
5+
import streamlit as st
56

67
from src.utils.greeting import GreetUser
78

9+
810
def unix_to_ist(timestamp):
9-
india_tz = pytz.timezone('Asia/Kolkata')
10-
format_str = '%I:%M:%S %p IST'
11+
india_tz = pytz.timezone("Asia/Kolkata")
12+
format_str = "%I:%M:%S %p IST"
1113
return datetime.fromtimestamp(timestamp, pytz.utc).astimezone(india_tz).strftime(format_str)
1214

15+
1316
def auth():
1417
if st.user and not st.user.is_logged_in:
1518
st.title("🔐 Login Required")
@@ -28,4 +31,5 @@ def auth():
2831
sleep(2)
2932
st.logout()
3033

34+
3135
auth()

src/apps/auth/env.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import streamlit as st
22

3+
34
def displayStreamlitSecrets(data, prefix=""):
45
for key, value in data.items():
56
full_key = f"{prefix}{key}"
@@ -10,6 +11,7 @@ def displayStreamlitSecrets(data, prefix=""):
1011
else:
1112
st.text_input(label=key, value=str(value), disabled=True, key=full_key)
1213

14+
1315
def env():
1416
st.title("Environment Variables")
1517
st.markdown(
@@ -24,4 +26,5 @@ def env():
2426
else:
2527
st.warning("You are not authorized to view the environment variables.", icon="⚠️")
2628

29+
2730
env()

0 commit comments

Comments
 (0)