Skip to content

Commit 0273e60

Browse files
committed
Initial commit
0 parents  commit 0273e60

21 files changed

+809
-0
lines changed

.editorconfig

+17
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

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# These are supported funding model platforms
2+
custom: https://www.buymeacoffee.com/frankie567

.github/ISSUE_TEMPLATE/bug_report.md

+39
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

+4
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/frankie567/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

+10
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

+20
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

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
7+
test:
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
python_version: [3.7, 3.8, 3.9]
12+
13+
services:
14+
mongo:
15+
image: mongo:4.2
16+
ports:
17+
- 27017:27017
18+
19+
steps:
20+
- uses: actions/checkout@v1
21+
- name: Set up Python
22+
uses: actions/setup-python@v1
23+
with:
24+
python-version: ${{ matrix.python_version }}
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install -r requirements.dev.txt
29+
- name: Test with pytest
30+
env:
31+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
32+
run: |
33+
pytest --cov=fastapi_users_db_mongodb/
34+
codecov
35+
- name: Build and install it on system host
36+
run: |
37+
flit build
38+
flit install --python $(which python)
39+
python test_build.py
40+
41+
release:
42+
runs-on: ubuntu-latest
43+
needs: test
44+
if: startsWith(github.ref, 'refs/tags/')
45+
46+
steps:
47+
- uses: actions/checkout@v1
48+
- name: Set up Python
49+
uses: actions/setup-python@v1
50+
with:
51+
python-version: 3.7
52+
- name: Install dependencies
53+
run: |
54+
python -m pip install --upgrade pip
55+
pip install -r requirements.dev.txt
56+
- name: Release on PyPI
57+
env:
58+
FLIT_USERNAME: ${{ secrets.FLIT_USERNAME }}
59+
FLIT_PASSWORD: ${{ secrets.FLIT_PASSWORD }}
60+
run: |
61+
flit publish

.gitignore

+114
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
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+
# .vscode
108+
.vscode/
109+
110+
# OS files
111+
.DS_Store
112+
113+
# .idea
114+
.idea/

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 François Voron
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.

Makefile

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
MONGODB_CONTAINER_NAME := fastapi-users-db-mongodb-test-mongo
2+
3+
isort:
4+
isort ./fastapi_users_db_mongodb ./tests
5+
6+
format: isort
7+
black .
8+
9+
test:
10+
docker stop $(MONGODB_CONTAINER_NAME) || true
11+
docker run -d --rm --name $(MONGODB_CONTAINER_NAME) -p 27017:27017 mongo:4.2
12+
pytest --cov=fastapi_users_db_mongodb/ --cov-report=term-missing --cov-fail-under=100
13+
docker stop $(MONGODB_CONTAINER_NAME)
14+
15+
bumpversion-major:
16+
bumpversion major
17+
18+
bumpversion-minor:
19+
bumpversion minor
20+
21+
bumpversion-patch:
22+
bumpversion patch

0 commit comments

Comments
 (0)