Skip to content

Commit

Permalink
Revert the name change (#300)
Browse files Browse the repository at this point in the history
See #299
  • Loading branch information
RobertoPrevato authored Jan 7, 2023
1 parent 9fd845c commit 65778d5
Show file tree
Hide file tree
Showing 164 changed files with 760 additions and 672 deletions.
6 changes: 3 additions & 3 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ ignore = E203, E266, W503
max-line-length = 88
max-complexity = 18
per-file-ignores =
neoteroi/web/__init__.py:F401
neoteroi/web/client/__init__.py:F401
neoteroi/web/server/__init__.py:F401
blacksheep/__init__.py:F401
blacksheep/client/__init__.py:F401
blacksheep/server/__init__.py:F401
tests/*:E501
itests/*:E501

Expand Down
46 changes: 23 additions & 23 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
- README.md

env:
PROJECT_NAME: neoteroi
PROJECT_NAME: blacksheep

jobs:
windows-validation:
Expand Down Expand Up @@ -47,14 +47,14 @@ jobs:
- name: Compile Cython extensions
run: |
cython neoteroi/web/url.pyx
cython neoteroi/web/exceptions.pyx
cython neoteroi/web/headers.pyx
cython neoteroi/web/cookies.pyx
cython neoteroi/web/contents.pyx
cython neoteroi/web/messages.pyx
cython neoteroi/web/scribe.pyx
cython neoteroi/web/baseapp.pyx
cython blacksheep/url.pyx
cython blacksheep/exceptions.pyx
cython blacksheep/headers.pyx
cython blacksheep/cookies.pyx
cython blacksheep/contents.pyx
cython blacksheep/messages.pyx
cython blacksheep/scribe.pyx
cython blacksheep/baseapp.pyx
python setup.py build_ext --inplace
- name: Run tests
Expand All @@ -63,7 +63,7 @@ jobs:
- name: Run linters
run: |
flake8 neoteroi/web
flake8 blacksheep
flake8 tests
- name: Test Hypercorn
Expand Down Expand Up @@ -125,13 +125,13 @@ jobs:
run: |
echo "Running linters - if build fails here, please be patient! Feel free to ask for assistance."
flake8 neoteroi/web
flake8 blacksheep
flake8 tests
flake8 itests
isort --check-only neoteroi/web 2>&1
isort --check-only blacksheep 2>&1
isort --check-only tests 2>&1
isort --check-only itests 2>&1
black --check neoteroi/web 2>&1
black --check blacksheep 2>&1
black --check tests 2>&1
black --check itests 2>&1
Expand Down Expand Up @@ -200,14 +200,14 @@ jobs:
run: |
make clean
cython neoteroi/web/url.pyx
cython neoteroi/web/exceptions.pyx
cython neoteroi/web/headers.pyx
cython neoteroi/web/cookies.pyx
cython neoteroi/web/contents.pyx
cython neoteroi/web/messages.pyx
cython neoteroi/web/scribe.pyx
cython neoteroi/web/baseapp.pyx
cython blacksheep/url.pyx
cython blacksheep/exceptions.pyx
cython blacksheep/headers.pyx
cython blacksheep/cookies.pyx
cython blacksheep/contents.pyx
cython blacksheep/messages.pyx
cython blacksheep/scribe.pyx
cython blacksheep/baseapp.pyx
- name: Build wheels (linux)
if: startsWith(matrix.os, 'ubuntu')
Expand All @@ -231,8 +231,8 @@ jobs:
if: |
!startsWith(matrix.os, 'windows')
run: |
pip install neoteroi/web -f "file:///${GITHUB_WORKSPACE}/dist"
pip freeze | grep neoteroi/web
pip install blacksheep -f "file:///${GITHUB_WORKSPACE}/dist"
pip freeze | grep blacksheep
publish:
runs-on: ubuntu-latest
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ tests/out/

*,cover

neoteroi/web/*.c
neoteroi/web/*.html
neoteroi/web/includes/*.html
blacksheep/*.c
blacksheep/*.html
blacksheep/includes/*.html
out/*

# Output of integration tests
Expand Down
14 changes: 4 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [2.0.0] - ???

- Renames the web framework package to `neoteroi-web`, to adopt PEP 420 and
offer a more consistent experience when used with its related libraries.
The name BlackSheep will still used as project name for some time.
- Renames the `plugins` namespace to `settings`.
- Replaces `rodi` with `neoteroi-di`, which includes improvements.
- Renames the `plugins` namespace to `settings`
- Upgrades `rodi` to v2, which includes improvements.
- Adds support for alternative implementation of containers for dependency
injection, removing direct references to `rodi` (now `neoteroi-di`) in most
of the source code (except for the default service container for the
`Application` class). Replaces direct dependency on `rodi` classes with
protocols.
- Replaces `guardpost` with `neoteroi-auth`, which includes support for
injection, using the new `ContainerProtocol` in `rodi`.
- Upgrades `guardpost` to v1, which includes support for
dependency injection in authentication handlers and authorization requirements.
- Adds support for Binders instantiated using dependency injection. However,
binders are still instantiated once per request handler and are still
Expand Down
8 changes: 4 additions & 4 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
include LICENSE
include README.md
include neoteroi/web/server/res/*.html
include neoteroi/web/server/res/*.css
include blacksheep/server/res/*.html
include blacksheep/server/res/*.css
include build_info.txt
recursive-include neoteroi/web *.pyx *.pxd *.pxi *.pyi *.py *.c *.h
recursive-include blacksheep *.pyx *.pxd *.pxi *.pyi *.py *.c *.h

# Stubs
include neoteroi/web/py.typed
include blacksheep/py.typed
50 changes: 25 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@


cyt:
cython neoteroi/web/url.pyx
cython neoteroi/web/exceptions.pyx
cython neoteroi/web/headers.pyx
cython neoteroi/web/cookies.pyx
cython neoteroi/web/contents.pyx
cython neoteroi/web/messages.pyx
cython neoteroi/web/scribe.pyx
cython neoteroi/web/baseapp.pyx
cython blacksheep/url.pyx
cython blacksheep/exceptions.pyx
cython blacksheep/headers.pyx
cython blacksheep/cookies.pyx
cython blacksheep/contents.pyx
cython blacksheep/messages.pyx
cython blacksheep/scribe.pyx
cython blacksheep/baseapp.pyx

compile: cyt
python3 setup.py build_ext --inplace
Expand All @@ -18,23 +18,23 @@ compile: cyt
clean:
rm -rf dist/
rm -rf build/
rm -f neoteroi/web/*.c
rm -f neoteroi/web/*.so
rm -f blacksheep/*.c
rm -f blacksheep/*.so


buildext:
python3 setup.py build_ext --inplace


annotate:
cython neoteroi/web/url.pyx -a
cython neoteroi/web/exceptions.pyx -a
cython neoteroi/web/headers.pyx -a
cython neoteroi/web/cookies.pyx -a
cython neoteroi/web/contents.pyx -a
cython neoteroi/web/messages.pyx -a
cython neoteroi/web/scribe.pyx -a
cython neoteroi/web/baseapp.pyx -a
cython blacksheep/url.pyx -a
cython blacksheep/exceptions.pyx -a
cython blacksheep/headers.pyx -a
cython blacksheep/cookies.pyx -a
cython blacksheep/contents.pyx -a
cython blacksheep/messages.pyx -a
cython blacksheep/scribe.pyx -a
cython blacksheep/baseapp.pyx -a


artifacts: test
Expand Down Expand Up @@ -70,38 +70,38 @@ test-v:


test-cov-unit:
pytest --cov-report html --cov=neoteroi/web tests
pytest --cov-report html --cov=blacksheep tests


test-cov:
pytest --cov-report html --cov=neoteroi/web --disable-warnings
pytest --cov-report html --cov=blacksheep --disable-warnings


lint: check-flake8 check-isort check-black

format:
@isort neoteroi/web 2>&1
@isort blacksheep 2>&1
@isort tests 2>&1
@isort itests 2>&1
@black neoteroi/web 2>&1
@black blacksheep 2>&1
@black tests 2>&1
@black itests 2>&1

check-flake8:
@echo "$(BOLD)Checking flake8$(RESET)"
@flake8 neoteroi/web 2>&1
@flake8 blacksheep 2>&1
@flake8 tests 2>&1


check-isort:
@echo "$(BOLD)Checking isort$(RESET)"
@isort --check-only neoteroi/web 2>&1
@isort --check-only blacksheep 2>&1
@isort --check-only tests 2>&1
@isort --check-only itests 2>&1


check-black: ## Run the black tool in check mode only (won't modify files)
@echo "$(BOLD)Checking black$(RESET)"
@black --check neoteroi/web 2>&1
@black --check blacksheep 2>&1
@black --check tests 2>&1
@black --check itests 2>&1
23 changes: 10 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,20 @@ applications with Python. It is inspired by
Core](https://docs.microsoft.com/en-us/aspnet/core/), and the work by [Yury
Selivanov](https://magic.io/blog/uvloop-blazing-fast-python-networking/).

BlackSheep is the project name of the web framework in Neoteroi. With the
second version of the framework, the Python package is renamed from `blacksheep` to `neoteroi-web`.

<p align="left">
<a href="#blacksheep"><img width="320" height="271" src="https://www.neoteroi.dev/blacksheep/img/blacksheep.png" alt="Black Sheep"></a>
</p>

```bash
pip install neoteroi-web
pip install blacksheep
```

The first version of the web framework is available as [`blacksheep`](https://pypi.org/project/blacksheep/) and is not going to be _willingly_ modified in non-backward compatible ways (it is stable).
`neoteroi-web` is currently `alpha` and still subject to change.

---

```python
from datetime import datetime

from neoteroi.web import Application
from blacksheep import Application


app = Application()
Expand Down Expand Up @@ -63,6 +57,7 @@ classifiers. The current list is:

[![versions](https://img.shields.io/pypi/pyversions/blacksheep.svg)](https://github.com/robertoprevato/blacksheep)


BlackSheep belongs to the category of
[ASGI](https://asgi.readthedocs.io/en/latest/) web frameworks, so it requires
an ASGI HTTP server to run, such as [uvicorn](http://www.uvicorn.org/), or
Expand All @@ -77,7 +72,7 @@ To run an application like in the example above, use the methods provided by
the ASGI HTTP Server:

```bash
# if the web app is defined in a file `server.py`
# if the BlackSheep app is defined in a file `server.py`

$ uvicorn server:app
```
Expand All @@ -93,7 +88,7 @@ here](https://www.neoteroi.dev/blacksheep/requests/).
```python
from dataclasses import dataclass

from neoteroi.web import Application, FromJSON, FromQuery
from blacksheep import Application, FromJSON, FromQuery


app = Application()
Expand Down Expand Up @@ -180,7 +175,7 @@ async def only_for_authenticated_users():
...
```

The framework includes:
Since version `1.2.1`, BlackSheep implements:

* [Built-in support for OpenID Connect authentication](https://www.neoteroi.dev/blacksheep/authentication/#oidc)
* [Built-in support for JWT Bearer authentication](https://www.neoteroi.dev/blacksheep/authentication/#jwt-bearer)
Expand Down Expand Up @@ -234,12 +229,14 @@ Refer to the documentation for more details and examples.
* [Anti Forgery validation](https://www.neoteroi.dev/blacksheep/anti-request-forgery) to protect against Cross-Site Request Forgery (XSRF/CSRF) attacks

## Client features

BlackSheep includes an HTTP Client.

**Example:**
```python
import asyncio
from neoteroi.web.client import ClientSession

from blacksheep.client import ClientSession


async def client_example(loop):
Expand All @@ -266,4 +263,4 @@ loop.run_until_complete(client_example(loop))
Please refer to the [documentation website](https://www.neoteroi.dev/blacksheep/).

## Communication
[Community in Gitter](https://gitter.im/Neoteroi/BlackSheep).
[BlackSheep community in Gitter](https://gitter.im/Neoteroi/BlackSheep).
Loading

0 comments on commit 65778d5

Please sign in to comment.