Skip to content

Commit e2920ac

Browse files
committed
Initial commit
0 parents  commit e2920ac

File tree

22 files changed

+1268
-0
lines changed

22 files changed

+1268
-0
lines changed

.editorconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 4
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
charset = utf-8
11+
end_of_line = lf
12+
13+
[*.yml]
14+
indent_size = 2
15+
16+
[Makefile]
17+
indent_style = tab

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: frankie567
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
## Describe the bug
11+
12+
A clear and concise description of what the bug is.
13+
14+
## To Reproduce
15+
16+
Steps to reproduce the behavior:
17+
1. Go to '...'
18+
2. Click on '....'
19+
3. Scroll down to '....'
20+
4. See error
21+
22+
## Expected behavior
23+
24+
A clear and concise description of what you expected to happen.
25+
26+
## Configuration
27+
- Python version :
28+
- FastAPI version :
29+
- FastAPI Users version :
30+
31+
### FastAPI Users configuration
32+
33+
```py
34+
# Please copy/paste your FastAPI Users configuration here.
35+
```
36+
37+
## Additional context
38+
39+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
contact_links:
2+
- name: I have a question 🤔
3+
url: https://github.com/fastapi-users/fastapi-users/discussions
4+
about: If you have any question about the usage of FastAPI Users that's not clearly a bug, please open a discussion first.

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: pip
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
time: "04:00"
8+
open-pull-requests-limit: 10
9+
reviewers:
10+
- frankie567

.github/stale.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Number of days of inactivity before an issue becomes stale
2+
daysUntilStale: 14
3+
# Number of days of inactivity before a stale issue is closed
4+
daysUntilClose: 7
5+
# Issues with these labels will never be considered stale
6+
exemptLabels:
7+
- pinned
8+
- security
9+
- bug
10+
- enhancement
11+
- documentation
12+
# Label to use when marking an issue as stale
13+
staleLabel: stale
14+
# Comment to post when marking an issue as stale. Set to `false` to disable
15+
markComment: >
16+
This issue has been automatically marked as stale because it has not had
17+
recent activity. It will be closed if no further activity occurs. Thank you
18+
for your contributions.
19+
# Comment to post when closing a stale issue. Set to `false` to disable
20+
closeComment: false

