Skip to content

Commit b736982

Browse files
committedJan 19, 2025
feat(solar-gracefully-barony): migrate to pipx-based installation
- Remove system-wide installation - Implement proper Python package structure - Add Azure OpenAI credential checks - Clean up legacy installation paths This provides a cleaner, more isolated installation process using pipx while maintaining proper credential handling.
1 parent 7e0f53f commit b736982

5 files changed

+97
-25
lines changed
 

‎.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "ontology-framework"]
2+
path = ontology-framework
3+
url = https://github.com/louspringer/ontology-framework

‎git_operations.ttl

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
@prefix meta: <./meta#> .
2+
@prefix metameta: <./metameta#> .
3+
@prefix problem: <./problem#> .
4+
@prefix solution: <./solution#> .
5+
@prefix conversation: <./conversation#> .
6+
@prefix git: <./git#> .
7+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
8+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
9+
@prefix owl: <http://www.w3.org/2002/07/owl#> .
10+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
11+
12+
git:Repository a owl:Class ;
13+
rdfs:label "Git Repository"@en ;
14+
rdfs:comment "A Git version control repository"@en .
15+
16+
git:Remote a owl:Class ;
17+
rdfs:label "Git Remote"@en ;
18+
rdfs:comment "A remote repository location"@en .
19+
20+
git:hasRemote a owl:ObjectProperty ;
21+
rdfs:domain git:Repository ;
22+
rdfs:range git:Remote ;
23+
rdfs:comment "Links a repository to its remote locations"@en .
24+
25+
git:defaultRemote a owl:ObjectProperty ;
26+
rdfs:subPropertyOf git:hasRemote ;
27+
rdfs:comment "Specifies the default remote for a repository"@en .
28+
29+
git:remoteName a owl:DatatypeProperty ;
30+
rdfs:domain git:Remote ;
31+
rdfs:range xsd:string ;
32+
rdfs:comment "The name of the remote (e.g. 'origin')"@en .
33+
34+
git:remoteURL a owl:DatatypeProperty ;
35+
rdfs:domain git:Remote ;
36+
rdfs:range xsd:string ;
37+
rdfs:comment "The URL of the remote repository"@en .
38+
39+
# Example individual
40+
git:ExampleRepo a git:Repository ;
41+
rdfs:label "Example Repository"@en ;
42+
git:defaultRemote [
43+
a git:Remote ;
44+
git:remoteName "origin" ;
45+
git:remoteURL "https://github.com/user/repo.git"
46+
] .

‎install_cllm.sh

+25-25
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
#!/bin/bash
22

3-
# Install CLLM tool
3+
# Ensure pipx is installed and configured
4+
python -m pip install --upgrade pip pipx
5+
pipx ensurepath
46

5-
# Check if running with sudo
6-
if [ "$EUID" -ne 0 ]; then
7-
echo "Please run as root or using sudo"
8-
exit 1
9-
fi
7+
# Clean up old installation
8+
sudo rm -f /usr/local/bin/cllm
9+
10+
# Install with pipx from the correct directory
11+
cd "$(dirname "$0")" # Move to the script's directory
12+
pipx install . --force
1013

11-
# Define the installation directory
12-
INSTALL_DIR="/usr/local/bin"
14+
# Reload PATH
15+
export PATH="$HOME/.local/bin:$PATH"
1316

14-
# Copy the cllm.py script to the installation directory
15-
if [ -f "cllm.py" ]; then
16-
cp cllm.py "$INSTALL_DIR/cllm"
17-
chmod +x "$INSTALL_DIR/cllm"
18-
echo "CLLM script installed successfully in $INSTALL_DIR"
17+
# Set up Azure OpenAI credentials using existing environment variables if present
18+
echo "Setting up Azure OpenAI credentials..."
19+
if [ -n "$AZURE_OPENAI_API_KEY" ]; then
20+
echo "AZURE_OPENAI_API_KEY is set"
1921
else
20-
echo "Error: cllm.py not found in the current directory"
21-
exit 1
22+
echo "Warning: AZURE_OPENAI_API_KEY environment variable not found"
23+
echo "Please set it up with: export AZURE_OPENAI_API_KEY=your_api_key_here"
2224
fi
2325

24-
# Install Python dependencies
25-
pip install openai tiktoken gitignore_parser tqdm pyperclip
26-
27-
echo "CLLM dependencies installed successfully"
28-
29-
# Prompt user to set up Azure OpenAI credentials
30-
echo "Please set up your Azure OpenAI credentials by running the following commands:"
31-
echo "export AZURE_OPENAI_API_KEY=your_api_key_here"
32-
echo "export AZURE_OPENAI_ENDPOINT=your_azure_endpoint_here"
26+
if [ -n "$AZURE_OPENAI_ENDPOINT" ]; then
27+
echo "export AZURE_OPENAI_ENDPOINT=$AZURE_OPENAI_ENDPOINT"
28+
else
29+
echo "Warning: AZURE_OPENAI_ENDPOINT environment variable not found"
30+
echo "Please set it up with: export AZURE_OPENAI_ENDPOINT=your_azure_endpoint_here"
31+
fi
3332

34-
echo "Installation complete. You can now use the 'cllm' command."
33+
echo "Installation complete. You can now use the 'cllm' command."
34+
echo "If 'cllm' command is not found, please run: source ~/.bashrc"

‎ontology-framework

Submodule ontology-framework added at 5fe3370

‎pyproject.toml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[build-system]
2+
requires = ["setuptools>=45", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "cllm"
7+
version = "0.1.0"
8+
description = "CLLM tool"
9+
requires-python = ">=3.7"
10+
dependencies = [
11+
"openai",
12+
"tiktoken",
13+
"gitignore_parser",
14+
"tqdm",
15+
"pyperclip",
16+
]
17+
18+
[project.scripts]
19+
cllm = "cllm.main:main"
20+
21+
[tool.setuptools]
22+
package-dir = {"" = "src"}

0 commit comments

Comments
 (0)
Please sign in to comment.