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
36 changes: 20 additions & 16 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,43 +13,49 @@ jobs:
strategy:
matrix:
python-version: ['3.12']

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential libffi-dev libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev libncurses5-dev libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev libjpeg-dev libpng-dev libtiff-dev libwebp-dev libopenjp2-7-dev libharfbuzz-dev libfribidi-dev libfreetype6-dev libfontconfig1-dev libblas-dev liblapack-dev libatlas-base-dev gfortran libpoppler-cpp-dev libpoppler-dev libhdf5-dev libnetcdf-dev libgl1 libglib2.0-0 libsm6 libxext6 libxrender-dev libgomp1 libcairo2-dev libpango1.0-dev libpangocairo-1.0-0 libgdk-pixbuf2.0-dev libffi-dev shared-mime-info graphviz libgraphviz-dev

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}

- name: Cache SDK generation
uses: actions/cache@v3
with:
path: src/tooluniverse/tools
key: ${{ runner.os }}-sdk-${{ hashFiles('scripts/build_tools.py', 'src/tooluniverse/data/*.json') }}

- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Install project with dev extras
run: |
uv pip install -e .[dev] --system


- name: Check code formatting/linting requirements
uses: astral-sh/ruff-action@v3
with:
version: "latest"
run: ruff check

- name: Generate SDK
run: python scripts/build_tools.py

- name: Run fast tests (excluding tools, examples, and api)
run: |
pytest tests/ -v \
Expand All @@ -61,30 +67,28 @@ jobs:
--ignore=tests/tools \
--ignore=tests/examples \
--ignore=tests/api

- name: Test doctor CLI tool
run: |
python -m src.tooluniverse.doctor

- name: Run tools, examples, and api tests (optional, requires network)
if: github.event.inputs.run_tools_tests == 'true' || github.event_name == 'workflow_dispatch'
run: |
pytest tests/tools/ tests/examples/ tests/api/ -v \
--tb=short \
-m "not slow and not require_api_keys"

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
if: github.ref == 'refs/heads/main'
with:
file: ./coverage.xml
fail_ci_if_error: false

- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.python-version }}
path: coverage.xml


path: coverage.xml
31 changes: 6 additions & 25 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,19 @@ exclude: |
)

repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-ast
- id: check-yaml
- id: check-toml

- repo: https://github.com/psf/black
rev: 25.9.0
hooks:
- id: black
args: ["--line-length=88"]
language_version: python3

- repo: https://github.com/PyCQA/autoflake
rev: v2.3.1
hooks:
- id: autoflake
args: ["--remove-all-unused-imports", "--remove-unused-variables", "--in-place"]

- repo: https://github.com/PyCQA/flake8
rev: 7.3.0
hooks:
- id: flake8
additional_dependencies: ["flake8-bugbear"]
args: ["--max-line-length=88", "--extend-ignore=E501,F401,F541,E203,W503"]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.4
rev: v0.14.5
hooks:
- id: ruff
args: ["--fix", "--line-length=88", "--ignore=E203"]
# Run the linter.
- id: ruff-check
args: [ --fix ] # automatically fix linting issues
# Run the formatter.
- id: ruff-format
23 changes: 17 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ authors = [
dependencies = [
"requests>=2.32.0",
"numpy>=2.2.0",
"sympy>=1.12.0", # Symbolic mathematics for Python executor
"sympy>=1.12.0", # Symbolic mathematics for Python executor
"graphql-core>=3.2.0",
"fastapi>=0.116.0",
"uvicorn>=0.35.0",
Expand All @@ -31,7 +31,7 @@ dependencies = [
"rcsb-api>=1.4.0",
"fitz>=0.0.1.dev2",
"pandas>=2.2.3",
"setuptools>=70.0.0,<81.0.0", # Fix pkg_resources deprecation warnings
"setuptools>=70.0.0,<81.0.0", # Fix pkg_resources deprecation warnings
"pdfplumber>=0.11.0",
"playwright>=1.55.0",
"faiss-cpu>=1.12.0",
Expand All @@ -58,12 +58,11 @@ dev = [
"pytest-timeout>=2.3.1",
"pytest-mock>=3.14.0",
"pytest-asyncio>=0.21.0",
"requests-mock>=1.12.1",
"black>=22.0",
"flake8>=4.0",
"pre-commit>=2.0",
"pytest-xdist>=3.0",
"pytest-html>=3.0",
"requests-mock>=1.12.1",
"ruff>=0.14.5",
]
docs = [
"sphinx>=4.0",
Expand Down Expand Up @@ -155,4 +154,16 @@ dev = [
]

[tool.uv.sources]
tooluniverse = { workspace = true }
tooluniverse = { workspace = true }

[tool.ruff]
line-length = 88
exclude = [
".venv",
"docs",
"examples",
]
unsafe-fixes = true

[tool.ruff.lint]
ignore = ["E203", "E402", "E501", "F401", "F541"]
Loading