Skip to content

Commit 94d681a

Browse files
committed
Create repository, CI and agent configuration
1 parent f9cb6c1 commit 94d681a

12 files changed

Lines changed: 253 additions & 12 deletions

.github/CODE_OF_CONDUCT.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!-- SPDX-FileCopyrightText: 2025 Alexandre Gomes Gaigalas <alganet@gmail.com> -->
2+
<!-- SPDX-License-Identifier: ISC -->
3+
4+
# Code of Conduct
5+
6+
## Our Pledge
7+
8+
We pledge to make participation in our project a harassment-free experience for everyone.
9+
10+
## Our Standards
11+
12+
- Be respectful
13+
- Be collaborative
14+
- Be inclusive
15+
16+
## Enforcement
17+
18+
Contact the maintainers if you experience or witness unacceptable behavior.

.github/CONTRIBUTING.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!-- SPDX-FileCopyrightText: 2025 Alexandre Gomes Gaigalas <alganet@gmail.com> -->
2+
<!-- SPDX-License-Identifier: ISC -->
3+
4+
# Contributing
5+
6+
## Development Setup
7+
8+
1. Clone the repository
9+
2. Install dependencies: `pip install -e .[dev]`
10+
3. Run tests: `make test`
11+
12+
## Commit Messages
13+
14+
Use meaningful titles and a brief body describing your changes.
15+
16+
Commit titles must not exceed 72 characters.
17+
Commit body lines must not exceed 72 characters.
18+
19+
## Code Quality
20+
21+
- Format: `make format`
22+
- Lint: `make lint`
23+
- Test: `make test`
24+
- All: `make all`
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!-- SPDX-FileCopyrightText: 2025 Alexandre Gomes Gaigalas <alganet@gmail.com> -->
2+
<!-- SPDX-License-Identifier: ISC -->
3+
4+
---
5+
name: Bug Report
6+
about: Report a bug
7+
title: "[BUG] "
8+
labels: bug
9+
---
10+
11+
**Describe the bug**
12+
A clear description of the bug.
13+
14+
**To Reproduce**
15+
Steps to reproduce.
16+
17+
**Expected behavior**
18+
What should happen.
19+
20+
**Environment**
21+
- OS:
22+
- Python version:
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!-- SPDX-FileCopyrightText: 2025 Alexandre Gomes Gaigalas <alganet@gmail.com> -->
2+
<!-- SPDX-License-Identifier: ISC -->
3+
4+
---
5+
name: Feature Request
6+
about: Suggest a new feature
7+
title: "[FEATURE] "
8+
labels: enhancement
9+
---
10+
11+
**Is your feature request related to a problem?**
12+
Describe the problem.
13+
14+
**Describe the solution**
15+
What do you want to happen.
16+
17+
**Alternatives**
18+
Any alternatives considered.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!-- SPDX-FileCopyrightText: 2025 Alexandre Gomes Gaigalas <alganet@gmail.com> -->
2+
<!-- SPDX-License-Identifier: ISC -->
3+
4+
## Description
5+
6+
Brief description of changes.
7+
8+
## Type of Change
9+
10+
- [ ] Bug fix
11+
- [ ] New feature
12+
- [ ] Breaking change
13+
- [ ] Documentation update
14+
15+
## Checklist
16+
17+
- [ ] Tests pass
18+
- [ ] Code formatted
19+
- [ ] Documentation updated

.github/SECURITY.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!-- SPDX-FileCopyrightText: 2025 Alexandre Gomes Gaigalas <alganet@gmail.com> -->
2+
<!-- SPDX-License-Identifier: ISC -->
3+
4+
# Security Policy
5+
6+
## Reporting Vulnerabilities
7+
8+
Report security issues privately to: [alganet@gmail.com].
9+
10+
We will work to make them public in a timely fashion and properly credit
11+
whoever discovered it.
12+
13+
## Supported Versions
14+
15+
Only the latest version receives security updates.

.github/copilot-instructions.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!-- SPDX-FileCopyrightText: 2025 Alexandre Gomes Gaigalas <alganet@gmail.com> -->
2+
<!-- SPDX-License-Identifier: ISC -->
3+
4+
# AI Coding Guidelines for apywire
5+
6+
## Overview
7+
apywire is a Python library for object wiring with lazy loading. It provides dependency injection through spec-based configuration and code generation.
8+
9+
## Architecture
10+
- **Core Components**: `Wired` class (lazy container), `wire()` (factory), `compile()` (code generator)
11+
- **Data Flow**: Spec dict → `_parse_spec()` → ParsedSpec → `Wired.__init__()` → lazy `__getattr__()` → instantiate with `**value`
12+
- **Key Patterns**: Generic with `TypeVar T` for value types, lazy loading via `__getattr__`, spec parsing with module/class resolution
13+
- **Equivalence Goal**: `compile()` and `wire()` produce equivalent behavior - compiled code should match wired object functionality
14+
- **Config-Friendly Specs**: Specs are designed to be easily serializable from YAML/JSON
15+
16+
## Developer Workflows
17+
- **Full Check**: `make all` (format, lint, test coverage)
18+
- **Build & Publish**: `make build` (creates dist/), `make publish` (uploads to PyPI)
19+
- **Clean**: `make clean` (removes __pycache__, .coverage, etc.)
20+
- **Debug**: Use `pytest -xvs` for verbose test runs
21+
22+
## Conventions
23+
- **Typing**: Strict mypy with `disallow_any_* = true`, use `object` over `Any`
24+
- **Formatting**: 79 char lines with black/isort
25+
- **Licensing**: SPDX headers on all files, REUSE compliance
26+
- **Coverage**: 95% required, test edge cases like `AttributeError` in `__getattr__`
27+
- **Structure**: Type aliases in wiring.py, Makefile-driven development
28+
29+
## Examples
30+
- **Lazy Access**: `wired = wire(spec); obj = wired.someName` (instantiates on first access)
31+
- **Spec Format**: `{"module.Class name": {"param": "value"}}` (YAML/JSON-compatible structure)
32+
- **Generic Usage**: Functions use `[T]` for type safety without runtime generics
33+
- **Equivalence**: `compile(spec)` generates code that behaves identically to `wire(spec)`
34+
35+
## Key Files
36+
- `apywire/wiring.py`: Core implementation
37+
- `Makefile`: All dev commands
38+
- `pyproject.toml`: Dependencies and config
39+
- `tests/test_simple.py`: Usage examples

.github/dependabot.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# SPDX-FileCopyrightText: 2025 Alexandre Gomes Gaigalas <alganet@gmail.com>
2+
# SPDX-License-Identifier: ISC
3+
4+
version: 2
5+
updates:
6+
- package-ecosystem: "pip"
7+
directory: "/"
8+
schedule:
9+
interval: "weekly"
10+
open-pull-requests-limit: 10
11+
commit-message:
12+
prefix: "deps"
13+
include: "scope"
14+
- package-ecosystem: "github-actions"
15+
directory: "/"
16+
schedule:
17+
interval: "weekly"
18+
commit-message:
19+
prefix: "ci"
20+
include: "scope"

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# SPDX-FileCopyrightText: 2025 Alexandre Gomes Gaigalas <alganet@gmail.com>
2+
# SPDX-License-Identifier: ISC
3+
4+
name: CI
5+
6+
on:
7+
push:
8+
branches: [ main ]
9+
pull_request:
10+
branches: [ main ]
11+
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
python-version: ["3.12", "3.13"]
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
- run: make pip
25+
- run: make lint
26+
- run: make coverage

.github/workflows/release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# SPDX-FileCopyrightText: 2025 Alexandre Gomes Gaigalas <alganet@gmail.com>
2+
# SPDX-License-Identifier: ISC
3+
4+
name: Release
5+
6+
on:
7+
push:
8+
tags:
9+
- 'v*'
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-python@v5
18+
with:
19+
python-version: '3.13'
20+
- run: make pip
21+
- run: make build
22+
- run: make publish
23+
env:
24+
TWINE_USERNAME: __token__
25+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)