Skip to content

Commit e3acab0

Browse files
authored
Merge pull request #2 from ryanmac/fix/installer-pyenv-poetry-detection
Fix pyenv/Poetry detection in universal installer
2 parents 3913873 + 097d259 commit e3acab0

File tree

5 files changed

+36
-23
lines changed

5 files changed

+36
-23
lines changed

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121

2222
**One command. Instant AI coordination.**
2323

24-
**Prerequisites for all options:** Git, Python 3.9+, curl (for one-liner), and tar. Run from the root of an existing Git repository.
24+
**Prerequisites for all options:** Git, Python 3.9-3.12, curl (for one-liner), and tar. Run from the root of an existing Git repository. **If using pyenv, ensure your active Python version (e.g., via `pyenv shell 3.12.x`) has Poetry installed if you prefer it; otherwise, the script falls back to pip.**
2525

26-
### Option 1: Universal One-Liner (Recommended - No Cloning Required)
26+
### **Option 1: Universal One-Liner (Recommended - No Cloning Required)**
2727
Run this in your existing project's root directory to download and install Conductor-Score directly:
2828

2929
```bash
@@ -33,8 +33,9 @@ bash <(curl -fsSL https://raw.githubusercontent.com/ryanmac/conductor-score/main
3333
- This method avoids cloning the full Conductor-Score repo and is ideal for integrating into existing projects without repository pollution.
3434
- The script will prompt before overwriting any existing installation.
3535
- **Security best practice:** Review the script at the raw URL before running.
36+
- **Pyenv users:** If Poetry install fails, switch to the Python version that has Poetry installed (e.g., `pyenv shell 3.10.13`) and re-run.
3637

37-
### Option 2: Poetry (Manual Clone)
38+
### Option 2: Poetry (For Cloned Repo)
3839
```bash
3940
# Clone the repository
4041
git clone https://github.com/ryanmac/conductor-score.git
@@ -45,7 +46,7 @@ poetry install
4546
poetry run python setup.py
4647
```
4748

48-
### Option 3: Pip + Virtual Environment
49+
### Option 3: Pip + Virtual Environment (For Cloned Repo)
4950
```bash
5051
# Clone the repository
5152
git clone https://github.com/ryanmac/conductor-score.git
@@ -62,7 +63,7 @@ pip install -r requirements.txt
6263
python setup.py
6364
```
6465

65-
### Option 4: One-Command Install Script (from cloned repo)
66+
### Option 4: One-Command Install Script (For Cloned Repo)
6667
```bash
6768
# From the repository directory:
6869
./install.sh
@@ -344,7 +345,7 @@ python .conductor/scripts/validate-config.py
344345
## Development Setup
345346

346347
### Prerequisites
347-
- Python 3.9+
348+
- Python 3.9-3.12
348349
- Git
349350
- GitHub CLI (optional, for issue integration)
350351

@@ -375,7 +376,7 @@ poetry run black --check .conductor/scripts/ setup.py
375376
### CI/CD
376377
The project uses GitHub Actions for continuous integration:
377378
- **Linting**: flake8 and black formatting checks
378-
- **Testing**: pytest on multiple Python versions (3.9, 3.10, 3.11)
379+
- **Testing**: pytest on multiple Python versions (3.9, 3.10, 3.11, 3.12)
379380
- **Security**: safety vulnerability scanning
380381
- **Platforms**: Ubuntu and macOS
381382

conductor-init.sh

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ if ! command -v git >/dev/null 2>&1; then
3333
exit 1
3434
fi
3535

36-
# Check for Python 3.9+
37-
if ! command -v python3 >/dev/null 2>&1 || ! python3 -c "import sys; exit(0 if sys.version_info >= (3,9) else 1)"; then
38-
echo -e "${RED}❌ Error: Python 3.9+ is required. Please install Python 3.9 or higher.${NC}"
36+
# Check for Python 3.9-3.12
37+
if ! command -v python3 >/dev/null 2>&1 || ! python3 -c "import sys; exit(0 if sys.version_info >= (3,9) and sys.version_info < (3,13) else 1)"; then
38+
echo -e "${RED}❌ Error: Python 3.9-3.12 is required. Please install Python 3.9, 3.10, 3.11, or 3.12.${NC}"
3939
exit 1
4040
fi
4141

@@ -51,6 +51,11 @@ if ! command -v tar >/dev/null 2>&1; then
5151
exit 1
5252
fi
5353

