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
Showing
74 changed files
with
1,731 additions
and
1,266 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,15 @@ | ||
name: Python linting | ||
on: [push, pull_request] | ||
jobs: | ||
test: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.10' | ||
- name: Install pre-commit | ||
run: pip install pre-commit | ||
- name: Run pre-commit hooks | ||
run: pre-commit run --all-files --show-diff-on-failure |
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,174 @@ | ||
name: Tests | ||
on: | ||
push: | ||
paths-ignore: | ||
- 'docs/**' | ||
branches: | ||
- main | ||
- master | ||
tags: | ||
- '**' | ||
pull_request: | ||
branches: | ||
- '**' | ||
jobs: | ||
Postgres: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] | ||
services: | ||
postgres: | ||
image: postgres:latest | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: anyblok_test | ||
# Set health checks to wait until PostgreSQL has started | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install Wheel | ||
run: pip install -U pip wheel | ||
- name: Install test dependencies | ||
run: pip install -U -r requirements.test.txt | ||
- name: Install pytest | ||
run: pip install pytest pytest-cov mock coverage-lcov | ||
- name: Install AnyBlok Pyramid | ||
run: pip install .[oidc] | ||
- name: Run framework tests | ||
env: | ||
ANYBLOK_DATABASE_DRIVER: postgresql | ||
ANYBLOK_DATABASE_NAME: anyblok_test | ||
ANYBLOK_DATABASE_PORT: 5432 | ||
ANYBLOK_DATABASE_HOST: localhost | ||
ANYBLOK_DATABASE_USER: postgres | ||
ANYBLOK_DATABASE_PASSWORD: postgres | ||
run: pytest anyblok_pyramid/tests | ||
- name: Drop db | ||
env: | ||
PGHOST: localhost | ||
PGPASSWORD: postgres | ||
PGPORT: 5432 | ||
run: psql -U postgres -c 'DROP DATABASE anyblok_test;' | ||
- name: Run anyblok_createdb with auth | ||
env: | ||
ANYBLOK_DATABASE_DRIVER: postgresql | ||
ANYBLOK_DATABASE_NAME: anyblok_test | ||
ANYBLOK_DATABASE_PORT: 5432 | ||
ANYBLOK_DATABASE_HOST: localhost | ||
ANYBLOK_DATABASE_USER: postgres | ||
ANYBLOK_DATABASE_PASSWORD: postgres | ||
run: anyblok_createdb --install-bloks auth | ||
- name: Run bloks tests on auth | ||
env: | ||
ANYBLOK_DATABASE_DRIVER: postgresql | ||
ANYBLOK_DATABASE_NAME: anyblok_test | ||
ANYBLOK_DATABASE_PORT: 5432 | ||
ANYBLOK_DATABASE_HOST: localhost | ||
ANYBLOK_DATABASE_USER: postgres | ||
ANYBLOK_DATABASE_PASSWORD: postgres | ||
run: pytest --cov-append anyblok_pyramid/bloks/auth | ||
- name: Drop db | ||
env: | ||
PGHOST: localhost | ||
PGPASSWORD: postgres | ||
PGPORT: 5432 | ||
run: psql -U postgres -c 'DROP DATABASE anyblok_test;' | ||
- name: Run anyblok_createdb with auth-password | ||
env: | ||
ANYBLOK_DATABASE_DRIVER: postgresql | ||
ANYBLOK_DATABASE_NAME: anyblok_test | ||
ANYBLOK_DATABASE_PORT: 5432 | ||
ANYBLOK_DATABASE_HOST: localhost | ||
ANYBLOK_DATABASE_USER: postgres | ||
ANYBLOK_DATABASE_PASSWORD: postgres | ||
run: anyblok_createdb --install-bloks auth-password | ||
- name: Run bloks tests on auth-password | ||
env: | ||
ANYBLOK_DATABASE_DRIVER: postgresql | ||
ANYBLOK_DATABASE_NAME: anyblok_test | ||
ANYBLOK_DATABASE_PORT: 5432 | ||
ANYBLOK_DATABASE_HOST: localhost | ||
ANYBLOK_DATABASE_USER: postgres | ||
ANYBLOK_DATABASE_PASSWORD: postgres | ||
run: pytest --cov-append anyblok_pyramid/bloks/password | ||
- name: Drop db | ||
env: | ||
PGHOST: localhost | ||
PGPASSWORD: postgres | ||
PGPORT: 5432 | ||
run: psql -U postgres -c 'DROP DATABASE anyblok_test;' | ||
- name: Run anyblok_createdb with authorization | ||
env: | ||
ANYBLOK_DATABASE_DRIVER: postgresql | ||
ANYBLOK_DATABASE_NAME: anyblok_test | ||
ANYBLOK_DATABASE_PORT: 5432 | ||
ANYBLOK_DATABASE_HOST: localhost | ||
ANYBLOK_DATABASE_USER: postgres | ||
ANYBLOK_DATABASE_PASSWORD: postgres | ||
run: anyblok_createdb --install-bloks authorization | ||
- name: Run bloks tests on authorization | ||
env: | ||
ANYBLOK_DATABASE_DRIVER: postgresql | ||
ANYBLOK_DATABASE_NAME: anyblok_test | ||
ANYBLOK_DATABASE_PORT: 5432 | ||
ANYBLOK_DATABASE_HOST: localhost | ||
ANYBLOK_DATABASE_USER: postgres | ||
ANYBLOK_DATABASE_PASSWORD: postgres | ||
run: pytest --cov-append anyblok_pyramid/bloks/authorization | ||
- name: Drop db | ||
env: | ||
PGHOST: localhost | ||
PGPASSWORD: postgres | ||
PGPORT: 5432 | ||
run: psql -U postgres -c 'DROP DATABASE anyblok_test;' | ||
- name: Run anyblok_createdb with user identity | ||
env: | ||
ANYBLOK_DATABASE_DRIVER: postgresql | ||
ANYBLOK_DATABASE_NAME: anyblok_test | ||
ANYBLOK_DATABASE_PORT: 5432 | ||
ANYBLOK_DATABASE_HOST: localhost | ||
ANYBLOK_DATABASE_USER: postgres | ||
ANYBLOK_DATABASE_PASSWORD: postgres | ||
run: anyblok_createdb --install-bloks user-identity | ||
- name: Run bloks tests on user-identity | ||
env: | ||
ANYBLOK_DATABASE_DRIVER: postgresql | ||
ANYBLOK_DATABASE_NAME: anyblok_test | ||
ANYBLOK_DATABASE_PORT: 5432 | ||
ANYBLOK_DATABASE_HOST: localhost | ||
ANYBLOK_DATABASE_USER: postgres | ||
ANYBLOK_DATABASE_PASSWORD: postgres | ||
run: pytest --cov-append anyblok_pyramid/bloks/user_identity | ||
- name: Generate lcov | ||
run: coverage-lcov | ||
- name: Coveralls | ||
uses: coverallsapp/github-action@1.1.3 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
parallel: true | ||
flag-name: ${{ github.job }} | ||
path-to-lcov: lcov.info | ||
|
||
finish: | ||
needs: [Postgres] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Coveralls Finished | ||
uses: coverallsapp/github-action@1.1.3 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
parallel-finished: true | ||
path-to-lcov: lcov.info |
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 |
---|---|---|
|
@@ -24,4 +24,3 @@ etc/ | |
develop-eggs/ | ||
|
||
gmon.out | ||
|
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,30 @@ | ||
exclude: "addons-thirdparty/" | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks.git | ||
rev: v4.4.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: debug-statements | ||
- id: fix-encoding-pragma | ||
args: ["--remove"] | ||
- id: check-added-large-files | ||
- id: check-merge-conflict | ||
- id: check-yaml | ||
- id: check-case-conflict | ||
- id: mixed-line-ending | ||
args: ["--fix=lf"] | ||
- repo: https://github.com/PyCQA/flake8 | ||
rev: "6.0.0" | ||
hooks: | ||
- id: flake8 | ||
name: flake8 | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: isort | ||
- repo: https://github.com/psf/black | ||
rev: 23.1.0 | ||
hooks: | ||
- id: black | ||
args: ["-l", "80"] |
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
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,59 +1,59 @@ | ||
.. This file is a part of the AnyBlok / Pyramid project | ||
.. | ||
.. Copyright (C) 2015 Jean-Sebastien SUZANNE <jssuzanne@anybox.fr> | ||
.. Copyright (C) 2019 Jean-Sebastien SUZANNE <js.suzanne@gmail.com> | ||
.. | ||
.. This Source Code Form is subject to the terms of the Mozilla Public License, | ||
.. v. 2.0. If a copy of the MPL was not distributed with this file,You can | ||
.. obtain one at http://mozilla.org/MPL/2.0/. | ||
.. image:: https://img.shields.io/pypi/pyversions/anyblok_delivery.svg?longCache=True | ||
:alt: Python versions | ||
|
||
.. image:: https://travis-ci.org/AnyBlok/Anyblok_Pyramid.svg?branch=master | ||
:target: https://travis-ci.org/AnyBlok/Anyblok_Pyramid | ||
:alt: Build status | ||
|
||
.. image:: https://coveralls.io/repos/github/AnyBlok/Anyblok_Pyramid/badge.svg?branch=master | ||
:target: https://coveralls.io/github/AnyBlok/Anyblok_Pyramid?branch=master | ||
:alt: Coverage | ||
|
||
.. image:: https://img.shields.io/pypi/v/Anyblok_Pyramid.svg | ||
:target: https://pypi.python.org/pypi/Anyblok_Pyramid/ | ||
:alt: Version status | ||
.. image:: https://readthedocs.org/projects/anyblok-pyramid/badge/?version=latest | ||
:alt: Documentation Status | ||
:scale: 100% | ||
:target: https://doc.anyblok-pyramid.anyblok.org/en/latest/?badge=latest | ||
|
||
|
||
AnyBlok / Pyramid | ||
================= | ||
|
||
AnyBlok / Pyramid make the link between `AnyBlok <http://doc.anyblok.org>`_ and | ||
`Pyramid <http://pyramid.readthedocs.org/>`_ | ||
|
||
It also gives you some bloks for adding user http authentication and role | ||
based authorization to your project. | ||
|
||
|
||
+-------------------+--------------+----------------------------------------------------------+ | ||
| Blok | Dependencies | Description | | ||
+===================+==============+==========================================================+ | ||
| **Pyramid** | | Add hooks to connect Pyramid authentification, OIDC | | ||
| | | Relying Party and authorization | | ||
+-------------------+--------------+----------------------------------------------------------+ | ||
| **auth** | **pyramid** | Add 'User' and 'User.Role' models. | | ||
+-------------------+--------------+----------------------------------------------------------+ | ||
| **auth-password** | **auth** | Add 'User.CredentialStore' model, a simple | | ||
| | | login, password table | | ||
+-------------------+--------------+----------------------------------------------------------+ | ||
| **authorization** | **auth** | Add 'User.Authorization' model for managing permissions | | ||
+-------------------+--------------+----------------------------------------------------------+ | ||
| **user_identity** | **auth** | Add some column on model **Model.Pyramid.User** | | ||
+-------------------+--------------+----------------------------------------------------------+ | ||
|
||
AnyBlok / Pyramid is released under the terms of the `Mozilla Public License`. | ||
|
||
See the `latest documentation <http://doc.anyblok-pyramid.anyblok.org/>`_ | ||
.. This file is a part of the AnyBlok / Pyramid project | ||
.. | ||
.. Copyright (C) 2015 Jean-Sebastien SUZANNE <jssuzanne@anybox.fr> | ||
.. Copyright (C) 2019 Jean-Sebastien SUZANNE <js.suzanne@gmail.com> | ||
.. | ||
.. This Source Code Form is subject to the terms of the Mozilla Public License, | ||
.. v. 2.0. If a copy of the MPL was not distributed with this file,You can | ||
.. obtain one at http://mozilla.org/MPL/2.0/. | ||
.. image:: https://img.shields.io/pypi/pyversions/anyblok_delivery.svg?longCache=True | ||
:alt: Python versions | ||
|
||
.. image:: https://travis-ci.org/AnyBlok/Anyblok_Pyramid.svg?branch=master | ||
:target: https://travis-ci.org/AnyBlok/Anyblok_Pyramid | ||
:alt: Build status | ||
|
||
.. image:: https://coveralls.io/repos/github/AnyBlok/Anyblok_Pyramid/badge.svg?branch=master | ||
:target: https://coveralls.io/github/AnyBlok/Anyblok_Pyramid?branch=master | ||
:alt: Coverage | ||
|
||
.. image:: https://img.shields.io/pypi/v/Anyblok_Pyramid.svg | ||
:target: https://pypi.python.org/pypi/Anyblok_Pyramid/ | ||
:alt: Version status | ||
|
||
.. image:: https://readthedocs.org/projects/anyblok-pyramid/badge/?version=latest | ||
:alt: Documentation Status | ||
:scale: 100% | ||
:target: https://doc.anyblok-pyramid.anyblok.org/en/latest/?badge=latest | ||
|
||
|
||
AnyBlok / Pyramid | ||
================= | ||
|
||
AnyBlok / Pyramid make the link between `AnyBlok <http://doc.anyblok.org>`_ and | ||
`Pyramid <http://pyramid.readthedocs.org/>`_ | ||
|
||
It also gives you some bloks for adding user http authentication and role | ||
based authorization to your project. | ||
|
||
|
||
+-------------------+--------------+----------------------------------------------------------+ | ||
| Blok | Dependencies | Description | | ||
+===================+==============+==========================================================+ | ||
| **Pyramid** | | Add hooks to connect Pyramid authentification, OIDC | | ||
| | | Relying Party and authorization | | ||
+-------------------+--------------+----------------------------------------------------------+ | ||
| **auth** | **pyramid** | Add 'User' and 'User.Role' models. | | ||
+-------------------+--------------+----------------------------------------------------------+ | ||
| **auth-password** | **auth** | Add 'User.CredentialStore' model, a simple | | ||
| | | login, password table | | ||
+-------------------+--------------+----------------------------------------------------------+ | ||
| **authorization** | **auth** | Add 'User.Authorization' model for managing permissions | | ||
+-------------------+--------------+----------------------------------------------------------+ | ||
| **user_identity** | **auth** | Add some column on model **Model.Pyramid.User** | | ||
+-------------------+--------------+----------------------------------------------------------+ | ||
|
||
AnyBlok / Pyramid is released under the terms of the `Mozilla Public License`. | ||
|
||
See the `latest documentation <http://doc.anyblok-pyramid.anyblok.org/>`_ |
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
Oops, something went wrong.