Skip to content

Commit

Permalink
v1.0.0 release
Browse files Browse the repository at this point in the history
Co-authored-by: Jonas Krüger Svensson <[email protected]>
  • Loading branch information
sondrelg and JonasKs committed Nov 1, 2021
0 parents commit 7a3db2d
Show file tree
Hide file tree
Showing 21 changed files with 2,270 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/publish_to_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: publish package

on:
release:
types: [published, edited]

jobs:
build-and-publish-test:
runs-on: ubuntu-latest
steps:
- uses: snok/.github/workflows/publish@main
with:
overwrite-repository: true
repository-url: https://test.pypi.org/legacy/
token: ${{ secrets.TEST_PYPI_TOKEN }}
build-and-publish:
needs: build-and-publish-test
runs-on: ubuntu-latest
steps:
- uses: snok/.github/workflows/publish@main
with:
token: ${{ secrets.PYPI_TOKEN }}
78 changes: 78 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: test

on:
pull_request:
push:
branches:
- main

jobs:
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.10"
- uses: actions/cache@v2
id: cache-venv
with:
path: .venv
key: venv-0
- run: |
python -m venv .venv --upgrade-deps
source .venv/bin/activate
pip install pre-commit
if: steps.cache-venv.outputs.cache-hit != 'true'
- uses: actions/cache@v2
id: pre-commit-cache
with:
path: ~/.cache/pre-commit
key: key-0
- run: |
source .venv/bin/activate
pre-commit run --all-files
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.7", "3.8", "3.9", "3.10" ]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "${{ matrix.python-version }}"
- uses: actions/cache@v2
id: poetry-cache
with:
path: ~/.local
key: key-0
- uses: snok/install-poetry@v1
with:
virtualenvs-create: false
version: 1.2.0a2
- uses: actions/cache@v2
id: cache-venv
with:
path: .venv
key: ${{ hashFiles('**/poetry.lock') }}-0
- run: |
python -m venv .venv
source .venv/bin/activate
pip install -U pip
poetry install --no-interaction --no-root
if: steps.cache-venv.outputs.cache-hit != 'true'
- run: source .venv/bin/activate && pip install coverage[toml]
if: matrix.python-version == '3.10'
- name: Run tests
run: |
source .venv/bin/activate
poetry run pytest --cov=asgi_correlation_id tests/ --cov-report=xml
poetry run coverage report
- uses: codecov/codecov-action@v2
with:
file: ./coverage.xml
fail_ci_if_error: true
if: matrix.python-version == '3.10'
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.pyc
.idea/*
env/
venv/
.venv/
build/
dist/
*.egg-info/
notes
.pytest_cache
.coverage
htmlcov/

# celery
celerybeat-*
56 changes: 56 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
repos:
- repo: https://github.com/psf/black
rev: 21.10b0
hooks:
- id: black

- repo: https://github.com/pycqa/isort
rev: 5.9.3
hooks:
- id: isort

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-ast
- id: check-merge-conflict
- id: check-case-conflict
- id: check-docstring-first
- id: check-json
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending
- id: trailing-whitespace
- id: double-quote-string-fixer

- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
additional_dependencies: [
'flake8-bugbear',
'flake8-comprehensions',
'flake8-print',
'flake8-mutable',
'flake8-simplify',
'flake8-pytest-style',
'flake8-printf-formatting',
]

- repo: https://github.com/sirosen/check-jsonschema
rev: 0.6.0
hooks:
- id: check-github-actions
- id: check-github-workflows

- repo: https://github.com/asottile/pyupgrade
rev: v2.29.0
hooks:
- id: pyupgrade
args: [ "--py36-plus" ]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.910-1
hooks:
- id: mypy
33 changes: 33 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
BSD 4-Clause License

Copyright (c) 2021, Sondre Lillebø Gundersen
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. All advertising materials mentioning features or use of this software must
display the following acknowledgement:
This product includes software developed by [project].

4. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDER "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL COPYRIGHT HOLDER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Loading

0 comments on commit 7a3db2d

Please sign in to comment.