Skip to content

Commit d930d8b

Browse files
committed
Add GitHub integration and project documentation
- Add setup.py for pip installation - Configure GitHub Actions for CI/CD testing - Add status badges to README - Create CONTRIBUTING.md with development guidelines - Set up test workflow for Python 3.8-3.12 - Support both Ubuntu and Windows in CI - Configure codecov integration - Add project metadata and classifiers
1 parent 7fc38a7 commit d930d8b

File tree

4 files changed

+239
-0
lines changed

4 files changed

+239
-0
lines changed

.github/workflows/test.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Tempo Test Suite
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, windows-latest]
15+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install -e .[dev]
29+
30+
- name: Run tests with coverage
31+
run: |
32+
pytest tests/ --cov=src --cov-report=xml --cov-report=term-missing
33+
34+
- name: Upload coverage to Codecov
35+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
36+
uses: codecov/codecov-action@v3
37+
with:
38+
file: ./coverage.xml
39+
fail_ci_if_error: false
40+
verbose: true

CONTRIBUTING.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# Contributing to Tempo
2+
3+
Thank you for your interest in contributing to Tempo! We welcome contributions from everyone.
4+
5+
## Development Setup
6+
7+
1. Fork the repository on GitHub
8+
2. Clone your fork locally:
9+
```bash
10+
git clone https://github.com/YOUR-USERNAME/tempo.git
11+
cd tempo
12+
```
13+
14+
3. Create a virtual environment:
15+
```bash
16+
python -m venv venv
17+
source venv/bin/activate # On Windows: venv\Scripts\activate
18+
```
19+
20+
4. Install development dependencies:
21+
```bash
22+
pip install -e .[dev]
23+
```
24+
25+
## Development Process
26+
27+
We follow Test-Driven Development (TDD) strictly:
28+
29+
### Red-Green-Refactor Cycle
30+
31+
1. **RED**: Write a failing test first
32+
2. **GREEN**: Write minimal code to make the test pass
33+
3. **REFACTOR**: Improve the code while keeping tests green
34+
35+
### Running Tests
36+
37+
```bash
38+
# Run all tests
39+
pytest
40+
41+
# Run with coverage
42+
pytest --cov=src --cov-report=term-missing
43+
44+
# Run specific test file
45+
pytest tests/unit/core/test_tracker.py
46+
47+
# Run in watch mode
48+
pytest-watch
49+
```
50+
51+
### Code Coverage
52+
53+
- Minimum 80% coverage required
54+
- Current coverage: 89%
55+
- New features must include tests
56+
57+
## Pull Request Process
58+
59+
1. Create a new branch for your feature:
60+
```bash
61+
git checkout -b feature/your-feature-name
62+
```
63+
64+
2. Make your changes following TDD
65+
3. Ensure all tests pass
66+
4. Update documentation if needed
67+
5. Commit with clear messages:
68+
```bash
69+
git commit -m "Add feature: description of what you added"
70+
```
71+
72+
6. Push to your fork and create a Pull Request
73+
74+
## Code Style
75+
76+
- Follow PEP 8
77+
- Use type hints where appropriate
78+
- Keep functions small and focused
79+
- Write clear docstrings
80+
81+
## Reporting Issues
82+
83+
- Use GitHub Issues
84+
- Include steps to reproduce
85+
- Provide system information (OS, Python version)
86+
- Include error messages if applicable
87+
88+
## Feature Requests
89+
90+
- Open an issue with "Feature Request" label
91+
- Describe the use case
92+
- Explain expected behavior
93+
- Consider implementing it yourself!
94+
95+
## Testing Guidelines
96+
97+
### Test Structure
98+
```python
99+
def test_component_action_expected_result():
100+
# Arrange
101+
setup_test_data()
102+
103+
# Act
104+
result = perform_action()
105+
106+
# Assert
107+
assert result == expected_value
108+
```
109+
110+
### Test Requirements
111+
- Fast execution (< 100ms for unit tests)
112+
- Independent (no test dependencies)
113+
- Clear naming
114+
- Good coverage of edge cases
115+
116+
## Documentation
117+
118+
- Update README.md for user-facing changes
119+
- Update ROADMAP.md for progress tracking
120+
- Add docstrings to all public functions
121+
- Include usage examples
122+
123+
## Questions?
124+
125+
Feel free to open an issue for any questions about contributing!

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
╚════════════════════════════════════════╝
1313
```
1414

15+
[![Tests](https://github.com/AnrokX/tempo/actions/workflows/test.yml/badge.svg)](https://github.com/AnrokX/tempo/actions/workflows/test.yml)
16+
[![Test Coverage](https://img.shields.io/badge/coverage-89%25-brightgreen)](https://github.com/AnrokX/tempo)
17+
[![Python](https://img.shields.io/badge/python-3.8%2B-blue)](https://www.python.org/)
18+
[![License](https://img.shields.io/badge/license-MIT-green)](https://github.com/AnrokX/tempo/blob/main/LICENSE)
19+
[![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20Linux-lightgrey)](https://github.com/AnrokX/tempo)
20+
1521
A 100% open-source, lightweight desktop application for tracking computer activity and managing time. Built with privacy, security, and performance as core principles.
1622

1723
## Core Principles

setup.py

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
"""
2+
Setup script for Tempo - Personal Activity Tracker
3+
"""
4+
from setuptools import setup, find_packages
5+
from pathlib import Path
6+
7+
# Read the README file
8+
this_directory = Path(__file__).parent
9+
long_description = (this_directory / "README.md").read_text()
10+
11+
setup(
12+
name="tempo-tracker",
13+
version="0.2.0",
14+
author="AnrokX",
15+
author_email="",
16+
description="A lightweight, privacy-focused activity tracker for personal productivity",
17+
long_description=long_description,
18+
long_description_content_type="text/markdown",
19+
url="https://github.com/AnrokX/tempo",
20+
packages=find_packages(),
21+
classifiers=[
22+
"Development Status :: 3 - Alpha",
23+
"Intended Audience :: End Users/Desktop",
24+
"Topic :: Office/Business :: Scheduling",
25+
"License :: OSI Approved :: MIT License",
26+
"Programming Language :: Python :: 3",
27+
"Programming Language :: Python :: 3.8",
28+
"Programming Language :: Python :: 3.9",
29+
"Programming Language :: Python :: 3.10",
30+
"Programming Language :: Python :: 3.11",
31+
"Programming Language :: Python :: 3.12",
32+
"Operating System :: Microsoft :: Windows",
33+
"Operating System :: POSIX :: Linux",
34+
],
35+
python_requires=">=3.8",
36+
install_requires=[
37+
"click>=8.1.0",
38+
"pyyaml>=6.0",
39+
"python-dotenv>=1.0.0",
40+
],
41+
extras_require={
42+
"dev": [
43+
"pytest>=7.4.0",
44+
"pytest-cov>=4.1.0",
45+
"pytest-mock>=3.11.0",
46+
"pytest-xdist>=3.3.0",
47+
"pytest-watch>=4.2.0",
48+
"freezegun>=1.2.0",
49+
"factory-boy>=3.3.0",
50+
"psutil>=5.9.0",
51+
],
52+
"windows": [
53+
"pywin32>=305",
54+
],
55+
"linux": [
56+
"python-xlib>=0.33",
57+
],
58+
},
59+
entry_points={
60+
"console_scripts": [
61+
"tempo=src.cli:cli",
62+
],
63+
},
64+
project_urls={
65+
"Bug Reports": "https://github.com/AnrokX/tempo/issues",
66+
"Source": "https://github.com/AnrokX/tempo",
67+
},
68+
)

0 commit comments

Comments
 (0)