-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4c3e36f
commit a46656d
Showing
71 changed files
with
7,810 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
name: Main | ||
|
||
on: | ||
release: | ||
types: [published] | ||
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- README.md | ||
pull_request: | ||
branches: | ||
- "*" | ||
paths-ignore: | ||
- README.md | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
python-version: [3.9] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 1 | ||
submodules: false | ||
|
||
- name: Use Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- uses: actions/cache@v1 | ||
id: depcache | ||
with: | ||
path: deps | ||
key: requirements-pip-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }} | ||
|
||
- name: Download dependencies | ||
if: steps.depcache.outputs.cache-hit != 'true' | ||
run: | | ||
pip download --dest=deps -r requirements.txt | ||
- name: Install dependencies | ||
run: | | ||
pip install -U --no-index --find-links=deps deps/* | ||
- name: Build documentation | ||
run: | | ||
mkdocs build | ||
- name: Fix links | ||
run: | | ||
chmod +x ./fixlinks.sh | ||
./fixlinks.sh | ||
- name: Zip built files | ||
run: | | ||
mkdir -p .build/blacksheep | ||
mv site/* .build/blacksheep | ||
cd .build | ||
7z a -r site.zip blacksheep | ||
- name: Upload distribution package | ||
uses: actions/upload-artifact@master | ||
with: | ||
name: dist | ||
path: .build/site.zip | ||
|
||
publish: | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
if: github.event_name == 'release' | ||
steps: | ||
- name: Download a distribution artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: dist | ||
path: dist | ||
|
||
- name: Unzip artifacts | ||
run: | | ||
7z x -o"site" dist/site.zip | ||
- name: Use Python 3.9 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Install tools | ||
run: | | ||
pip install pyazblob | ||
- name: Install tools | ||
run: | | ||
pip install pyazblob | ||
- name: Publish distribution 📦 to DEV | ||
run: | | ||
pyazblob upload --path site/ --account-name "$ACCOUNT_NAME" -cn "\$web" -r -f | ||
env: | ||
ACCOUNT_NAME: ${{ secrets.DEV_EUW_ACCOUNT_NAME }} | ||
PYAZ_ACCOUNT_KEY: ${{ secrets.DEV_EUW_ACCOUNT_KEY }} | ||
|
||
- name: Publish distribution 📦 to PROD EUW | ||
if: github.ref == 'refs/heads/main' | ||
run: | | ||
pyazblob upload --path site/ --account-name "$ACCOUNT_NAME" -cn "\$web" -r -f | ||
env: | ||
ACCOUNT_NAME: ${{ secrets.PROD_EUW_ACCOUNT_NAME }} | ||
PYAZ_ACCOUNT_KEY: ${{ secrets.PROD_EUW_ACCOUNT_KEY }} | ||
|
||
- name: Publish distribution 📦 to PROD USE | ||
if: github.ref == 'refs/heads/main' | ||
run: | | ||
pyazblob upload --path site/ --account-name "$ACCOUNT_NAME" -cn "\$web" -r -f | ||
env: | ||
ACCOUNT_NAME: ${{ secrets.PROD_USE_ACCOUNT_NAME }} | ||
PYAZ_ACCOUNT_KEY: ${{ secrets.PROD_USE_ACCOUNT_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,129 +1,3 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
site | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
pip-wheel-metadata/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# pipenv | ||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | ||
# However, in case of collaboration, if having platform-specific dependencies or dependencies | ||
# having no cross-platform support, pipenv may install dependencies that don't work, or not | ||
# install all needed dependencies. | ||
#Pipfile.lock | ||
|
||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow | ||
__pypackages__/ | ||
|
||
# Celery stuff | ||
celerybeat-schedule | ||
celerybeat.pid | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ | ||
venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
MIT License | ||
|
||
Copyright (c) 2021 Neoteroi | ||
Copyright (c) 2021 Neoteroi, Roberto Prevato ([email protected]) | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
# BlackSheep-Docs | ||
Repository containing the documentation of BlackSheep web framework. | ||
# BlackSheep documentation | ||
This repository contains the source code of the documentation that gets published to [www.neoteroi.dev/blacksheep/](www.neoteroi.dev/blacksheep/). | ||
|
||
This code has been previously hosted in [Azure DevOps](https://dev.azure.com/robertoprevato/BlackSheep). | ||
|
||
## How to contribute | ||
|
||
The documentation uses MkDocs. For information on how to use MkDocs locally, refer to its documentation. |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# About BlackSheep | ||
|
||
BlackSheep is a web framework for Python asyncio designed to facilitate the | ||
implementation of stateless APIs and general purpose web applications. It is | ||
inspired by [Flask](https://flask.palletsprojects.com/en/1.1.x/) and [ASP.NET | ||
Core](https://docs.microsoft.com/en-us/aspnet/core/introduction-to-aspnet-core?view=aspnetcore-5.0); | ||
it recreates several features from both these web frameworks. The concept of | ||
automatic binding of request parameters by request handler's signature and | ||
dependency injection of required services (as it happens in ASP.NET Core) is | ||
what makes BlackSheep unique today, in the context of Python web frameworks. | ||
|
||
The project, as several other web frameworks for Python, is the fruit of the | ||
creative ferment around Yury Selivanov’s work, and the article [uvloop: Blazing | ||
fast Python | ||
networking](https://magic.io/blog/uvloop-blazing-fast-python-networking/) from | ||
2016. | ||
|
||
The project originally included an implementation of [HTTP Server, but this was | ||
removed](https://robertoprevato.github.io/Presenting-BlackSheep/), and the web | ||
framework was abstracted from an exact HTTP Server and made compatible with | ||
[ASGI HTTP Servers](https://asgi.readthedocs.io/en/latest/). This was a good | ||
move because the effort on the project can stay focused on higher-level | ||
features, while benefitting from the existing ecosystem and help from the | ||
Python community in implementing HTTP Servers (e.g. support for HTTP2). | ||
|
||
## The project's home | ||
The project is hosted in [GitHub](https://github.com/Neoteroi/BlackSheep), | ||
handled following DevOps good practices, features 100% code coverage, and is | ||
published to [pypi.org](https://pypi.org/project/blacksheep/). | ||
|
||
[![GitHub Stars](https://img.shields.io/github/stars/Neoteroi/BlackSheep?style=social)](https://github.com/Neoteroi/BlackSheep/stargazers) | ||
[![Build](https://github.com/Neoteroi/BlackSheep/workflows/Main/badge.svg)](https://github.com/Neoteroi/BlackSheep/actions) | ||
[![pypi](https://img.shields.io/pypi/v/BlackSheep.svg?color=blue)](https://pypi.org/project/BlackSheep/) | ||
[![versions](https://img.shields.io/pypi/pyversions/blacksheep.svg)](https://github.com/Neoteroi/BlackSheep) | ||
[![codecov](https://codecov.io/gh/Neoteroi/BlackSheep/branch/master/graph/badge.svg?token=Nzi29L0Eg1)](https://codecov.io/gh/Neoteroi/BlackSheep) | ||
|
||
## Why the name BlackSheep | ||
The name _BlackSheep_ was chosen for two reasons: | ||
|
||
* to refer to the "black sheep" idiom, used to describe [_one who is unlike | ||
other members of a family, group, or organization, sometimes due to | ||
intentional | ||
rebelliousness_](https://idioms.thefreedictionary.com/the+black+sheep) - | ||
especially for the choice of giving so much importance to _dependency | ||
injection_ (which is not very popular in Python community), asynchronous | ||
coding and type annotations (which are still debated upon in Python | ||
community), and for being a Python web framework inspired by ASP.NET Core. | ||
* as a tribute to the song _The Sinking Belle (Black Sheep)_ of the album | ||
[_Altar_](https://en.wikipedia.org/wiki/Altar_(album)), by Boris and | ||
Sunn O))). |
Oops, something went wrong.