Skip to content
Draft
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
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
27 changes: 11 additions & 16 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,16 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Docker image
run: docker build . --file Dockerfile --tag my-app:latest

- name: Lint with flake8 (inside Docker)
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
docker run --rm my-app:latest flake8 src tests --config=config/.flake8

- name: Test with pytest (inside Docker)
run: |
pytest
docker run --rm my-app:latest pytest -n auto -v tests/
34 changes: 34 additions & 0 deletions =2.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Collecting requests
Using cached requests-2.32.4-py3-none-any.whl.metadata (4.9 kB)
Collecting pydantic
Downloading pydantic-2.11.7-py3-none-any.whl.metadata (67 kB)
Collecting charset_normalizer<4,>=2 (from requests)
Using cached charset_normalizer-3.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (35 kB)
Collecting idna<4,>=2.5 (from requests)
Using cached idna-3.10-py3-none-any.whl.metadata (10 kB)
Collecting urllib3<3,>=1.21.1 (from requests)
Downloading urllib3-2.5.0-py3-none-any.whl.metadata (6.5 kB)
Collecting certifi>=2017.4.17 (from requests)
Using cached certifi-2025.6.15-py3-none-any.whl.metadata (2.4 kB)
Collecting annotated-types>=0.6.0 (from pydantic)
Downloading annotated_types-0.7.0-py3-none-any.whl.metadata (15 kB)
Collecting pydantic-core==2.33.2 (from pydantic)
Downloading pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.8 kB)
Collecting typing-extensions>=4.12.2 (from pydantic)
Using cached typing_extensions-4.14.0-py3-none-any.whl.metadata (3.0 kB)
Collecting typing-inspection>=0.4.0 (from pydantic)
Downloading typing_inspection-0.4.1-py3-none-any.whl.metadata (2.6 kB)
Using cached requests-2.32.4-py3-none-any.whl (64 kB)
Using cached charset_normalizer-3.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (148 kB)
Using cached idna-3.10-py3-none-any.whl (70 kB)
Downloading urllib3-2.5.0-py3-none-any.whl (129 kB)
Downloading pydantic-2.11.7-py3-none-any.whl (444 kB)
Downloading pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.0/2.0 MB 67.1 MB/s eta 0:00:00
Downloading annotated_types-0.7.0-py3-none-any.whl (13 kB)
Using cached certifi-2025.6.15-py3-none-any.whl (157 kB)
Using cached typing_extensions-4.14.0-py3-none-any.whl (43 kB)
Downloading typing_inspection-0.4.1-py3-none-any.whl (14 kB)
Installing collected packages: urllib3, typing-extensions, idna, charset_normalizer, certifi, annotated-types, typing-inspection, requests, pydantic-core, pydantic

Successfully installed annotated-types-0.7.0 certifi-2025.6.15 charset_normalizer-3.4.2 idna-3.10 pydantic-2.11.7 pydantic-core-2.33.2 requests-2.32.4 typing-extensions-4.14.0 typing-inspection-0.4.1 urllib3-2.5.0
Empty file added =2.25.0
Empty file.
60 changes: 60 additions & 0 deletions BRANCH_CLEANUP_RECOMMENDATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Branch Cleanup Recommendation

## Executive Summary

After thorough analysis of 3 unmerged branches, **all should be deleted** as they either remove valuable functionality or contain incomplete/broken implementations.

## Detailed Analysis

### ❌ DELETE: `copilot/fix-13`
**Status**: Tests pass but regressive changes
**Issues**:
- Removes pagination utilities (`stream_paginated_data`, demo files)
- Removes HTTP method support (POST, PUT, PATCH, DELETE)
- Removes webhook credentials from client initialization
- While it adds some tests, the cost is losing working functionality

**Command to delete**: `git push origin --delete copilot/fix-13`

### ❌ DELETE: `copilot/fix-b142c2c2-d3a9-4637-bbc2-0ed979d16113`
**Status**: Tests fail due to incomplete refactoring
**Issues**:
- Massive structural change moving all code to `src/` directory
- Import errors prevent tests from running
- Contains Docker/CI improvements but incomplete
- Represents abandoned refactoring effort

**Command to delete**: `git push origin --delete copilot/fix-b142c2c2-d3a9-4637-bbc2-0ed979d16113`

### ❌ DELETE: `feature/repo-organization-and-devops`
**Status**: Tests fail, redundant branch
**Issues**:
- Contains only 1 commit that's duplicated in fix-b142c2c2 branch
- Same import/structural issues as fix-b142c2c2
- Redundant - serves no unique purpose

**Command to delete**: `git push origin --delete feature/repo-organization-and-devops`

## Current State - Keep Main Branch

**✅ Main branch is healthy**:
- 132 tests passing
- Complete error handling with retry logic
- Pagination utilities working
- HTTP method support for webhooks
- Full API coverage

## Recommendation