.github/workflows/build.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
9+
services:
10+
postgres:
11+
image: postgres:alpine
12+
ports:
13+
- 5432:5432
14+
env:
15+
POSTGRES_USER: fastapiusers
16+
POSTGRES_PASSWORD: fastapiuserspassword
17+
# Set health checks to wait until postgres has started
18+
options: >-
19+
--health-cmd pg_isready
20+
--health-interval 10s
21+
--health-timeout 5s
22+
--health-retries 5
23+
24+
mariadb:
25+
image: mariadb
26+
ports:
27+
- 3306:3306
28+
env:
29+
MARIADB_ROOT_PASSWORD: fastapiuserspassword
30+
MARIADB_DATABASE: fastapiusers
31+
MARIADB_USER: fastapiusers
32+
MARIADB_PASSWORD: fastapiuserspassword
33+
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
python_version: [3.9, '3.10', '3.11', '3.12', '3.13']
38+
database_url:
39+
[
40+
"sqlite+aiosqlite:///./test-fastapiusers.db",
41+
"postgresql+asyncpg://fastapiusers:fastapiuserspassword@localhost:5432/fastapiusers",
42+
"mysql+aiomysql://root:fastapiuserspassword@localhost:3306/fastapiusers",
43+
]
44+
45+
steps:
46+
- uses: actions/checkout@v4
47+
- name: Set up Python
48+
uses: actions/setup-python@v5
49+
with:
50+
python-version: ${{ matrix.python_version }}
51+
- name: Install dependencies
52+
run: |
53+
python -m pip install --upgrade pip
54+
pip install hatch
55+
hatch env create
56+
- name: Lint and typecheck
57+
run: |
58+
hatch run lint-check
59+
- name: Test
60+
env:
61+
DATABASE_URL: ${{ matrix.database_url }}
62+
run: |
63+
hatch run test-cov-xml
64+
- uses: codecov/codecov-action@v5
65+
with:
66+
token: ${{ secrets.CODECOV_TOKEN }}
67+
fail_ci_if_error: true
68+
verbose: true
69+
- name: Build and install it on system host
70+
run: |
71+
hatch build
72+
pip install dist/fastapi_users_db_sqlalchemy-*.whl
73+
python test_build.py
74+
75+
release:
76+
runs-on: ubuntu-latest
77+
needs: test
78+
if: startsWith(github.ref, 'refs/tags/')
79+
80+
steps:
81+
- uses: actions/checkout@v4
82+
- name: Set up Python
83+
uses: actions/setup-python@v5
84+
with:
85+
python-version: 3.9
86+
- name: Install dependencies
87+
run: |
88+
python -m pip install --upgrade pip
89+
pip install hatch
90+
- name: Build and publish on PyPI
91+
env:
92+
HATCH_INDEX_USER: ${{ secrets.HATCH_INDEX_USER }}
93+
HATCH_INDEX_AUTH: ${{ secrets.HATCH_INDEX_AUTH }}
94+
run: |
95+
hatch build
96+
hatch publish
97+
- name: Create release
98+
uses: ncipollo/release-action@v1
99+
with:
100+
draft: true
101+
body: ${{ github.event.head_commit.message }}
102+
artifacts: dist/*.whl,dist/*.tar.gz
103+
token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
env/
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
28+
# PyInstaller
29+
# Usually these files are written by a python script from a template
30+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31+
*.manifest
32+
*.spec
33+
34+
# Installer logs
35+
pip-log.txt
36+
pip-delete-this-directory.txt
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*.cover
47+
.hypothesis/
48+
.pytest_cache/
49+
junit/
50+
junit.xml
51+
test*.db*
52+
53+
# Translations
54+
*.mo
55+
*.pot
56+
57+
# Django stuff:
58+
*.log
59+
local_settings.py
60+
61+
# Flask stuff:
62+
instance/
63+
.webassets-cache
64+
65+
# Scrapy stuff:
66+
.scrapy
67+
68+
# Sphinx documentation
69+
docs/_build/
70+
71+
# PyBuilder
72+
target/
73+
74+
# Jupyter Notebook
75+
.ipynb_checkpoints
76+
77+
# pyenv
78+
.python-version
79+
80+
# celery beat schedule file
81+
celerybeat-schedule
82+
83+
# SageMath parsed files
84+
*.sage.py
85+
86+
# dotenv
87+
.env
88+
89+
# virtualenv
90+
.venv
91+
venv/
92+
ENV/
93+
94+
# Spyder project settings
95+
.spyderproject
96+
.spyproject
97+
98+
# Rope project settings
99+
.ropeproject
100+
101+
# mkdocs documentation
102+
/site
103+
104+
# mypy
105+
.mypy_cache/
106+
107+
# OS files
108+
.DS_Store
109+
110+
# .idea
111+
.idea/

.vscode/settings.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"python.analysis.typeCheckingMode": "basic",
3+
"python.analysis.autoImportCompletions": true,
4+
"python.terminal.activateEnvironment": true,
5+
"python.terminal.activateEnvInCurrentTerminal": true,
6+
"python.testing.unittestEnabled": false,
7+
"python.testing.pytestEnabled": true,
8+
"editor.rulers": [88],
9+
"python.defaultInterpreterPath": "${workspaceFolder}/.hatch/fastapi-users-db-sqlalchemy/bin/python",
10+
"python.testing.pytestPath": "${workspaceFolder}/.hatch/fastapi-users-db-sqlalchemy/bin/pytest",
11+
"python.testing.cwd": "${workspaceFolder}",
12+
"python.testing.pytestArgs": ["--no-cov"],
13+
"[python]": {
14+
"editor.formatOnSave": true,
15+
"editor.codeActionsOnSave": {
16+
"source.fixAll": "explicit",
17+
"source.organizeImports": "explicit"
18+
},
19+
"editor.defaultFormatter": "charliermarsh.ruff"
20+
}
21+
}

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) 2025 Kaan Gönüldinc
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.

0 commit comments

Comments
 (0)