Skip to content

Commit 4e84c80

Browse files
committed
Initial commit
0 parents  commit 4e84c80

34 files changed

+2467
-0
lines changed

.github/FUNDING.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: AndreuCodina
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Pull request
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
continous-integration:
10+
runs-on: ubuntu-latest
11+
env:
12+
UV_NO_SYNC: 1
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Install uv
18+
uses: astral-sh/setup-uv@v3
19+
with:
20+
version: "0.4.25"
21+
22+
- name: Install Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version-file: ".python-version"
26+
27+
- name: Install Python packages
28+
run: uv sync --locked
29+
shell: bash
30+
31+
- name: Pre-commit
32+
uses: pre-commit/[email protected]
33+
with:
34+
extra_args: --all-files

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
__pycache__/
2+
*.py[oc]
3+
build/
4+
dist/
5+
wheels/
6+
*.egg-info
7+
.venv/
8+
.ruff_cache/
9+
.pytest_cache/

.pre-commit-config.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
repos:
2+
- repo: local
3+
hooks:
4+
- id: ruff-linter
5+
name: Linter
6+
entry: uv run -- ruff check
7+
language: system
8+
types: [python]
9+
fail_fast: true
10+
11+
- id: ruff-formatter
12+
name: Formatter
13+
entry: uv run -- ruff format --diff
14+
language: system
15+
types: [python]
16+
fail_fast: true
17+
18+
- id: pyright
19+
name: Type checker
20+
entry: uv run -- pyright
21+
language: system
22+
types: [python]
23+
fail_fast: true
24+
25+
- id: unit-tests
26+
name: Unit tests
27+
entry: uv run -- pytest -m unit
28+
language: system
29+
types: [python]
30+
fail_fast: true
31+
pass_filenames: false

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

.vscode/launch.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "api",
6+
"type": "debugpy",
7+
"request": "launch",
8+
"program": ".venv/bin/fastapi",
9+
"args": [
10+
"dev",
11+
"api/src/api/main.py"
12+
],
13+
"console": "integratedTerminal",
14+
"justMyCode": false,
15+
"preLaunchTask": "pre-commit-install"
16+
}
17+
]
18+
}

.vscode/settings.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"files.associations": {
3+
"*.py": "python"
4+
},
5+
"editor.codeActionsOnSave": {
6+
"source.fixAll": "always",
7+
"source.organizeImports": "always"
8+
},
9+
"editor.formatOnSave": true,
10+
"editor.formatOnType": true,
11+
"[python]": {
12+
"editor.defaultFormatter": "charliermarsh.ruff"
13+
},
14+
"[ipynb]": {
15+
"editor.defaultFormatter": "charliermarsh.ruff"
16+
},
17+
"python.defaultInterpreterPath": ".venv/bin/python",
18+
"python.languageServer": "Pylance",
19+
"python.analysis.autoSearchPaths": true,
20+
"python.analysis.autoImportCompletions": true,
21+
"python.testing.pytestEnabled": true,
22+
"notebook.formatOnSave.enabled": true,
23+
"notebook.formatOnCellExecution": true,
24+
"notebook.codeActionsOnSave": {
25+
"notebook.source.fixAll": "explicit",
26+
"notebook.source.organizeImports": "explicit"
27+
},
28+
}

.vscode/tasks.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "pre-commit-install",
6+
"type": "shell",
7+
"command": "uv",
8+
"args": [
9+
"run",
10+
"pre-commit",
11+
"install"
12+
]
13+
}
14+
]
15+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Andreu Codina
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- [Projects](docs/projects.md)
2+
- [Pre-commit](docs/pre-commit.md)

0 commit comments

Comments
 (0)