Skip to content

Commit

Permalink
Merge branch 'master' into ko/tutorial/first-step
Browse files Browse the repository at this point in the history
  • Loading branch information
tiangolo committed Mar 27, 2021
2 parents b48f370 + 368d314 commit d576c32
Show file tree
Hide file tree
Showing 167 changed files with 14,981 additions and 1,268 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
35 changes: 23 additions & 12 deletions .github/actions/people/app/main.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import logging
import subprocess
import sys
from collections import Counter
from collections import Counter, defaultdict
from datetime import datetime, timedelta, timezone
from pathlib import Path
from typing import Container, Dict, List, Optional, Set
from typing import Container, DefaultDict, Dict, List, Optional, Set

import httpx
import yaml
Expand Down Expand Up @@ -375,7 +375,7 @@ def get_contributors(settings: Settings):
return contributors, commentors, reviewers, authors


def get_individual_sponsors(settings: Settings, max_individual_sponsor: int = 5):
def get_individual_sponsors(settings: Settings):
nodes: List[SponsorshipAsMaintainerNode] = []
edges = get_graphql_sponsor_edges(settings=settings)

Expand All @@ -385,12 +385,12 @@ def get_individual_sponsors(settings: Settings, max_individual_sponsor: int = 5)
last_edge = edges[-1]
edges = get_graphql_sponsor_edges(settings=settings, after=last_edge.cursor)

entities: Dict[str, SponsorEntity] = {}
tiers: DefaultDict[float, Dict[str, SponsorEntity]] = defaultdict(dict)
for node in nodes:
if node.tier.monthlyPriceInDollars > max_individual_sponsor:
continue
entities[node.sponsorEntity.login] = node.sponsorEntity
return entities
tiers[node.tier.monthlyPriceInDollars][
node.sponsorEntity.login
] = node.sponsorEntity
return tiers


def get_top_users(
Expand Down Expand Up @@ -475,19 +475,30 @@ def get_top_users(
skip_users=skip_users,
)

sponsors_by_login = get_individual_sponsors(settings=settings)
sponsors = []
for login, sponsor in sponsors_by_login.items():
sponsors.append(
tiers = get_individual_sponsors(settings=settings)
sponsors_50 = []
for login, sponsor in tiers[50].items():
sponsors_50.append(
{"login": login, "avatarUrl": sponsor.avatarUrl, "url": sponsor.url}
)
keys = list(tiers.keys())
keys.sort(reverse=True)
sponsors = []
for key in keys:
if key >= 50:
continue
for login, sponsor in tiers[key].items():
sponsors.append(
{"login": login, "avatarUrl": sponsor.avatarUrl, "url": sponsor.url}
)

people = {
"maintainers": maintainers,
"experts": experts,
"last_month_active": last_month_active,
"top_contributors": top_contributors,
"top_reviewers": top_reviewers,
"sponsors_50": sponsors_50,
"sponsors": sponsors,
}
people_path = Path("./docs/en/data/people.yml")
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ jobs:
run: python3.7 -m pip install flit
- name: Install docs extras
run: python3.7 -m flit install --extras doc
- name: Install Material for MkDocs Insiders
if: github.event.pull_request.head.repo.fork == false
run: pip install git+https://${{ secrets.ACTIONS_TOKEN }}@github.com/squidfunk/mkdocs-material-insiders.git
- name: Build Docs
run: python3.7 ./scripts/docs.py build-all
- name: Zip docs
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
<a href="https://pypi.org/project/fastapi" target="_blank">
<img src="https://img.shields.io/pypi/v/fastapi?color=%2334D058&label=pypi%20package" alt="Package version">
</a>
<a href="https://gitter.im/tiangolo/fastapi?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge" target="_blank">
<img src="https://badges.gitter.im/tiangolo/fastapi.svg" alt="Join the chat at https://gitter.im/tiangolo/fastapi">
</a>
</p>

---
Expand Down Expand Up @@ -48,6 +45,9 @@ The key features are:
<!-- sponsors -->

<a href="https://www.deta.sh/?ref=fastapi" target="_blank" title="The launchpad for all your (team's) ideas"><img src="https://fastapi.tiangolo.com/img/sponsors/deta.svg"></a>
<a href="https://www.investsuite.com/jobs" target="_blank" title="Wealthtech jobs with FastAPI"><img src="https://fastapi.tiangolo.com/img/sponsors/investsuite.svg"></a>
<a href="https://www.vim.so/?utm_source=FastAPI" target="_blank" title="We help you master vim with interactive exercises"><img src="https://fastapi.tiangolo.com/img/sponsors/vimso.png"></a>
<a href="https://talkpython.fm/fastapi-sponsor" target="_blank" title="FastAPI video courses on demand from people you trust"><img src="https://fastapi.tiangolo.com/img/sponsors/talkpython.png"></a>

<!-- /sponsors -->

Expand Down Expand Up @@ -127,7 +127,7 @@ You will also need an ASGI server, for production such as <a href="https://www.u
<div class="termy">

```console
$ pip install uvicorn
$ pip install uvicorn[standard]

---> 100%
```
Expand Down
14 changes: 13 additions & 1 deletion docs/en/data/external_links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ articles:
title: Introducing Dispatch
author_link: https://netflixtechblog.com/
author: Netflix
- link: https://davidefiocco.github.io/2020/06/27/streamlit-fastapi-ml-serving.html
- link: https://davidefiocco.github.io/streamlit-fastapi-ml-serving/
title: Machine learning model serving in Python using FastAPI and streamlit
author_link: https://github.com/davidefiocco
author: Davide Fiocco
Expand All @@ -144,6 +144,18 @@ articles:
title: HTTP server to display desktop notifications
author_link: https://julienharbulot.com/
author: Julien Harbulot
- link: https://guitton.co/posts/fastapi-monitoring/
title: How to monitor your FastAPI service
author_link: https://twitter.com/louis_guitton
author: Louis Guitton
- link: https://amitness.com/2020/06/fastapi-vs-flask/
title: FastAPI for Flask Users
author_link: https://twitter.com/amitness
author: Amit Chaudhary
- link: https://valonjanuzaj.medium.com/deploy-a-dockerized-fastapi-application-to-aws-cc757830ba1b
title: Deploy a dockerized FastAPI application to AWS
author_link: https://www.linkedin.com/in/valon-januzaj-b02692187/
author: Valon Januzaj
japanese:
- link: https://qiita.com/mtitg/items/47770e9a562dd150631d
title: FastAPI|DB接続してCRUDするPython製APIサーバーを構築
Expand Down

0 comments on commit d576c32

Please sign in to comment.