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
17 changes: 0 additions & 17 deletions .github/dependabot.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: checks
on:
pull_request:
paths:
- "src/**"
- "tests/**"
- "pyproject.toml"
workflow_dispatch:

jobs:
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: pytest
on:
workflow_dispatch:
pull_request:
paths:
- "src/**"
- "tests/**"
- "pyproject.toml"

permissions:
contents: write
pull-requests: write

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version-file: "pyproject.toml"

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
version: 0.*.*

- name: Install dependencies
run: uv sync --locked

- name: Run tests (with coverage)
run: |
uv run pytest \
--junitxml=pytest.xml \
--cov-report=term-missing:skip-covered \
--cov=. \
| tee pytest-coverage.txt

- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-coverage-path: ./pytest-coverage.txt
junitxml-path: ./pytest.xml
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,5 @@ venv.bak/
# LSP config files
pyrightconfig.json


# dev biome.js - not required
biome.json
2 changes: 2 additions & 0 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
brew "go-task"
brew "uv"
83 changes: 83 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Contributing

Thanks for you interest in contributing to this project.

Main tools used in this repository:

| Tool | Description |
| ------------------------------------------------ | ---------------------------------- |
| [astral/uv](https://github.com/astral-sh/uv) | Python project and package manager |
| [go-task/task](https://github.com/go-task/task) | Task Runner |
| [j178/prek](https://github.com/j178/prek) | pre-commit hook runner |
| [astral/ruff](https://github.com/astral-sh/ruff) | Formatting/Linting/LSP |
| [astral/ty](https://github.com/astral-sh/ty) | Type Checking |

## AI Policy

Do NOT use AI to create, generate or draft any direct communication such as Issues, Comments, PR Bodies, etc.

You MUST fully understand and be able to explain what your changes do and how they interact with the codebase.

## Development Setup

Clone the repository:

```bash
git clone https://github.com/rtuszik/photon-docker
cd photon-docker
```

#### Dependencies

The Brewfile can be used in order to install `Task` and `uv` with `Homebrew` on MacOS and Linux

```bash
brew bundle
```

On Windows or for other install methods, refer to the official documentation:

- install [Task](https://taskfile.dev/docs/installation)
- install [uv](https://docs.astral.sh/uv/getting-started/installation)

### Install Project

```bash
# installs python project with uv with dev dependencies and hooks
task install
```

## Making Changes

1. Create a feature branch from `dev`.
2. Make your changes.
3. Test your changes by building and running the Docker image:
```bash
task rebuild
```
Verify that Photon starts successfully and OpenSearch is up.
4. Run checks:
```bash
task check
task test
```
5. Commit and push to your fork.
6. Open a pull request to the upstream `dev` branch.

## Code Quality

- All code must pass checks done through `task check`.
- All changes must be tested with Docker.
- Avoid unnecessary comments in the code.

To list available tasks:

```bash
task
```

## Pull Requests

- Target the `dev` branch
- Provide a clear description of changes
- Ensure all checks pass before requesting review
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eclipse-temurin:21.0.9_10-jre-noble
FROM eclipse-temurin:25.0.2_10-jre-noble

# install astral uv
COPY --from=ghcr.io/astral-sh/uv:0.8 /uv /usr/local/bin/
Expand Down
45 changes: 0 additions & 45 deletions Makefile

This file was deleted.

Loading