54+
# **Improved: Check for pyenv and suggest version switch if Poetry fails later**
55+
if command -v pyenv >/dev/null 2>&1; then
56+
echo -e "${YELLOW}⚠️ pyenv detected. Ensure your active Python version has Poetry installed if using it.${NC}"
57+
fi
58+
5459
# Check for existing installation
5560
if [ -d ".conductor" ]; then
5661
echo -e "${YELLOW}⚠️ Existing .conductor directory found.${NC}"
@@ -127,15 +132,21 @@ echo ""
127132
# Step 3: Install Dependencies
128133
echo -e "${YELLOW}📦 Installing dependencies...${NC}"
129134

130-
# Prefer Poetry if available, otherwise use pip + venv
131-
if command -v poetry >/dev/null 2>&1; then
132-
echo "🎵 Poetry detected. Using Poetry for installation."
135+
# **Improved: Check if Poetry is functional before using it**
136+
POETRY_AVAILABLE=false
137+
if command -v poetry >/dev/null 2>&1 && poetry --version >/dev/null 2>&1; then
138+
POETRY_AVAILABLE=true
139+
fi
140+
141+
# Prefer Poetry if available and functional, otherwise use pip + venv
142+
if $POETRY_AVAILABLE; then
143+
echo "🎵 Poetry detected and functional. Using Poetry for installation."
133144
poetry install || {
134-
echo -e "${RED}❌ Poetry install failed.${NC}"
145+
echo -e "${RED}❌ Poetry install failed. If using pyenv, try switching versions (e.g., pyenv shell 3.10.13) and re-run.${NC}"
135146
exit 1
136147
}
137148
else
138-
echo "📦 Poetry not found. Using pip and virtual environment."
149+
echo "📦 Poetry not found or not functional. Using pip and virtual environment."
139150
python3 -m venv .venv || {
140151
echo -e "${RED}❌ Failed to create virtual environment.${NC}"
141152
exit 1
@@ -158,7 +169,7 @@ echo ""
158169
echo -e "${YELLOW}🔧 Running automatic setup...${NC}"
159170

160171
# Run setup.py with --auto flag
161-
if command -v poetry >/dev/null 2>&1; then
172+
if $POETRY_AVAILABLE; then
162173
poetry run python setup.py --auto || {
163174
echo -e "${RED}❌ Setup failed.${NC}"
164175
exit 1

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ readme = "README.md"
77
packages = [{include = "conductor_score"}]
88

99
[tool.poetry.dependencies]
10-
python = "^3.9"
10+
python = "^3.9,<3.13"
1111
pyyaml = "^6.0"
1212
requests = "^2.28.0"
1313

@@ -25,7 +25,7 @@ build-backend = "poetry.core.masonry.api"
2525

2626
[tool.black]
2727
line-length = 88
28-
target-version = ['py39']
28+
target-version = ['py39', 'py310', 'py311', 'py312']
2929

3030
[tool.flake8]
3131
max-line-length = 88

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ def create_github_workflows(self):
565565
- name: Setup Python
566566
uses: actions/setup-python@v4
567567
with:
568-
python-version: '3.9'
568+
python-version: '3.12'
569569
570570
- name: Convert Issue to Task
571571
run: |
@@ -587,7 +587,7 @@ def create_github_workflows(self):
587587
- name: Setup Python
588588
uses: actions/setup-python@v4
589589
with:
590-
python-version: '3.9'
590+
python-version: '3.12'
591591
592592
- name: Install dependencies
593593
run: |
@@ -639,7 +639,7 @@ def create_github_workflows(self):
639639
- name: Setup Python
640640
uses: actions/setup-python@v4
641641
with:
642-
python-version: '3.9'
642+
python-version: '3.12'
643643
644644
- name: Install dependencies
645645
run: |

tests/test_basic.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66

77

88
def test_python_version():
9-
"""Test that we're running Python 3.9+"""
10-
assert sys.version_info >= (3, 9), f"Python 3.9+ required, got {sys.version}"
9+
"""Test that we're running Python 3.9-3.12"""
10+
assert sys.version_info >= (3, 9), f"Python 3.9-3.12 required, got {sys.version}"
11+
assert sys.version_info < (3, 13), f"Python 3.13+ not yet supported, got {sys.version}"
1112

1213

1314
def test_dependencies():

0 commit comments

Comments
 (0)