Skip to content
Open
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
22 changes: 15 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,17 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install package and test deps
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ".[torch,vision,test]"
uv pip install . --group test --system

- name: "Run tests"
run: |
nox -t fenn

- name: Trigger docs rebuild
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: peter-evans/repository-dispatch@v3
Expand Down Expand Up @@ -69,11 +75,13 @@ jobs:
with:
python-version: "3.12"

- name: Install dev dependencies
run: |
python -m pip install --upgrade pip
pip install ".[dev]"
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0

- name: Install dependencies
run: |
uv pip install . --group pre-commit --system

- name: Run pre-commit hook
run: pre-commit run --all-files

3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ If you are new to Git and GitHub, the steps below describe a simple way to contr
`git clone https://github.com/<your-username>/fenn.git`
- Create a new branch for your work:
`git checkout -b feature`
- Make and test your changes.
- Make and test your changes. We use nox for testing:
`nox`
- Stage your changes:
`git add <files>`
- Commit with a clear message:
Expand Down
12 changes: 12 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import nox

nox.options.default_venv_backend = "uv"
nox.options.reuse_existing_virtualenvs = True

EDITABLE_INSTALL = ("-e", ".[test]")


@nox.session(tags=["fenn"])
def unit(session: nox.Session) -> None:
session.install(*EDITABLE_INSTALL)
session.run("pytest", "tests/unit", "--cov", "--cov-branch", "--cov-report=xml")
49 changes: 36 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ dependencies = [

requires-python = ">=3.11"

[project.optional-dependencies]
[dependency-groups]

torch = [
"torch>=2.9.1"
ci = [
"uv==0.11.19",
"nox==2026.4.10",
]

vision = [
Expand All @@ -58,6 +59,35 @@ vision = [
"torchvision>=0.24.1"
]

torch = [
"torch>=2.9.1"
]

test = [
"pytest>=8.0.0",
"pytest-cov>=7.0.0",
"requests-mock>=1.11.0",
"Faker>=25.0.0",
"numpy>=2,<2.3.0",
"colorama>=0.4.6",
"PyYAML>=6.0.3",
"python-dotenv>=1.2.2",
"rich~=13.0.0",
"resend>=2.0.0",
"scikit-learn>=1.7.2",
"flask~=3.0.2",
"flask-wtf>=1.2.0",
{ include-group = "vision" },
{ include-group = "ci" },
]

pre-commit = [
"pre-commit>=4.5.1",
"ruff>=0.15.6",
"typos==1.47.0",
"ty>=0.0.44",
]

transformers = [
"peft ~= 0.18.0",
"transformers ~= 4.57.3"
Expand All @@ -82,17 +112,10 @@ rag-all = [
"youtube-transcript-api>=0.6.0",
]

test = [
"pytest>=8.0.0",
"pytest-cov>=7.0.0",
"requests-mock>=1.11.0",
"Faker>=25.0.0"
]

dev = [
"pre-commit>=4.5.1",
"ruff>=0.15.16",
"ty>=0.0.44",
{ include-group = "ci" },
{ include-group = "test" },
{ include-group = "pre-commit" },
]

[tool.setuptools.packages.find]
Expand Down
Loading
Loading