Skip to content

Commit 8f74d07

Browse files
maybe fixed pyproject
1 parent 2e628de commit 8f74d07

File tree

1 file changed

+255
-68
lines changed

1 file changed

+255
-68
lines changed

pyproject.toml

Lines changed: 255 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,260 @@
1-
[build-system]
2-
requires = ["setuptools>=61.0"]
3-
build-backend = "setuptools.build_meta"
1+
name: Installation Test
42

5-
[project]
6-
name = "cotarag"
7-
version = "0.10.0"
8-
description = "Cognitive Thought and Retrieval Augmented Generation - An advanced AI agent framework combining CoTAEngine and AcceleRAG"
9-
authors = [
10-
{ name = "Kernel-Dirichlet", email = "elliottdev93@gmail.com" }
11-
]
12-
readme = "README.md"
13-
requires-python = ">=3.12"
14-
license = "AGPL-3.0"
15-
classifiers = [
16-
"Development Status :: 4 - Beta",
17-
"Intended Audience :: Developers",
18-
"Programming Language :: Python :: 3.12",
19-
"Topic :: Scientific/Engineering :: Artificial Intelligence",
20-
"Topic :: Software Development :: Libraries :: Python Modules"
21-
]
22-
dependencies = [
23-
"openai>=1.0.0",
24-
"anthropic>=0.8.0",
25-
"arxiv>=2.0.0",
26-
"requests>=2.31.0",
27-
"torch>=2.1.0",
28-
"torchvision>=0.16.0",
29-
"transformers>=4.36.0",
30-
"scikit-learn>=1.3.0",
31-
"Pillow>=10.0.0",
32-
"matplotlib>=3.9.4",
33-
"PyPDF2>=3.0.1"
34-
]
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
358

36-
[project.optional-dependencies]
37-
dev = [
38-
"pytest>=7.0.0",
39-
"pytest-cov>=4.0.0",
40-
"black>=23.0.0",
41-
"isort>=5.0.0",
42-
"mypy>=1.0.0",
43-
"ruff>=0.1.0"
44-
]
9+
jobs:
10+
test:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
include:
15+
- os: ubuntu-latest
16+
distro: ubuntu
17+
category: linux
18+
package_manager: apt
19+
- os: ubuntu-latest
20+
distro: debian
21+
category: linux
22+
package_manager: apt
23+
- os: ubuntu-latest
24+
distro: fedora
25+
category: linux
26+
package_manager: dnf
27+
- os: ubuntu-latest
28+
distro: rhel
29+
category: linux
30+
package_manager: yum
31+
- os: ubuntu-latest
32+
distro: arch
33+
category: linux
34+
package_manager: pacman
35+
- os: ubuntu-latest
36+
distro: gentoo
37+
category: linux
38+
package_manager: emerge
39+
- os: macos-latest
40+
distro: macos
41+
category: macos
42+
package_manager: brew
43+
- os: windows-latest
44+
distro: windows
45+
category: windows
46+
package_manager: pip
4547

46-
[project.urls]
47-
Homepage = "https://github.com/Kernel-Dirichlet/CoTARAG"
48-
Documentation = "https://github.com/Kernel-Dirichlet/CoTARAG#readme"
49-
Repository = "https://github.com/Kernel-Dirichlet/CoTARAG"
50-
Issues = "https://github.com/Kernel-Dirichlet/CoTARAG/issues"
48+
steps:
49+
- uses: actions/checkout@v3
50+
51+
- name: Set up Python 3.12
52+
uses: actions/setup-python@v4
53+
with:
54+
python-version: "3.12"
55+
56+
- name: Install system dependencies
57+
id: install_deps
58+
continue-on-error: true
59+
run: |
60+
echo "Installing dependencies for ${{ matrix.distro }} using ${{ matrix.package_manager }}"
61+
case "${{ matrix.package_manager }}" in
62+
"apt")
63+
sudo apt-get update
64+
sudo apt-get install -y build-essential python3-dev
65+
;;
66+
"dnf")
67+
sudo dnf update -y
68+
sudo dnf install -y gcc gcc-c++ make python3-devel
69+
;;
70+
"yum")
71+
sudo yum update -y
72+
sudo yum groupinstall -y "Development Tools"
73+
sudo yum install -y python3-devel
74+
;;
75+
"pacman")
76+
sudo pacman -Syu --noconfirm
77+
sudo pacman -S --noconfirm base-devel python-pip python-setuptools
78+
;;
79+
"emerge")
80+
sudo emerge --sync
81+
sudo emerge --update --deep --with-bdeps=y @world
82+
sudo emerge --noreplace dev-lang/python:3.12
83+
;;
84+
"brew")
85+
brew update
86+
brew install python@3.12
87+
;;
88+
"pip")
89+
python -m pip install --upgrade pip setuptools wheel
90+
;;
91+
esac
92+
echo "deps_status=${{ job.status }}" >> $GITHUB_OUTPUT
5193

