⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 0 additions & 38 deletions .dockerignore

This file was deleted.

2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ assignees:

<!-- Mark with an `x` all the checkboxes that apply (like `[x]`) -->

- [ ] I've searched the project's [`issues`](https://github.com/qualifire_dev/qualifire/issues?q=is%3Aissue).
- [ ] I've searched the project's [`issues`](https://github.com/qualifire-dev/qualifire/issues?q=is%3Aissue).

## ❓ Question

Expand Down
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

<!-- Mark with an `x` all the checkboxes that apply (like `[x]`) -->

- [ ] I've read the [`CODE_OF_CONDUCT.md`](https://github.com/qualifire_dev/qualifire/blob/master/CODE_OF_CONDUCT.md) document.
- [ ] I've read the [`CONTRIBUTING.md`](https://github.com/qualifire_dev/qualifire/blob/master/CONTRIBUTING.md) guide.
- [ ] I've read the [`CODE_OF_CONDUCT.md`](https://github.com/qualifire-dev/qualifire/blob/master/CODE_OF_CONDUCT.md) document.
- [ ] I've read the [`CONTRIBUTING.md`](https://github.com/qualifire-dev/qualifire/blob/master/CONTRIBUTING.md) guide.
- [ ] I've updated the code style using `make codestyle`.
- [ ] I've written tests for all new methods and classes that I created.
- [ ] I've written the docstring in Google format for all the methods and classes that I used.
10 changes: 0 additions & 10 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,3 @@ updates:
commit-message:
prefix: ":arrow_up:"
open-pull-requests-limit: 50

- package-ecosystem: "docker"
directory: "/docker"
schedule:
interval: "weekly"
allow:
- dependency-type: "all"
commit-message:
prefix: ":arrow_up:"
open-pull-requests-limit: 50
23 changes: 14 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,30 @@ jobs:
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
fetch-depth: 0 # Fetch all history for TruffleHog to scan commits
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4.7.0
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install and configure Poetry
uses: snok/install-poetry@v1

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: 1.6.1
version: "0.9.22"

- name: Install dependencies
run: |
poetry install
pip install pytest
pip install openai
uv sync

- name: Run style checks
run: |
make check-codestyle
- name: Creadentials search in source code - TruffleHog OSS

- name: Credentials search in source code - TruffleHog OSS
uses: trufflesecurity/[email protected]

- name: Run tests
run: |
make test
21 changes: 10 additions & 11 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,23 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v4.7.0
uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build setuptools wheel twine
- name: Install and configure Poetry
uses: snok/install-poetry@v1

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: 1.6.1
version: "0.9.22"

- name: Build package
run: |
python -m build
uv build
# Verify the wheel is valid
twine check dist/*
uv tool run twine check dist/*

- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ target/
# pyenv
.python-version

# poetry
.venv

# pipenv
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ repos:
hooks:
- id: isort
name: isort
entry: poetry run isort --settings-path pyproject.toml
entry: uv tool run isort --settings-path pyproject.toml
types: [python]
language: system

- repo: local
hooks:
- id: black
name: black
entry: poetry run black --config pyproject.toml
entry: uv tool run black --config pyproject.toml
types: [python]
language: system
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ make pre-commit-install
make test

# Run a single test file
poetry run pytest tests/test_types.py
uv run pytest tests/test_types.py

# Run a specific test
poetry run pytest tests/test_types.py::TestEvaluationRequest::test_validate_messages_input_output -v
uv run pytest tests/test_types.py::TestEvaluationRequest::test_validate_messages_input_output -v

# Format code (isort, black, pyupgrade)
make codestyle
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

## Dependencies

We use `poetry` to manage the [dependencies](https://github.com/python-poetry/poetry).
If you dont have `poetry`, you should install with `make poetry-download`.
We use `uv` to manage the [dependencies](https://docs.astral.sh/uv/).
If you don't have `uv`, you should install with `make uv-download` or follow the [official installation guide](https://docs.astral.sh/uv/getting-started/installation/).

To install dependencies and prepare [`pre-commit`](https://pre-commit.com/) hooks you would need to run `install` command:

Expand All @@ -12,7 +12,7 @@ make install
make pre-commit-install
```

To activate your `virtualenv` run `poetry shell`.
To activate your virtual environment, uv will automatically handle it when running commands with `uv run`.

## Codestyle

Expand Down
87 changes: 38 additions & 49 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,87 +3,63 @@ SHELL := /usr/bin/env bash
PYTHON := python
PYTHONPATH := `pwd`

#* Docker variables
IMAGE := qualifire
VERSION := latest

#* Poetry
.PHONY: poetry-download
poetry-download:
pip install -U poetry==1.2.0
poetry --version

.PHONY: poetry-remove
poetry-remove:
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | $(PYTHON) - --uninstall
#* UV
.PHONY: uv-download
uv-download:
brew install uv
uv --version
Comment on lines +6 to +10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# Check if Makefile exists and read the relevant section
if [ -f "Makefile" ]; then
  echo "=== Lines 6-10 of Makefile ==="
  sed -n '6,10p' Makefile | cat -n
  echo ""
  echo "=== Full Makefile context (first 50 lines) ==="
  head -50 Makefile | cat -n
else
  echo "Makefile not found"
fi

Repository: qualifire-dev/qualifire-python-sdk

Length of output: 1747


🏁 Script executed:

# Check for CI/CD configuration files
find . -maxdepth 3 -name "*.yml" -o -name "*.yaml" | head -20

# Check README
if [ -f "README.md" ]; then
  echo "=== README.md (first 100 lines) ==="
  head -100 README.md
fi

Repository: qualifire-dev/qualifire-python-sdk

Length of output: 3433


🏁 Script executed:

echo "=== build.yml workflow ==="
cat .github/workflows/build.yml

Repository: qualifire-dev/qualifire-python-sdk

Length of output: 995


🏁 Script executed:

# Search for references to uv-download in the codebase
echo "=== Searching for uv-download references ==="
rg "uv-download" --type makefile --type markdown --type txt

# Check for CONTRIBUTING or development docs
echo ""
echo "=== Checking for CONTRIBUTING or dev docs ==="
fd -i "contrib\|dev\|setup" -t f | head -10

# Check if there's any mention of platform requirements
echo ""
echo "=== Searching for platform/OS requirements in docs ==="
rg -i "macos|mac|homebrew|linux|windows|platform" README.md CONTRIBUTING.md 2>/dev/null | head -20

Repository: qualifire-dev/qualifire-python-sdk

Length of output: 275


🏁 Script executed:

# Verify the proposed fix syntax is correct for a Makefile
echo "=== Verifying Makefile shell command syntax ==="
cat > /tmp/test_makefile << 'EOF'
.PHONY: test-uv
test-uv:
	if command -v brew >/dev/null 2>&1; then \
		echo "Brew found"; \
	else \
		echo "No brew"; \
	fi
	echo "Done"
EOF
cat /tmp/test_makefile

Repository: qualifire-dev/qualifire-python-sdk

Length of output: 262


Make uv-download cross‑platform (Homebrew‑only today).

brew install uv fails on Linux/Windows and in non‑Homebrew environments. Consider a fallback to the official installer so the target works everywhere.

💡 Proposed fix
 uv-download:
-	brew install uv
-	uv --version
+	if command -v brew >/dev/null 2>&1; then \
+		brew install uv; \
+	else \
+		curl -Ls https://astral.sh/uv/install.sh | sh; \
+	fi
+	uv --version
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#* UV
.PHONY: uv-download
uv-download:
brew install uv
uv --version
#* UV
.PHONY: uv-download
uv-download:
if command -v brew >/dev/null 2>&1; then \
brew install uv; \
else \
curl -Ls https://astral.sh/uv/install.sh | sh; \
fi
uv --version
🤖 Prompt for AI Agents
In `@Makefile` around lines 6 - 10, The uv-download Makefile target is
macOS/Homebrew-specific; update the uv-download recipe to detect the platform
and use the appropriate installer: if on macOS and brew exists run "brew install
uv", if on Linux try distro package managers (apt/yum/pacman) or download and
run the official UV installer as a fallback, and if on Windows use choco/scoop
or the official installer; ensure the target still verifies installation by
running "uv --version" and fail with a clear message if installation cannot be
performed. Use the uv-download target name and keep the final verification call
to "uv --version".


#* Installation
.PHONY: install
install:
poetry lock -n && poetry export --without-hashes > requirements.txt
poetry install -n
-poetry run mypy --install-types --non-interactive ./
uv sync
-uv run mypy --install-types --non-interactive ./

.PHONY: pre-commit-install
pre-commit-install:
poetry run pre-commit install
uv run pre-commit install

#* Formatters
.PHONY: codestyle
codestyle:
poetry run pyupgrade --exit-zero-even-if-changed --py38-plus **/*.py
poetry run isort --settings-path pyproject.toml ./
poetry run black --config pyproject.toml ./
uv run pyupgrade --exit-zero-even-if-changed --py38-plus **/*.py
uv run isort --settings-path pyproject.toml ./
uv run black --config pyproject.toml ./
uv tool run add-trailing-comma ./**/*.py

.PHONY: formatting
formatting: codestyle

#* Linting
.PHONY: test
test:
PYTHONPATH=$(PYTHONPATH) poetry run pytest -c pyproject.toml --cov-report=html --cov=qualifire tests/
poetry run coverage-badge -o assets/images/coverage.svg -f
PYTHONPATH=$(PYTHONPATH) uv run pytest -c pyproject.toml --cov-report=html --cov=qualifire tests/
uv run coverage-badge -o assets/images/coverage.svg -f

.PHONY: check-codestyle
check-codestyle:
poetry run isort --diff --check-only --settings-path pyproject.toml ./
poetry run black --diff --check --config pyproject.toml ./
poetry run darglint --verbosity 2 qualifire tests
uv run isort --diff --check-only --settings-path pyproject.toml ./
uv run black --diff --check --config pyproject.toml ./
uv run darglint --verbosity 2 qualifire tests
uv tool run add-trailing-comma ./**/*.py

.PHONY: mypy
mypy:
poetry run mypy --config-file pyproject.toml ./
uv run mypy --config-file pyproject.toml ./

.PHONY: check-safety
check-safety:
poetry check
poetry run safety check --full-report
poetry run bandit -ll --skip B113 --recursive qualifire tests
uv run safety check --full-report
uv run bandit -ll --skip B113 --recursive qualifire tests

.PHONY: lint
lint: test check-codestyle mypy check-safety

.PHONY: update-dev-deps
update-dev-deps:
poetry add -D bandit@latest darglint@latest "isort[colors]@latest" mypy@latest pre-commit@latest pydocstyle@latest pylint@latest pytest@latest pyupgrade@latest safety@latest coverage@latest coverage-badge@latest pytest-html@latest pytest-cov@latest
poetry add -D --allow-prereleases black@latest

#* Docker
# Example: make docker-build VERSION=latest
# Example: make docker-build IMAGE=some_name VERSION=0.1.0
.PHONY: docker-build
docker-build:
@echo Building docker $(IMAGE):$(VERSION) ...
docker build \
-t $(IMAGE):$(VERSION) . \
-f ./docker/Dockerfile --no-cache

# Example: make docker-remove VERSION=latest
# Example: make docker-remove IMAGE=some_name VERSION=0.1.0
.PHONY: docker-remove
docker-remove:
@echo Removing docker $(IMAGE):$(VERSION) ...
docker rmi -f $(IMAGE):$(VERSION)
uv add --dev bandit@latest darglint@latest "isort[colors]@latest" mypy@latest pre-commit@latest pydocstyle@latest pylint@latest pytest@latest pyupgrade@latest safety@latest coverage@latest coverage-badge@latest pytest-html@latest pytest-cov@latest
uv add --dev --prerelease=allow black@latest


#* Cleaning
.PHONY: pycache-remove
Expand All @@ -108,7 +84,20 @@ pytestcache-remove:

.PHONY: build-remove
build-remove:
rm -rf build/
rm -rf build/ dist/

.PHONY: cleanup
cleanup: pycache-remove dsstore-remove mypycache-remove ipynbcheckpoints-remove pytestcache-remove

#* Build
.PHONY: build
build:
uv build

.PHONY: build-wheel
build-wheel:
uv build --wheel

.PHONY: build-sdist
build-sdist:
uv build --sdist
36 changes: 18 additions & 18 deletions assets/images/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading