Skip to content

Commit ed520c1

Browse files
committed
feat: Add comprehensive open source project infrastructure
- Add modern CI/CD workflows (ci.yml, release.yml) using uv and Python 3.11+ - Add test coverage reporting with Codecov integration - Add GitHub Issue templates (bug reports, feature requests) - Add Pull Request template with comprehensive checklist - Add Code of Conduct (Contributor Covenant v2.1) - Add Security Policy with reporting guidelines - Add Dependabot configuration for automated dependency updates - Add Funding.yml for GitHub Sponsors support - Remove legacy workflows (testing_ci_cd.yml, building_ci_cd.yaml) - Enhance README with CI badge, ruff badge, and better documentation links - Add coverage configuration to pyproject.toml - Add additional project URLs (Issues, Changelog) to pyproject.toml This transforms the project into a production-ready, community-friendly open source project with modern tooling and best practices.
1 parent ae31a98 commit ed520c1

14 files changed

Lines changed: 520 additions & 67 deletions

.github/FUNDING.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# These are supported funding model platforms
2+
3+
github: elumobility # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
# patreon: # Replace with a single Patreon username
5+
# open_collective: # Replace with a single Open Collective username
6+
# ko_fi: # Replace with a single Ko-fi username
7+
# tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
# community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
# liberapay: # Replace with a single Liberapay username
10+
# issuehunt: # Replace with a single IssueHunt username
11+
# otechie: # Replace with a single Otechie username
12+
# lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
13+
# polar: # Replace with a single Polar username
14+
# buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
15+
# thanks_dev: # Replace with a single thanks.dev username
16+
# custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: Bug Report
3+
about: Create a report to help us improve
4+
title: '[BUG] '
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
## Description
10+
A clear and concise description of what the bug is.
11+
12+
## Steps to Reproduce
13+
1. Go to '...'
14+
2. Click on '....'
15+
3. Scroll down to '....'
16+
4. See error
17+
18+
## Expected Behavior
19+
A clear and concise description of what you expected to happen.
20+
21+
## Actual Behavior
22+
A clear and concise description of what actually happened.
23+
24+
## Environment
25+
- Python version: [e.g. 3.11.0]
26+
- OCPI Python version: [e.g. 0.1.0]
27+
- OCPI version: [e.g. 2.3.0]
28+
- Operating System: [e.g. Ubuntu 22.04]
29+
30+
## Code Example
31+
```python
32+
# Minimal code example that reproduces the issue
33+
```
34+
35+
## Error Messages/Logs
36+
```
37+
Paste any error messages or logs here
38+
```
39+
40+
## Additional Context
41+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: 💬 Discussions
4+
url: https://github.com/elumobility/ocpi-python/discussions
5+
about: Ask questions and discuss ideas
6+
- name: 📚 Documentation
7+
url: https://elumobility.github.io/ocpi-python/
8+
about: Check the documentation for answers
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an idea for this project
4+
title: '[FEATURE] '
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
## Feature Description
10+
A clear and concise description of the feature you'd like to see.
11+
12+
## Problem Statement
13+
What problem does this feature solve? What use case does it address?
14+
15+
## Proposed Solution
16+
A clear and concise description of what you want to happen.
17+
18+
## Alternatives Considered
19+
A clear and concise description of any alternative solutions or features you've considered.
20+
21+
## Additional Context
22+
Add any other context, examples, or screenshots about the feature request here.
23+
24+
## OCPI Version
25+
Which OCPI version(s) should this feature support?
26+
- [ ] 2.3.0
27+
- [ ] 2.2.1
28+
- [ ] 2.1.1

.github/SECURITY.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
We actively support the following versions with security updates:
6+
7+
| Version | Supported |
8+
| ------- | ------------------ |
9+
| Latest | :white_check_mark: |
10+
| < Latest | :x: |
11+
12+
## Reporting a Vulnerability
13+
14+
If you discover a security vulnerability, please **do not** open a public issue. Instead, please report it privately to:
15+
16+
**Email**: dev@elu-energy.it
17+
18+
Please include the following information in your report:
19+
20+
- Type of vulnerability (e.g., XSS, SQL injection, authentication bypass)
21+
- Full paths of source file(s) related to the vulnerability
22+
- The location of the affected code (tag/branch/commit or direct URL)
23+
- Step-by-step instructions to reproduce the issue
24+
- Proof-of-concept or exploit code (if possible)
25+
- Impact of the vulnerability, including how an attacker might exploit it
26+
27+
We will acknowledge receipt of your report within 48 hours and provide a more detailed response within 7 days indicating the next steps in handling your report.
28+
29+
## Security Update Process
30+
31+
1. **Report Received**: We acknowledge receipt within 48 hours
32+
2. **Investigation**: We investigate and verify the vulnerability
33+
3. **Fix Development**: We develop a fix in a private branch
34+
4. **Testing**: We thoroughly test the fix
35+
5. **Release**: We release a security update
36+
6. **Disclosure**: We publicly disclose the vulnerability (after users have had time to update)
37+
38+
## Security Best Practices
39+
40+
When using OCPI Python in production:
41+
42+
- Always use the latest stable version
43+
- Keep your dependencies up to date
44+
- Use HTTPS for all OCPI communications
45+
- Implement proper authentication and authorization
46+
- Validate and sanitize all inputs
47+
- Use environment variables for sensitive configuration
48+
- Regularly review and rotate API tokens and credentials
49+
- Monitor your application logs for suspicious activity
50+
51+
## Security Considerations
52+
53+
- **Authentication**: Ensure proper token validation and authorization checks
54+
- **Data Validation**: All OCPI data should be validated using Pydantic schemas
55+
- **Rate Limiting**: Consider implementing rate limiting for production deployments
56+
- **Error Handling**: Avoid exposing sensitive information in error messages
57+
- **Dependencies**: Keep all dependencies up to date to avoid known vulnerabilities
58+
59+
Thank you for helping keep OCPI Python and its users safe!

.github/dependabot.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "pip"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
open-pull-requests-limit: 10
8+
labels:
9+
- "dependencies"
10+
- "python"
11+
commit-message:
12+
prefix: "chore"
13+
include: "scope"
14+
15+
- package-ecosystem: "github-actions"
16+
directory: "/"
17+
schedule:
18+
interval: "weekly"
19+
labels:
20+
- "dependencies"
21+
- "github-actions"
22+
commit-message:
23+
prefix: "ci"
24+
include: "scope"

.github/pull_request_template.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
## Description
2+
<!-- Provide a brief description of the changes in this PR -->
3+
4+
## Type of Change
5+
<!-- Mark the relevant option with an "x" -->
6+
7+
- [ ] Bug fix (non-breaking change which fixes an issue)
8+
- [ ] New feature (non-breaking change which adds functionality)
9+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
10+
- [ ] Documentation update
11+
- [ ] Code refactoring
12+
- [ ] Performance improvement
13+
- [ ] Test updates
14+
15+
## Related Issue
16+
<!-- Link to the related issue(s) -->
17+
Closes #
18+
19+
## Changes Made
20+
<!-- Describe the changes in detail -->
21+
22+
## Testing
23+
<!-- Describe the tests you ran and how to reproduce them -->
24+
25+
- [ ] Tests pass locally
26+
- [ ] Added tests for new functionality
27+
- [ ] Updated tests for changed functionality
28+
- [ ] All existing tests pass
29+
30+
## Checklist
31+
<!-- Mark completed items with an "x" -->
32+
33+
- [ ] My code follows the project's style guidelines
34+
- [ ] I have performed a self-review of my code
35+
- [ ] I have commented my code, particularly in hard-to-understand areas
36+
- [ ] I have made corresponding changes to the documentation
37+
- [ ] My changes generate no new warnings
38+
- [ ] I have added tests that prove my fix is effective or that my feature works
39+
- [ ] New and existing unit tests pass locally with my changes
40+
- [ ] Any dependent changes have been merged and published
41+
42+
## Screenshots (if applicable)
43+
<!-- Add screenshots to help explain your changes -->
44+
45+
## Additional Notes
46+
<!-- Any additional information that reviewers should know -->

.github/workflows/building_ci_cd.yaml

Lines changed: 0 additions & 39 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
13+
jobs:
14+
test:
15+
name: Test (Python ${{ matrix.python-version }})
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
python-version: ["3.11", "3.12"]
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v4
26+
with:
27+
version: "latest"
28+
29+
- name: Set up Python ${{ matrix.python-version }}
30+
run: uv python install ${{ matrix.python-version }}
31+
32+
- name: Install dependencies
33+
run: |
34+
uv sync --all-extras
35+
36+
- name: Run tests with coverage
37+
run: |
38+
uv run pytest --cov=ocpi --cov-report=xml --cov-report=term-missing
39+
40+
- name: Upload coverage to Codecov
41+
uses: codecov/codecov-action@v4
42+
with:
43+
file: ./coverage.xml
44+
flags: unittests
45+
name: codecov-umbrella
46+
fail_ci_if_error: false
47+
48+
lint:
49+
name: Lint
50+
runs-on: ubuntu-latest
51+
52+
steps:
53+
- uses: actions/checkout@v4
54+
55+
- name: Install uv
56+
uses: astral-sh/setup-uv@v4
57+
with:
58+
version: "latest"
59+
60+
- name: Set up Python
61+
run: uv python install 3.11
62+
63+
- name: Install dependencies
64+
run: |
65+
uv sync --extra dev
66+
67+
- name: Run ruff
68+
run: |
69+
uv run ruff check .
70+
71+
- name: Run ruff format check
72+
run: |
73+
uv run ruff format --check .
74+
75+
type-check:
76+
name: Type Check
77+
runs-on: ubuntu-latest
78+
79+
steps:
80+
- uses: actions/checkout@v4
81+
82+
- name: Install uv
83+
uses: astral-sh/setup-uv@v4
84+
with:
85+
version: "latest"
86+
87+
- name: Set up Python
88+
run: uv python install 3.11
89+
90+
- name: Install dependencies
91+
run: |
92+
uv sync --extra dev
93+
94+
- name: Run mypy
95+
run: |
96+
uv run mypy ocpi

0 commit comments

Comments
 (0)