52-
[tool.setuptools]
53-
packages = [
54-
"cotarag",
55-
"cotarag.cota_engine",
56-
"cotarag.accelerag",
57-
"cotarag.accelerag.embedders",
58-
"cotarag.accelerag.indexers",
59-
"cotarag.accelerag.retrievers",
60-
"cotarag.accelerag.query_engines",
61-
"cotarag.accelerag.scorers",
62-
"cotarag.accelerag.cachers",
63-
"cotarag.accelerag.managers"
64-
]
94+
- name: Test PyPI Installation
95+
if: steps.install_deps.outcome == 'success'
96+
id: pypi_install
97+
continue-on-error: true
98+
run: |
99+
echo "Testing PyPI installation on ${{ matrix.distro }}"
100+
python -m pip install --upgrade pip
101+
pip install cotarag
102+
echo "pypi_install_status=${{ job.status }}" >> $GITHUB_OUTPUT
65103

66-
[tool.setuptools.package-data]
67-
cotarag = [
68-
"py.typed",
69-
"accelerag/*.py",
70-
"accelerag/*/*.py",
71-
"accelerag/*/*/*.py",
72-
"cota_engine/*.py",
73-
]
104+
- name: Test Local Build and Install
105+
if: steps.install_deps.outcome == 'success'
106+
id: local_install
107+
continue-on-error: true
108+
run: |
109+
echo "Testing local build and install on ${{ matrix.distro }}"
110+
python -m pip install --upgrade pip build
111+
python -m build
112+
pip install dist/*.whl
113+
echo "local_install_status=${{ job.status }}" >> $GITHUB_OUTPUT
114+
115+
- name: Test imports (PyPI)
116+
if: steps.pypi_install.outcome == 'success'
117+
id: test_imports_pypi
118+
continue-on-error: true
119+
run: |
120+
echo "Testing imports from PyPI installation on ${{ matrix.distro }}"
121+
python -c "
122+
try:
123+
import cotarag
124+
print('✓ cotarag')
125+
import cotarag.cota_engine
126+
print('✓ cotarag.cota_engine')
127+
import cotarag.cota_engine.cota_engines
128+
print('✓ cotarag.cota_engine.cota_engines')
129+
import cotarag.cota_engine.thought_actions
130+
print('✓ cotarag.cota_engine.thought_actions')
131+
import cotarag.accelerag
132+
print('✓ cotarag.accelerag')
133+
import cotarag.accelerag.managers
134+
print('✓ cotarag.accelerag.managers')
135+
from cotarag.accelerag.managers import RAGManager
136+
print('✓ RAGManager')
137+
import cotarag.accelerag.query_utils
138+
print('✓ cotarag.accelerag.query_utils')
139+
import cotarag.accelerag.query_engines.query_engines
140+
print('✓ cotarag.accelerag.query_engines.query_engines')
141+
import cotarag.accelerag.embedders
142+
print('✓ cotarag.accelerag.embedders')
143+
import cotarag.accelerag.indexers
144+
print('✓ cotarag.accelerag.indexers')
145+
import cotarag.accelerag.retrievers
146+
print('✓ cotarag.accelerag.retrievers')
147+
import cotarag.accelerag.scorers
148+
print('✓ cotarag.accelerag.scorers')
149+
import cotarag.accelerag.cachers
150+
print('✓ cotarag.accelerag.cachers')
151+
print('\nAll PyPI imports successful!')
152+
except ImportError as e:
153+
print(f'\nPyPI Import failed: {str(e)}')
154+
exit(1)
155+
"
156+
echo "pypi_imports_status=${{ job.status }}" >> $GITHUB_OUTPUT
157+
158+
- name: Test imports (Local)
159+
if: steps.local_install.outcome == 'success'
160+
id: test_imports_local
161+
continue-on-error: true
162+
run: |
163+
echo "Testing imports from local installation on ${{ matrix.distro }}"
164+
python -c "
165+
try:
166+
import cotarag
167+
print('✓ cotarag')
168+
import cotarag.cota_engine
169+
print('✓ cotarag.cota_engine')
170+
import cotarag.cota_engine.cota_engines
171+
print('✓ cotarag.cota_engine.cota_engines')
172+
import cotarag.cota_engine.thought_actions
173+
print('✓ cotarag.cota_engine.thought_actions')
174+
import cotarag.accelerag
175+
print('✓ cotarag.accelerag')
176+
import cotarag.accelerag.managers
177+
print('✓ cotarag.accelerag.managers')
178+
from cotarag.accelerag.managers import RAGManager
179+
print('✓ RAGManager')
180+
import cotarag.accelerag.query_utils
181+
print('✓ cotarag.accelerag.query_utils')
182+
import cotarag.accelerag.query_engines.query_engines
183+
print('✓ cotarag.accelerag.query_engines.query_engines')
184+
import cotarag.accelerag.embedders
185+
print('✓ cotarag.accelerag.embedders')
186+
import cotarag.accelerag.indexers
187+
print('✓ cotarag.accelerag.indexers')
188+
import cotarag.accelerag.retrievers
189+
print('✓ cotarag.accelerag.retrievers')
190+
import cotarag.accelerag.scorers
191+
print('✓ cotarag.accelerag.scorers')
192+
import cotarag.accelerag.cachers
193+
print('✓ cotarag.accelerag.cachers')
194+
print('\nAll local imports successful!')
195+
except ImportError as e:
196+
print(f'\nLocal Import failed: {str(e)}')
197+
exit(1)
198+
"
199+
echo "local_imports_status=${{ job.status }}" >> $GITHUB_OUTPUT
200+
201+
- name: Report Results
202+
if: always()
203+
run: |
204+
echo "=== Test Results for ${{ matrix.distro }} ==="
205+
echo "Category: ${{ matrix.category }}"
206+
echo "Package Manager: ${{ matrix.package_manager }}"
207+
echo "Dependencies Installation: ${{ steps.install_deps.outcome }}"
208+
echo "PyPI Installation: ${{ steps.pypi_install.outcome }}"
209+
echo "PyPI Import Tests: ${{ steps.test_imports_pypi.outcome }}"
210+
echo "Local Build/Install: ${{ steps.local_install.outcome }}"
211+
echo "Local Import Tests: ${{ steps.test_imports_local.outcome }}"
212+
echo "=========================================="
213+
214+
# Create detailed report file
215+
{
216+
echo "Test Results for ${{ matrix.distro }}"
217+
echo "----------------------------------------"
218+
echo "Category: ${{ matrix.category }}"
219+
echo "Package Manager: ${{ matrix.package_manager }}"
220+
echo "Dependencies Installation: ${{ steps.install_deps.outcome }}"
221+
echo "PyPI Installation: ${{ steps.pypi_install.outcome }}"
222+
echo "PyPI Import Tests: ${{ steps.test_imports_pypi.outcome }}"
223+
echo "Local Build/Install: ${{ steps.local_install.outcome }}"
224+
echo "Local Import Tests: ${{ steps.test_imports_local.outcome }}"
225+
echo "----------------------------------------"
226+
} >> test_results_${{ matrix.distro }}.txt
227+
228+
# Upload results as artifact
229+
echo "test_results_${{ matrix.distro }}.txt" >> artifact_paths.txt
230+
231+
publish:
232+
needs: test
233+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
234+
runs-on: ubuntu-latest
235+
steps:
236+
- uses: actions/checkout@v3
237+
238+
- name: Set up Python 3.12
239+
uses: actions/setup-python@v4
240+
with:
241+
python-version: "3.12"
242+
243+
- name: Install build dependencies
244+
run: |
245+
python -m pip install --upgrade pip
246+
pip install build twine
247+
248+
- name: Update version
249+
run: |
250+
# Increment patch version
251+
sed -i 's/version = "0.10.0"/version = "0.10.1"/' pyproject.toml
252+
253+
- name: Build package
254+
run: python -m build
255+
256+
- name: Publish to PyPI
257+
env:
258+
TWINE_USERNAME: __token__
259+
TWINE_PASSWORD: ${{ secrets.PYPI_KEY }}
260+
run: python -m twine upload --verbose dist/*

0 commit comments

Comments
 (0)