Skip to content

Commit

Permalink
Enhance linter configuration, update shell profile handling, and impr…
Browse files Browse the repository at this point in the history
…ove installation scripts for Windows and Linux
  • Loading branch information
Alex Al-Saffar committed Feb 11, 2025
1 parent f43eecc commit 9eba22b
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 15 deletions.
21 changes: 12 additions & 9 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# from https://docs.astral.sh/ruff/configuration/

# Same as Black.
line-length = 88
indent-width = 4

# Assume Python 3.8
# target-version = "py38"


# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
Expand All @@ -25,22 +33,17 @@ exclude = [
"venv",
]

# Same as Black.
line-length = 88
indent-width = 4

# Assume Python 3.8
# target-version = "py38"

[lint]
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
# McCabe complexity (`C901`) by default.
select = ["E4", "E7", "E9", "F"]
ignore = ["E701", # multiple statements in one line.
"E702",
ignore = [
"E701", # multiple statements in one line.
"E702",
# "F541", # F string without placeholders.
"E721", # don't compare types use isinstance
"E721", # don't compare types use isinstance
]

# Allow fix for all enabled rules (when `--fix`) is provided.
Expand Down
1 change: 1 addition & 0 deletions llm.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* [link](https://github.com/deepset-ai/haystack) `frameworks for LLM apps`.
* https://github.com/joaomdmoura/crewAI `framework for orchestrating role-playing, autonomous AI agents`.
* https://github.com/microsoft/autogen `framework for multiple agents`.
* https://github.com/huggingface/smolagents `framework for multiple agents`.
* https://github.com/run-llama/llama_index `framework for your LLM application`.
* https://github.com/langchain-ai/langchain `framework for LLM apps`.
* https://github.com/agenta-ai/agenta
Expand Down
7 changes: 5 additions & 2 deletions src/machineconfig/profile/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,12 @@ def create_default_shell_profile():

def get_shell_profile_path():
if system == "Windows":
res = Terminal().run("$profile", shell="pwsh").op2path()
obj = Terminal().run("$PROFILE", shell="pwsh")
res = obj.op2path()
if isinstance(res, P): profile_path = res
else: raise ValueError(f"Could not get profile path for Windows. Got {res}")
else:
obj.print(capture=False)
raise ValueError(f"Could not get profile path for Windows. Got {res}")
elif system == "Linux": profile_path = P("~/.bashrc").expanduser()
else: raise ValueError(f"Not implemented for this system {system}")
print(f"Working on shell profile `{profile_path}`")
Expand Down
2 changes: 2 additions & 0 deletions src/machineconfig/setup_linux/apps_dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ if [ "$package_manager" = "nala" ]; then
else
~/.nix-profile/bin/nix-env -iA nixpkgs.fortune || true
fi
# as per https://nbconvert.readthedocs.io/en/latest/install.html#installing-tex
# sudo nala install texlive-xetex texlive-fonts-recommended texlive-plain-generic -y


yes '' | sed 3q; echo "----------------------------- installing toilet ----------------------------"; yes '' | sed 3q
Expand Down
4 changes: 2 additions & 2 deletions src/machineconfig/setup_windows/apps.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ winget install --no-upgrade --name "WezTerm" --Id "wez.wezt
winget install --no-upgrade --name "Oh My Posh" --Id "JanDeDobbeleer.OhMyPosh" --source winget --scope user --accept-package-agreements --accept-source-agreements
winget install --no-upgrade --name "Starship" --Id "Starship.Starship" --source winget --scope user --accept-package-agreements --accept-source-agreements
winget install --no-upgrade --name "Git" --Id "Git.Git" --source winget --scope user --accept-package-agreements --accept-source-agreements
winget install --no-upgrade --name "Powershell" --Id "Microsoft.PowerShell" --source winget --scope user --accept-package-agreements --accept-source-agreements # powershell require admin

#winget install --no-upgrade --name "Google Chrome" --Id "Google.Chrome" --source winget --scope user --accept-package-agreements --accept-source-agreements
#winget install --no-upgrade --name "Chrome Remote Desktop Host" --Id "Google.ChromeRemoteDesktop" --source winget --scope user
Expand Down Expand Up @@ -41,11 +42,10 @@ winget install --no-upgrade --name "Git" --Id "Git.Git
# ================================================== Shells ===========================================

powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
winget install --no-upgrade --name "Python" --Id Python.Python.3.11 --source winget --scope user --accept-package-agreements --accept-source-agreements # from https:\\winget.run Python.Python.3.9

# winget install --no-upgrade --name "Python" --Id Python.Python.3.11 --source winget --scope user --accept-package-agreements --accept-source-agreements # from https:\\winget.run Python.Python.3.9
# the two above require Restart-Computer -Force before they are available in PATH, OR:
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
winget install --no-upgrade --name "Powershell" --Id "Microsoft.PowerShell" --source winget --scope user --accept-package-agreements --accept-source-agreements # powershell require admin

# Install icons
Install-Module -Name Terminal-Icons -Repository PSGallery
Expand Down
5 changes: 3 additions & 2 deletions src/machineconfig/setup_windows/web_shortcuts/interactive.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,11 @@ if ($choice -eq "y" -or $choice -eq "Y") {
# python -m fire machineconfig.scripts.python.devops_devapps_install main --which=brave
# python -m fire machineconfig.scripts.python.devops_devapps_install main --which=code
winget install --no-upgrade --name "Windows Terminal" --Id "Microsoft.WindowsTerminal" --source winget --scope user --accept-package-agreements --accept-source-agreements # Terminal is is installed by default on W 11
winget install --no-upgrade --name "Brave" --Id "Brave.Brave" --source winget --scope user --accept-package-agreements --accept-source-agreements
winget install --no-upgrade --name "Microsoft Visual Studio Code" --Id "Microsoft.VisualStudioCode" --source winget --scope user --accept-package-agreements --accept-source-agreements
winget install --no-upgrade --name "Powershell" --Id "Microsoft.PowerShell" --source winget --scope user --accept-package-agreements --accept-source-agreements # powershell require admin
python -m fire machineconfig.setup_windows.wt_and_pwsh.set_pwsh_theme install_nerd_fonts
python -m fire machineconfig.setup_windows.wt_and_pwsh.set_wt_settings main
winget install --no-upgrade --name "Brave" --Id "Brave.Brave" --source winget --scope user --accept-package-agreements --accept-source-agreements
winget install --no-upgrade --name "Microsoft Visual Studio Code" --Id "Microsoft.VisualStudioCode" --source winget --scope user --accept-package-agreements --accept-source-agreements

} else {
Write-Host "Installation aborted."
Expand Down

0 comments on commit 9eba22b

Please sign in to comment.