1. **Delete all 3 branches** using the commands above
2. **Keep main as single source of truth**
3. **No merging needed** - main branch already contains the best functionality

The main branch represents the most complete, tested, and functional version of the codebase.

## Implementation Notes

- All branches were tested for functionality
- Main branch has comprehensive error handling, pagination, and API coverage
- No valuable code would be lost by deleting these branches
- Future development should continue from main branch
67 changes: 67 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Base stage for installing dependencies
FROM python:3.10-slim as builder

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

# Create a non-root user and group
RUN groupadd -r appuser && useradd -r -g appuser -d /home/appuser -s /sbin/nologin -c "Docker image user" appuser
RUN mkdir /home/appuser && chown appuser:appuser /home/appuser

# Create working directory
WORKDIR /app

# Upgrade pip
RUN python -m pip install --upgrade pip

# Copy requirement files
COPY requirements.txt requirements-dev.txt ./

# Install dependencies
# Install production dependencies first, then development dependencies
# This helps with Docker layer caching if only dev dependencies change
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install --no-cache-dir -r requirements-dev.txt

# Application stage
FROM python:3.10-slim

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

# Create a non-root user and group (must match builder stage if copying files with --chown)
RUN groupadd -r appuser && useradd -r -g appuser -d /home/appuser -s /bin/bash -c "Docker image user" appuser
RUN mkdir /home/appuser && chown appuser:appuser /home/appuser

# Create working directory
WORKDIR /app

# Copy installed dependencies from builder stage
COPY --from=builder /usr/local/lib/python3.10/site-packages/ /usr/local/lib/python3.10/site-packages/
COPY --from=builder /app/ /app/

# Copy application code and necessary files
# Ensure these paths are correct based on your project structure after reorganization
COPY src/ ./src/
COPY tests/ ./tests/
COPY config/ ./config/
COPY setup.py .
COPY openapi_spec.json .
# Copy other root files if necessary, e.g., README.md, LICENSE, etc.
# COPY README.md .
# COPY LICENSE .

# Ensure correct ownership of application files
RUN chown -R appuser:appuser /app /home/appuser

# Switch to non-root user
USER appuser

# Expose port if your application is a web service (e.g., example.py runs a Flask app)
# EXPOSE 5000

# Default command to run tests
# This makes the container runnable and immediately useful for a developer
CMD ["pytest", "tests/"]
File renamed without changes.
File renamed without changes.
36 changes: 36 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: "3.8"

services:
app:
build:
context: .
dockerfile: Dockerfile
container_name: oura_api_dev
# Mounts for live code reloading during development
volumes:
- ./src:/app/src
- ./tests:/app/tests
- ./openapi_spec.json:/app/openapi_spec.json
- ./setup.py:/app/setup.py
# If example.py or other root scripts are needed and are modified during dev:
# - ./example.py:/app/example.py

# Keep the container running for development, e.g., for exec-ing into it
# Overrides the Dockerfile's CMD
# command: tail -f /dev/null

# Or, to run tests by default when doing `docker-compose up`:
command: pytest tests/

# If your example.py runs a web service on port 5000:
# ports:
# - "5000:5000"

environment:
# Add any environment variables needed for development or testing
# - MY_VARIABLE=my_value
- PYTHONUNBUFFERED=1 # Ensures print statements appear without delay

# Standard useful settings
stdin_open: true # docker run -i
tty: true # docker run -t
File renamed without changes.
11 changes: 11 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
- Initial project setup.
File renamed without changes.
32 changes: 32 additions & 0 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Contributing

We welcome contributions to this project! Please follow these guidelines to ensure a smooth process.

## Getting Started

- Fork the repository and clone it locally.
- Create a new branch for your feature or bug fix: `git checkout -b my-feature-branch`
- Make your changes and commit them with clear, descriptive messages.
- Push your changes to your fork: `git push origin my-feature-branch`
- Open a pull request to the main repository.

## Code Style

- Follow PEP 8 guidelines for Python code.
- Use `black` for code formatting.
- Use `flake8` for linting.

## Testing

- Write unit tests for new features and bug fixes.
- Ensure all tests pass before submitting a pull request.

## Pull Requests

- Provide a clear description of your changes in the pull request.
- Reference any related issues in the pull request description.
- Ensure your pull request passes all CI checks.

## Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added oura_api_client/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added oura_api_client/api/__pycache__/base.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
requests>=2.25.0
pydantic>=2.0.0
requests==2.32.4
pydantic==2.11.7
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
OuraServerError,
OuraClientError,
OuraConnectionError,
OuraTimeoutError
OuraTimeoutError,
)
from .utils import RetryConfig

Expand All @@ -27,5 +27,5 @@
"OuraClientError",
"OuraConnectionError",
"OuraTimeoutError",
"RetryConfig"
"RetryConfig",
]
File renamed without changes.
File renamed without changes.
Loading