Compare commits
	
		
			6 Commits
		
	
	
		
			motd-fixes
			...
			motd_addre
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 0489dd9aaf | ||
|   | 47215d4635 | ||
|   | 38ff9069f3 | ||
|   | 4dde4572ec | ||
|   | 31d14704cb | ||
|   | 6a89f4b2fe | 
							
								
								
									
										28
									
								
								.github/workflows/coverage.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										28
									
								
								.github/workflows/coverage.yml
									
									
									
									
										vendored
									
									
								
							| @@ -12,29 +12,23 @@ on: | |||||||
|       - main |       - main | ||||||
|       - current-release |       - current-release | ||||||
|       - "*LTS" |       - "*LTS" | ||||||
|  |  | ||||||
| jobs: | jobs: | ||||||
|   test: |   coverage: | ||||||
|     runs-on: ${{ matrix.os }} |     name: Check coverage | ||||||
|  |     runs-on: ubuntu-latest | ||||||
|     strategy: |     strategy: | ||||||
|       matrix: |  | ||||||
|         python-version: [3.9] |  | ||||||
|         os: [ubuntu-latest] |  | ||||||
|       fail-fast: false |       fail-fast: false | ||||||
|  |  | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v2 |  | ||||||
|       - uses: actions/setup-python@v1 |  | ||||||
|         with: |  | ||||||
|           python-version: ${{ matrix.python-version }} |  | ||||||
|  |  | ||||||
|       - name: Install dependencies 🔨 |  | ||||||
|         run: | |  | ||||||
|           python -m pip install --upgrade pip |  | ||||||
|           pip install tox |  | ||||||
|       - name: Run coverage |       - name: Run coverage | ||||||
|         run: tox -e coverage |         uses: sanic-org/simple-tox-action@v1 | ||||||
|         continue-on-error: true |         with: | ||||||
|       - uses: codecov/codecov-action@v2 |           python-version: "3.11" | ||||||
|  |           tox-env: coverage | ||||||
|  |           ignore-errors: true | ||||||
|  |       - name: Run Codecov | ||||||
|  |         uses: codecov/codecov-action@v3 | ||||||
|         with: |         with: | ||||||
|           files: ./coverage.xml |           files: ./coverage.xml | ||||||
|           fail_ci_if_error: false |           fail_ci_if_error: false | ||||||
|   | |||||||
							
								
								
									
										39
									
								
								.github/workflows/on-demand.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										39
									
								
								.github/workflows/on-demand.yml
									
									
									
									
										vendored
									
									
								
							| @@ -1,39 +0,0 @@ | |||||||
| name: On Demand Task |  | ||||||
| on: |  | ||||||
|   workflow_dispatch: |  | ||||||
|     inputs: |  | ||||||
|       python-version: |  | ||||||
|         description: 'Version of Python to use for running Test' |  | ||||||
|         required: false |  | ||||||
|         default: "3.8" |  | ||||||
|       tox-env: |  | ||||||
|         description: 'Test Environment to Run' |  | ||||||
|         required: true |  | ||||||
|         default: '' |  | ||||||
|       os: |  | ||||||
|         description: 'Operating System to Run Test on' |  | ||||||
|         required: false |  | ||||||
|         default: ubuntu-latest |  | ||||||
| jobs: |  | ||||||
|   onDemand: |  | ||||||
|     name: tox-${{ matrix.config.tox-env }}-on-${{ matrix.os }} |  | ||||||
|     runs-on: ${{ matrix.os }} |  | ||||||
|     strategy: |  | ||||||
|       fail-fast: false |  | ||||||
|       matrix: |  | ||||||
|         os: ["${{ github.event.inputs.os}}"] |  | ||||||
|         config: |  | ||||||
|           - { tox-env: "${{ github.event.inputs.tox-env }}", py-version: "${{ github.event.inputs.python-version }}"} |  | ||||||
|     steps: |  | ||||||
|       - name: Checkout Repository |  | ||||||
|         uses: actions/checkout@v2 |  | ||||||
|  |  | ||||||
|       - name: Run tests |  | ||||||
|         uses: harshanarayana/custom-actions@main |  | ||||||
|         with: |  | ||||||
|           python-version: ${{ matrix.config.py-version }} |  | ||||||
|           test-infra-tool: tox |  | ||||||
|           test-infra-version: latest |  | ||||||
|           action: tests |  | ||||||
|           test-additional-args: "-e=${{ matrix.config.tox-env }}" |  | ||||||
|           experimental-ignore-error: "yes" |  | ||||||
							
								
								
									
										37
									
								
								.github/workflows/pr-bandit.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										37
									
								
								.github/workflows/pr-bandit.yml
									
									
									
									
										vendored
									
									
								
							| @@ -1,37 +0,0 @@ | |||||||
| name: Security Analysis |  | ||||||
| on: |  | ||||||
|   pull_request: |  | ||||||
|     branches: |  | ||||||
|       - main |  | ||||||
|       - current-release |  | ||||||
|       - "*LTS" |  | ||||||
|     types: [opened, synchronize, reopened, ready_for_review] |  | ||||||
|  |  | ||||||
| jobs: |  | ||||||
|   bandit: |  | ||||||
|     if: github.event.pull_request.draft == false |  | ||||||
|     name: type-check-${{ matrix.config.python-version }} |  | ||||||
|     runs-on: ${{ matrix.os }} |  | ||||||
|     strategy: |  | ||||||
|       fail-fast: false |  | ||||||
|       matrix: |  | ||||||
|         os: [ubuntu-latest] |  | ||||||
|         config: |  | ||||||
|           - { python-version: 3.8, tox-env: security} |  | ||||||
|           - { python-version: 3.9, tox-env: security} |  | ||||||
|           - { python-version: "3.10", tox-env: security} |  | ||||||
|           - { python-version: "3.11", tox-env: security} |  | ||||||
|     steps: |  | ||||||
|       - name: Checkout the repository |  | ||||||
|         uses: actions/checkout@v2 |  | ||||||
|         id: checkout-branch |  | ||||||
|  |  | ||||||
|       - name: Run Linter Checks |  | ||||||
|         id: linter-check |  | ||||||
|         uses: harshanarayana/custom-actions@main |  | ||||||
|         with: |  | ||||||
|           python-version: ${{ matrix.config.python-version }} |  | ||||||
|           test-infra-tool: tox |  | ||||||
|           test-infra-version: latest |  | ||||||
|           action: tests |  | ||||||
|           test-additional-args: "-e=${{ matrix.config.tox-env }}" |  | ||||||
							
								
								
									
										33
									
								
								.github/workflows/pr-docs.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										33
									
								
								.github/workflows/pr-docs.yml
									
									
									
									
										vendored
									
									
								
							| @@ -1,33 +0,0 @@ | |||||||
| name: Document Linter |  | ||||||
| on: |  | ||||||
|   pull_request: |  | ||||||
|     branches: |  | ||||||
|       - main |  | ||||||
|       - current-release |  | ||||||
|       - "*LTS" |  | ||||||
|     types: [opened, synchronize, reopened, ready_for_review] |  | ||||||
|  |  | ||||||
| jobs: |  | ||||||
|   docsLinter: |  | ||||||
|     if: github.event.pull_request.draft == false |  | ||||||
|     name: Lint Documentation |  | ||||||
|     runs-on: ubuntu-latest |  | ||||||
|     strategy: |  | ||||||
|       matrix: |  | ||||||
|         config: |  | ||||||
|           - {python-version: "3.10", tox-env: "docs"} |  | ||||||
|       fail-fast: false |  | ||||||
|  |  | ||||||
|  |  | ||||||
|     steps: |  | ||||||
|       - name: Checkout repository |  | ||||||
|         uses: actions/checkout@v2 |  | ||||||
|  |  | ||||||
|       - name: Run Document Linter |  | ||||||
|         uses: harshanarayana/custom-actions@main |  | ||||||
|         with: |  | ||||||
|           python-version: ${{ matrix.config.python-version }} |  | ||||||
|           test-infra-tool: tox |  | ||||||
|           test-infra-version: latest |  | ||||||
|           action: tests |  | ||||||
|           test-additional-args: "-e=${{ matrix.config.tox-env }}" |  | ||||||
							
								
								
									
										34
									
								
								.github/workflows/pr-linter.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										34
									
								
								.github/workflows/pr-linter.yml
									
									
									
									
										vendored
									
									
								
							| @@ -1,34 +0,0 @@ | |||||||
| name: Linter Checks |  | ||||||
| on: |  | ||||||
|   pull_request: |  | ||||||
|     branches: |  | ||||||
|       - main |  | ||||||
|       - current-release |  | ||||||
|       - "*LTS" |  | ||||||
|     types: [opened, synchronize, reopened, ready_for_review] |  | ||||||
|  |  | ||||||
| jobs: |  | ||||||
|   linter: |  | ||||||
|     if: github.event.pull_request.draft == false |  | ||||||
|     name: lint |  | ||||||
|     runs-on: ${{ matrix.os }} |  | ||||||
|     strategy: |  | ||||||
|       fail-fast: false |  | ||||||
|       matrix: |  | ||||||
|         os: [ubuntu-latest] |  | ||||||
|         config: |  | ||||||
|           - { python-version: "3.10", tox-env: lint} |  | ||||||
|     steps: |  | ||||||
|       - name: Checkout the repository |  | ||||||
|         uses: actions/checkout@v2 |  | ||||||
|         id: checkout-branch |  | ||||||
|  |  | ||||||
|       - name: Run Linter Checks |  | ||||||
|         id: linter-check |  | ||||||
|         uses: harshanarayana/custom-actions@main |  | ||||||
|         with: |  | ||||||
|           python-version: ${{ matrix.config.python-version }} |  | ||||||
|           test-infra-tool: tox |  | ||||||
|           test-infra-version: latest |  | ||||||
|           action: tests |  | ||||||
|           test-additional-args: "-e=${{ matrix.config.tox-env }}" |  | ||||||
							
								
								
									
										41
									
								
								.github/workflows/pr-python-pypy.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										41
									
								
								.github/workflows/pr-python-pypy.yml
									
									
									
									
										vendored
									
									
								
							| @@ -1,41 +0,0 @@ | |||||||
| name: Python PyPy Tests |  | ||||||
| on: |  | ||||||
|   workflow_dispatch: |  | ||||||
|     inputs: |  | ||||||
|       tox-env: |  | ||||||
|         description: "Tox Env to run on the PyPy Infra" |  | ||||||
|         required: false |  | ||||||
|         default: "pypy310" |  | ||||||
|       pypy-version: |  | ||||||
|         description: "Version of PyPy to use" |  | ||||||
|         required: false |  | ||||||
|         default: "pypy-3.10" |  | ||||||
| jobs: |  | ||||||
|   testPyPy: |  | ||||||
|     name: ut-${{ matrix.config.tox-env }}-${{ matrix.os }} |  | ||||||
|     runs-on: ${{ matrix.os }} |  | ||||||
|     strategy: |  | ||||||
|       fail-fast: false |  | ||||||
|       matrix: |  | ||||||
|         # os: [ubuntu-latest, macos-latest] |  | ||||||
|         os: [ubuntu-latest] |  | ||||||
|         config: |  | ||||||
|           - { |  | ||||||
|               python-version: "${{ github.event.inputs.pypy-version }}", |  | ||||||
|               tox-env: "${{ github.event.inputs.tox-env }}", |  | ||||||
|             } |  | ||||||
|     steps: |  | ||||||
|       - name: Checkout the Repository |  | ||||||
|         uses: actions/checkout@v2 |  | ||||||
|         id: checkout-branch |  | ||||||
|  |  | ||||||
|       - name: Run Unit Tests |  | ||||||
|         uses: harshanarayana/custom-actions@main |  | ||||||
|         with: |  | ||||||
|           python-version: ${{ matrix.config.python-version }} |  | ||||||
|           test-infra-tool: tox |  | ||||||
|           test-infra-version: latest |  | ||||||
|           action: tests |  | ||||||
|           test-additional-args: "-e=${{ matrix.config.tox-env }}" |  | ||||||
|           experimental-ignore-error: "true" |  | ||||||
|           command-timeout: "600000" |  | ||||||
							
								
								
									
										48
									
								
								.github/workflows/pr-python310.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										48
									
								
								.github/workflows/pr-python310.yml
									
									
									
									
										vendored
									
									
								
							| @@ -1,48 +0,0 @@ | |||||||
| name: Python 3.10 Tests |  | ||||||
| on: |  | ||||||
|   pull_request: |  | ||||||
|     branches: |  | ||||||
|       - main |  | ||||||
|       - current-release |  | ||||||
|       - "*LTS" |  | ||||||
|     types: [opened, synchronize, reopened, ready_for_review] |  | ||||||
|  |  | ||||||
| jobs: |  | ||||||
|   testPy310: |  | ||||||
|     if: github.event.pull_request.draft == false |  | ||||||
|     name: ut-${{ matrix.config.tox-env }}-${{ matrix.os }} |  | ||||||
|     runs-on: ${{ matrix.os }} |  | ||||||
|     strategy: |  | ||||||
|       fail-fast: false |  | ||||||
|       matrix: |  | ||||||
|         # os: [ubuntu-latest, macos-latest] |  | ||||||
|         os: [ubuntu-latest] |  | ||||||
|         config: |  | ||||||
|           - { |  | ||||||
|               python-version: "3.10", |  | ||||||
|               tox-env: py310, |  | ||||||
|               ignore-error-flake: "false", |  | ||||||
|               command-timeout: "0", |  | ||||||
|             } |  | ||||||
|           - { |  | ||||||
|               python-version: "3.10", |  | ||||||
|               tox-env: py310-no-ext, |  | ||||||
|               ignore-error-flake: "true", |  | ||||||
|               command-timeout: "600000", |  | ||||||
|             } |  | ||||||
|     steps: |  | ||||||
|       - name: Checkout the Repository |  | ||||||
|         uses: actions/checkout@v2 |  | ||||||
|         id: checkout-branch |  | ||||||
|  |  | ||||||
|       - name: Run Unit Tests |  | ||||||
|         uses: harshanarayana/custom-actions@main |  | ||||||
|         with: |  | ||||||
|           python-version: ${{ matrix.config.python-version }} |  | ||||||
|           test-infra-tool: tox |  | ||||||
|           test-infra-version: latest |  | ||||||
|           action: tests |  | ||||||
|           test-additional-args: "-e=${{ matrix.config.tox-env }},-vv=''" |  | ||||||
|           experimental-ignore-error: "${{ matrix.config.ignore-error-flake }}" |  | ||||||
|           command-timeout: "${{ matrix.config.command-timeout }}" |  | ||||||
|           test-failure-retry: "3" |  | ||||||
							
								
								
									
										48
									
								
								.github/workflows/pr-python311.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										48
									
								
								.github/workflows/pr-python311.yml
									
									
									
									
										vendored
									
									
								
							| @@ -1,48 +0,0 @@ | |||||||
| name: Python 3.11 Tests |  | ||||||
| on: |  | ||||||
|   pull_request: |  | ||||||
|     branches: |  | ||||||
|       - main |  | ||||||
|       - current-release |  | ||||||
|       - "*LTS" |  | ||||||
|     types: [opened, synchronize, reopened, ready_for_review] |  | ||||||
|  |  | ||||||
| jobs: |  | ||||||
|   testPy311: |  | ||||||
|     if: github.event.pull_request.draft == false |  | ||||||
|     name: ut-${{ matrix.config.tox-env }}-${{ matrix.os }} |  | ||||||
|     runs-on: ${{ matrix.os }} |  | ||||||
|     strategy: |  | ||||||
|       fail-fast: false |  | ||||||
|       matrix: |  | ||||||
|         # os: [ubuntu-latest, macos-latest] |  | ||||||
|         os: [ubuntu-latest] |  | ||||||
|         config: |  | ||||||
|           - { |  | ||||||
|               python-version: "3.11", |  | ||||||
|               tox-env: py311, |  | ||||||
|               ignore-error-flake: "false", |  | ||||||
|               command-timeout: "0", |  | ||||||
|             } |  | ||||||
|           - { |  | ||||||
|               python-version: "3.11", |  | ||||||
|               tox-env: py311-no-ext, |  | ||||||
|               ignore-error-flake: "true", |  | ||||||
|               command-timeout: "600000", |  | ||||||
|             } |  | ||||||
|     steps: |  | ||||||
|       - name: Checkout the Repository |  | ||||||
|         uses: actions/checkout@v2 |  | ||||||
|         id: checkout-branch |  | ||||||
|  |  | ||||||
|       - name: Run Unit Tests |  | ||||||
|         uses: harshanarayana/custom-actions@main |  | ||||||
|         with: |  | ||||||
|           python-version: ${{ matrix.config.python-version }} |  | ||||||
|           test-infra-tool: tox |  | ||||||
|           test-infra-version: latest |  | ||||||
|           action: tests |  | ||||||
|           test-additional-args: "-e=${{ matrix.config.tox-env }},-vv=''" |  | ||||||
|           experimental-ignore-error: "${{ matrix.config.ignore-error-flake }}" |  | ||||||
|           command-timeout: "${{ matrix.config.command-timeout }}" |  | ||||||
|           test-failure-retry: "3" |  | ||||||
							
								
								
									
										36
									
								
								.github/workflows/pr-python38.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										36
									
								
								.github/workflows/pr-python38.yml
									
									
									
									
										vendored
									
									
								
							| @@ -1,36 +0,0 @@ | |||||||
| name: Python 3.8 Tests |  | ||||||
| on: |  | ||||||
|   pull_request: |  | ||||||
|     branches: |  | ||||||
|       - main |  | ||||||
|       - current-release |  | ||||||
|       - "*LTS" |  | ||||||
|     types: [opened, synchronize, reopened, ready_for_review] |  | ||||||
|  |  | ||||||
| jobs: |  | ||||||
|   testPy38: |  | ||||||
|     if: github.event.pull_request.draft == false |  | ||||||
|     name: ut-${{ matrix.config.tox-env }}-${{ matrix.os }} |  | ||||||
|     runs-on: ${{ matrix.os }} |  | ||||||
|     strategy: |  | ||||||
|       fail-fast: true |  | ||||||
|       matrix: |  | ||||||
|         # os: [ubuntu-latest, macos-latest] |  | ||||||
|         os: [ubuntu-latest] |  | ||||||
|         config: |  | ||||||
|           - { python-version: 3.8, tox-env: py38 } |  | ||||||
|           - { python-version: 3.8, tox-env: py38-no-ext } |  | ||||||
|     steps: |  | ||||||
|       - name: Checkout the Repository |  | ||||||
|         uses: actions/checkout@v2 |  | ||||||
|         id: checkout-branch |  | ||||||
|  |  | ||||||
|       - name: Run Unit Tests |  | ||||||
|         uses: harshanarayana/custom-actions@main |  | ||||||
|         with: |  | ||||||
|           python-version: ${{ matrix.config.python-version }} |  | ||||||
|           test-infra-tool: tox |  | ||||||
|           test-infra-version: latest |  | ||||||
|           action: tests |  | ||||||
|           test-additional-args: "-e=${{ matrix.config.tox-env }}" |  | ||||||
|           test-failure-retry: "3" |  | ||||||
							
								
								
									
										48
									
								
								.github/workflows/pr-python39.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										48
									
								
								.github/workflows/pr-python39.yml
									
									
									
									
										vendored
									
									
								
							| @@ -1,48 +0,0 @@ | |||||||
| name: Python 3.9 Tests |  | ||||||
| on: |  | ||||||
|   pull_request: |  | ||||||
|     branches: |  | ||||||
|       - main |  | ||||||
|       - current-release |  | ||||||
|       - "*LTS" |  | ||||||
|     types: [opened, synchronize, reopened, ready_for_review] |  | ||||||
|  |  | ||||||
| jobs: |  | ||||||
|   testPy39: |  | ||||||
|     if: github.event.pull_request.draft == false |  | ||||||
|     name: ut-${{ matrix.config.tox-env }}-${{ matrix.os }} |  | ||||||
|     runs-on: ${{ matrix.os }} |  | ||||||
|     strategy: |  | ||||||
|       fail-fast: true |  | ||||||
|       matrix: |  | ||||||
|         # os: [ubuntu-latest, macos-latest] |  | ||||||
|         os: [ubuntu-latest] |  | ||||||
|         config: |  | ||||||
|           - { |  | ||||||
|               python-version: 3.9, |  | ||||||
|               tox-env: py39, |  | ||||||
|               ignore-error-flake: "false", |  | ||||||
|               command-timeout: "0", |  | ||||||
|             } |  | ||||||
|           - { |  | ||||||
|               python-version: 3.9, |  | ||||||
|               tox-env: py39-no-ext, |  | ||||||
|               ignore-error-flake: "true", |  | ||||||
|               command-timeout: "600000", |  | ||||||
|             } |  | ||||||
|     steps: |  | ||||||
|       - name: Checkout the Repository |  | ||||||
|         uses: actions/checkout@v2 |  | ||||||
|         id: checkout-branch |  | ||||||
|  |  | ||||||
|       - name: Run Unit Tests |  | ||||||
|         uses: harshanarayana/custom-actions@main |  | ||||||
|         with: |  | ||||||
|           python-version: ${{ matrix.config.python-version }} |  | ||||||
|           test-infra-tool: tox |  | ||||||
|           test-infra-version: latest |  | ||||||
|           action: tests |  | ||||||
|           test-additional-args: "-e=${{ matrix.config.tox-env }},-vv=''" |  | ||||||
|           experimental-ignore-error: "${{ matrix.config.ignore-error-flake }}" |  | ||||||
|           command-timeout: "${{ matrix.config.command-timeout }}" |  | ||||||
|           test-failure-retry: "3" |  | ||||||
							
								
								
									
										37
									
								
								.github/workflows/pr-type-check.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										37
									
								
								.github/workflows/pr-type-check.yml
									
									
									
									
										vendored
									
									
								
							| @@ -1,37 +0,0 @@ | |||||||
| name: Typing Checks |  | ||||||
| on: |  | ||||||
|   pull_request: |  | ||||||
|     branches: |  | ||||||
|       - main |  | ||||||
|       - current-release |  | ||||||
|       - "*LTS" |  | ||||||
|     types: [opened, synchronize, reopened, ready_for_review] |  | ||||||
|  |  | ||||||
| jobs: |  | ||||||
|   typeChecking: |  | ||||||
|     if: github.event.pull_request.draft == false |  | ||||||
|     name: type-check-${{ matrix.config.python-version }} |  | ||||||
|     runs-on: ${{ matrix.os }} |  | ||||||
|     strategy: |  | ||||||
|       fail-fast: false |  | ||||||
|       matrix: |  | ||||||
|         os: [ubuntu-latest] |  | ||||||
|         config: |  | ||||||
|           - { python-version: 3.8, tox-env: type-checking} |  | ||||||
|           - { python-version: 3.9, tox-env: type-checking} |  | ||||||
|           - { python-version: "3.10", tox-env: type-checking} |  | ||||||
|           - { python-version: "3.11", tox-env: type-checking} |  | ||||||
|     steps: |  | ||||||
|       - name: Checkout the repository |  | ||||||
|         uses: actions/checkout@v2 |  | ||||||
|         id: checkout-branch |  | ||||||
|  |  | ||||||
|       - name: Run Linter Checks |  | ||||||
|         id: linter-check |  | ||||||
|         uses: harshanarayana/custom-actions@main |  | ||||||
|         with: |  | ||||||
|           python-version: ${{ matrix.config.python-version }} |  | ||||||
|           test-infra-tool: tox |  | ||||||
|           test-infra-version: latest |  | ||||||
|           action: tests |  | ||||||
|           test-additional-args: "-e=${{ matrix.config.tox-env }}" |  | ||||||
							
								
								
									
										38
									
								
								.github/workflows/pr-windows.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										38
									
								
								.github/workflows/pr-windows.yml
									
									
									
									
										vendored
									
									
								
							| @@ -1,38 +0,0 @@ | |||||||
| name: Run Unit Tests on Windows |  | ||||||
| on: |  | ||||||
|   pull_request: |  | ||||||
|     branches: |  | ||||||
|       - main |  | ||||||
|       - current-release |  | ||||||
|       - "*LTS" |  | ||||||
|     types: [opened, synchronize, reopened, ready_for_review] |  | ||||||
|  |  | ||||||
| jobs: |  | ||||||
|   testsOnWindows: |  | ||||||
|     if: github.event.pull_request.draft == false |  | ||||||
|     name: ut-${{ matrix.config.tox-env }} |  | ||||||
|     runs-on: windows-latest |  | ||||||
|     strategy: |  | ||||||
|       fail-fast: false |  | ||||||
|       matrix: |  | ||||||
|         config: |  | ||||||
|           - { python-version: 3.8, tox-env: py38-no-ext } |  | ||||||
|           - { python-version: 3.9, tox-env: py39-no-ext } |  | ||||||
|           - { python-version: "3.10", tox-env: py310-no-ext } |  | ||||||
|           - { python-version: "3.11", tox-env: py310-no-ext } |  | ||||||
|  |  | ||||||
|     steps: |  | ||||||
|       - name: Checkout Repository |  | ||||||
|         uses: actions/checkout@v2 |  | ||||||
|  |  | ||||||
|       - name: Run Unit Tests |  | ||||||
|         uses: ahopkins/custom-actions@pip-extra-args |  | ||||||
|         with: |  | ||||||
|           python-version: ${{ matrix.config.python-version }} |  | ||||||
|           test-infra-tool: tox |  | ||||||
|           test-infra-version: latest |  | ||||||
|           action: tests |  | ||||||
|           test-additional-args: "-e=${{ matrix.config.tox-env }}" |  | ||||||
|           experimental-ignore-error: "true" |  | ||||||
|           command-timeout: "600000" |  | ||||||
|           pip-extra-args: "--user" |  | ||||||
							
								
								
									
										48
									
								
								.github/workflows/publish-images.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										48
									
								
								.github/workflows/publish-images.yml
									
									
									
									
										vendored
									
									
								
							| @@ -1,48 +0,0 @@ | |||||||
| name: Publish Docker Images |  | ||||||
| on: |  | ||||||
|   workflow_run: |  | ||||||
|     workflows: |  | ||||||
|       - 'Publish Artifacts' |  | ||||||
|     types: |  | ||||||
|       - completed |  | ||||||
|  |  | ||||||
| jobs: |  | ||||||
|   publishDockerImages: |  | ||||||
|     name: Docker Image Build [${{ matrix.python-version }}] |  | ||||||
|     runs-on: ubuntu-latest |  | ||||||
|  |  | ||||||
|     strategy: |  | ||||||
|       fail-fast: true |  | ||||||
|       matrix: |  | ||||||
|         python-version: ["3.8", "3.9", "3.10", "3.11"] |  | ||||||
|  |  | ||||||
|     steps: |  | ||||||
|       - name: Checkout repository |  | ||||||
|         uses: actions/checkout@v2 |  | ||||||
|  |  | ||||||
|       - name: Build Latest Base images for ${{ matrix.python-version }} |  | ||||||
|         uses: harshanarayana/custom-actions@main |  | ||||||
|         with: |  | ||||||
|           docker-image-base-name: sanicframework/sanic-build |  | ||||||
|           ignore-python-setup: 'true' |  | ||||||
|           dockerfile-base-dir: './docker' |  | ||||||
|           action: 'image-publish' |  | ||||||
|           docker-image-tag: "${{ matrix.python-version }}" |  | ||||||
|           docker-file-suffix: "base" |  | ||||||
|           docker-build-args: "PYTHON_VERSION=${{ matrix.python-version }}" |  | ||||||
|           registry-auth-user: ${{ secrets.DOCKER_ACCESS_USER }} |  | ||||||
|           registry-auth-password: ${{ secrets.DOCKER_ACCESS_TOKEN }} |  | ||||||
|           push-images: 'true' |  | ||||||
|  |  | ||||||
|       - name: Publish Sanic Docker Image for ${{ matrix.python-version }} |  | ||||||
|         uses: harshanarayana/custom-actions@main |  | ||||||
|         with: |  | ||||||
|           docker-image-base-name: sanicframework/sanic |  | ||||||
|           ignore-python-setup: 'true' |  | ||||||
|           dockerfile-base-dir: './docker' |  | ||||||
|           action: 'image-publish' |  | ||||||
|           docker-build-args: "BASE_IMAGE_TAG=${{ matrix.python-version }}" |  | ||||||
|           docker-image-prefix: "${{ matrix.python-version }}" |  | ||||||
|           registry-auth-user: ${{ secrets.DOCKER_ACCESS_USER }} |  | ||||||
|           registry-auth-password: ${{ secrets.DOCKER_ACCESS_TOKEN }} |  | ||||||
|           push-images: 'true' |  | ||||||
							
								
								
									
										39
									
								
								.github/workflows/publish-package.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										39
									
								
								.github/workflows/publish-package.yml
									
									
									
									
										vendored
									
									
								
							| @@ -1,39 +0,0 @@ | |||||||
| name: Upload Python Package |  | ||||||
|  |  | ||||||
| on: |  | ||||||
|   release: |  | ||||||
|     types: [created] |  | ||||||
|   workflow_dispatch: |  | ||||||
| jobs: |  | ||||||
|   build-n-publish: |  | ||||||
|     name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI |  | ||||||
|     runs-on: ubuntu-latest |  | ||||||
|     steps: |  | ||||||
|     - uses: actions/checkout@v3 |  | ||||||
|     - name: Set up Python |  | ||||||
|       uses: actions/setup-python@v4 |  | ||||||
|       with: |  | ||||||
|         python-version: "3.x" |  | ||||||
|     - name: Install pypa/build |  | ||||||
|       run: >- |  | ||||||
|         python3 -m |  | ||||||
|         pip install |  | ||||||
|         build |  | ||||||
|         --user |  | ||||||
|     - name: Build a binary wheel and a source tarball |  | ||||||
|       run: >- |  | ||||||
|         python3 -m |  | ||||||
|         build |  | ||||||
|         --sdist |  | ||||||
|         --wheel |  | ||||||
|         --outdir dist/ |  | ||||||
|         . |  | ||||||
|     # - name: Publish distribution 📦 to Test PyPI |  | ||||||
|     #   uses: pypa/gh-action-pypi-publish@release/v1 |  | ||||||
|     #   with: |  | ||||||
|     #     password: ${{ secrets.SANIC_TEST_PYPI_API_TOKEN }} |  | ||||||
|     #     repository-url: https://test.pypi.org/legacy/ |  | ||||||
|     - name: Publish distribution 📦 to PyPI |  | ||||||
|       uses: pypa/gh-action-pypi-publish@release/v1 |  | ||||||
|       with: |  | ||||||
|         password: ${{ secrets.SANIC_PYPI_API_TOKEN }} |  | ||||||
							
								
								
									
										174
									
								
								.github/workflows/publish-release.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										174
									
								
								.github/workflows/publish-release.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,174 @@ | |||||||
|  | name: Publish release | ||||||
|  |  | ||||||
|  | on: | ||||||
|  |   release: | ||||||
|  |     types: [created] | ||||||
|  |  | ||||||
|  | env: | ||||||
|  |   IS_TEST: false | ||||||
|  |   DOCKER_ORG_NAME: sanicframework | ||||||
|  |   DOCKER_IMAGE_NAME: sanic | ||||||
|  |   DOCKER_BASE_IMAGE_NAME: sanic-build | ||||||
|  |   DOCKER_IMAGE_DOCKERFILE: ./docker/Dockerfile | ||||||
|  |   DOCKER_BASE_IMAGE_DOCKERFILE: ./docker/Dockerfile-base | ||||||
|  |  | ||||||
|  | jobs: | ||||||
|  |   generate_info: | ||||||
|  |     name: Generate info | ||||||
|  |     runs-on: ubuntu-latest | ||||||
|  |     outputs: | ||||||
|  |       docker-tags: ${{ steps.generate_docker_info.outputs.tags }} | ||||||
|  |       pypi-version: ${{ steps.parse_version_tag.outputs.pypi-version }} | ||||||
|  |     steps: | ||||||
|  |       - name: Parse version tag | ||||||
|  |         id: parse_version_tag | ||||||
|  |         env: | ||||||
|  |           TAG_NAME: ${{ github.event.release.tag_name }} | ||||||
|  |         run: | | ||||||
|  |           tag_name="${{ env.TAG_NAME }}" | ||||||
|  |  | ||||||
|  |           if [[ ! "${tag_name}" =~ ^v([0-9]{2})\.([0-9]{1,2})\.([0-9]+)$ ]]; then | ||||||
|  |             echo "::error::Tag name must be in the format vYY.MM.MICRO" | ||||||
|  |             exit 1 | ||||||
|  |           fi | ||||||
|  |  | ||||||
|  |           year_output="year=${BASH_REMATCH[1]}" | ||||||
|  |           month_output="month=${BASH_REMATCH[2]}" | ||||||
|  |           pypi_output="pypi-version=${tag_name#v}" | ||||||
|  |  | ||||||
|  |           echo "${year_output}" | ||||||
|  |           echo "${month_output}" | ||||||
|  |           echo "${pypi_output}" | ||||||
|  |  | ||||||
|  |           echo "${year_output}" >> $GITHUB_OUTPUT | ||||||
|  |           echo "${month_output}" >> $GITHUB_OUTPUT | ||||||
|  |           echo "${pypi_output}" >> $GITHUB_OUTPUT | ||||||
|  |  | ||||||
|  |       - name: Get latest release | ||||||
|  |         id: get_latest_release | ||||||
|  |         run: | | ||||||
|  |           latest_tag=$( | ||||||
|  |             curl -L \ | ||||||
|  |               -H "Accept: application/vnd.github+json" \ | ||||||
|  |               -H "Authorization: Bearer ${{ github.token }}" \ | ||||||
|  |               -H "X-GitHub-Api-Version: 2022-11-28" \ | ||||||
|  |               https://api.github.com/repos/${{ github.repository }}/releases/latest \ | ||||||
|  |               | jq -r '.tag_name' | ||||||
|  |           ) | ||||||
|  |           echo "latest_tag=$latest_tag" >> $GITHUB_OUTPUT | ||||||
|  |  | ||||||
|  |       - name: Generate Docker info | ||||||
|  |         id: generate_docker_info | ||||||
|  |         run: | | ||||||
|  |           tag_year="${{ steps.parse_version_tag.outputs.year }}" | ||||||
|  |           tag_month="${{ steps.parse_version_tag.outputs.month }}" | ||||||
|  |           latest_tag="${{ steps.get_latest_release.outputs.latest_tag }}" | ||||||
|  |           tag="${{ github.event.release.tag_name }}" | ||||||
|  |  | ||||||
|  |           tags="${tag_year}.${tag_month}" | ||||||
|  |  | ||||||
|  |           if [[ "${tag_month}" == "12" ]]; then | ||||||
|  |             tags+=",LTS" | ||||||
|  |             echo "::notice::Tag ${tag} is LTS version" | ||||||
|  |           else | ||||||
|  |             echo "::notice::Tag ${tag} is not LTS version" | ||||||
|  |           fi | ||||||
|  |  | ||||||
|  |           if [[ "${latest_tag}" == "${{ github.event.release.tag_name }}" ]]; then | ||||||
|  |             tags+=",latest" | ||||||
|  |             echo "::notice::Tag ${tag} is marked as latest" | ||||||
|  |           else | ||||||
|  |             echo "::notice::Tag ${tag} is not marked as latest" | ||||||
|  |           fi | ||||||
|  |  | ||||||
|  |           tags_output="tags=${tags}" | ||||||
|  |  | ||||||
|  |           echo "${tags_output}" | ||||||
|  |           echo "${tags_output}" >> $GITHUB_OUTPUT | ||||||
|  |  | ||||||
|  |   publish_package: | ||||||
|  |     name: Build and publish package | ||||||
|  |     runs-on: ubuntu-latest | ||||||
|  |     needs: generate_info | ||||||
|  |     steps: | ||||||
|  |     - name: Checkout repo | ||||||
|  |       uses: actions/checkout@v3 | ||||||
|  |  | ||||||
|  |     - name: Setup Python | ||||||
|  |       uses: actions/setup-python@v4 | ||||||
|  |       with: | ||||||
|  |         python-version: "3.11" | ||||||
|  |  | ||||||
|  |     - name: Install dependencies | ||||||
|  |       run: pip install build twine | ||||||
|  |  | ||||||
|  |     - name: Update package version | ||||||
|  |       run: | | ||||||
|  |         echo "__version__ = \"${{ needs.generate_info.outputs.pypi-version }}\"" > sanic/__version__.py | ||||||
|  |  | ||||||
|  |     - name: Build a binary wheel and a source tarball | ||||||
|  |       run: python -m build --sdist --wheel --outdir dist/ . | ||||||
|  |  | ||||||
|  |     - name: Publish to PyPi 🚀 | ||||||
|  |       run: twine upload --non-interactive --disable-progress-bar dist/* | ||||||
|  |       env: | ||||||
|  |         TWINE_USERNAME: __token__ | ||||||
|  |         TWINE_PASSWORD: ${{ env.IS_TEST == 'true' && secrets.SANIC_TEST_PYPI_API_TOKEN || secrets.SANIC_PYPI_API_TOKEN }} | ||||||
|  |         TWINE_REPOSITORY: ${{ env.IS_TEST == 'true' && 'testpypi' || 'pypi' }} | ||||||
|  |  | ||||||
|  |   publish_docker: | ||||||
|  |     name: Publish Docker / Python ${{ matrix.python-version }} | ||||||
|  |     needs: [generate_info, publish_package] | ||||||
|  |     runs-on: ubuntu-latest | ||||||
|  |     strategy: | ||||||
|  |       fail-fast: true | ||||||
|  |       matrix: | ||||||
|  |         python-version: ["3.10", "3.11"] | ||||||
|  |     steps: | ||||||
|  |       - name: Checkout repository | ||||||
|  |         uses: actions/checkout@v3 | ||||||
|  |  | ||||||
|  |       - name: Set up Docker Buildx | ||||||
|  |         uses: docker/setup-buildx-action@v2 | ||||||
|  |  | ||||||
|  |       - name: Login to Docker Hub | ||||||
|  |         uses: docker/login-action@v2 | ||||||
|  |         with: | ||||||
|  |           username: ${{ secrets.DOCKER_ACCESS_USER }} | ||||||
|  |           password: ${{ secrets.DOCKER_ACCESS_TOKEN }} | ||||||
|  |  | ||||||
|  |       - name: Build and push base image | ||||||
|  |         uses: docker/build-push-action@v4 | ||||||
|  |         with: | ||||||
|  |           push: ${{ env.IS_TEST == 'false' }} | ||||||
|  |           file: ${{ env.DOCKER_BASE_IMAGE_DOCKERFILE }} | ||||||
|  |           tags: ${{ env.DOCKER_ORG_NAME }}/${{ env.DOCKER_BASE_IMAGE_NAME }}:${{ matrix.python-version }} | ||||||
|  |           build-args: | | ||||||
|  |             PYTHON_VERSION=${{ matrix.python-version }} | ||||||
|  |  | ||||||
|  |       - name: Parse tags for this Python version | ||||||
|  |         id: parse_tags | ||||||
|  |         run: | | ||||||
|  |           IFS=',' read -ra tags <<< "${{ needs.generate_info.outputs.docker-tags }}" | ||||||
|  |           tag_args="" | ||||||
|  |  | ||||||
|  |           for tag in "${tags[@]}"; do | ||||||
|  |               tag_args+=",${{ env.DOCKER_ORG_NAME }}/${{ env.DOCKER_IMAGE_NAME }}:${tag}-py${{ matrix.python-version }}" | ||||||
|  |           done | ||||||
|  |  | ||||||
|  |           tag_args_output="tag_args=${tag_args:1}" | ||||||
|  |  | ||||||
|  |           echo "${tag_args_output}" | ||||||
|  |           echo "${tag_args_output}" >> $GITHUB_OUTPUT | ||||||
|  |  | ||||||
|  |       - name: Build and push Sanic image | ||||||
|  |         uses: docker/build-push-action@v4 | ||||||
|  |         with: | ||||||
|  |           push: ${{ env.IS_TEST == 'false' }} | ||||||
|  |           file: ${{ env.DOCKER_IMAGE_DOCKERFILE }} | ||||||
|  |           tags: ${{ steps.parse_tags.outputs.tag_args }} | ||||||
|  |           build-args: | | ||||||
|  |             BASE_IMAGE_ORG=${{ env.DOCKER_ORG_NAME }} | ||||||
|  |             BASE_IMAGE_NAME=${{ env.DOCKER_BASE_IMAGE_NAME }} | ||||||
|  |             BASE_IMAGE_TAG=${{ matrix.python-version }} | ||||||
|  |             SANIC_PYPI_VERSION=${{ needs.generate_info.outputs.pypi-version }} | ||||||
							
								
								
									
										56
									
								
								.github/workflows/tests.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										56
									
								
								.github/workflows/tests.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,56 @@ | |||||||
|  | name: Tests | ||||||
|  |  | ||||||
|  | on: | ||||||
|  |   push: | ||||||
|  |     branches: | ||||||
|  |       - main | ||||||
|  |       - current-release | ||||||
|  |       - "*LTS" | ||||||
|  |     tags: | ||||||
|  |       - "!*" | ||||||
|  |   pull_request: | ||||||
|  |     branches: | ||||||
|  |       - main | ||||||
|  |       - current-release | ||||||
|  |       - "*LTS" | ||||||
|  |     types: [opened, synchronize, reopened, ready_for_review] | ||||||
|  |  | ||||||
|  | jobs: | ||||||
|  |   run_tests: | ||||||
|  |     name: "${{ matrix.config.platform == 'windows-latest' && 'Windows' || 'Linux' }} / Python ${{ matrix.config.python-version }} / tox -e ${{ matrix.config.tox-env }}" | ||||||
|  |     if: github.event.pull_request.draft == false | ||||||
|  |     runs-on: ${{ matrix.config.platform || 'ubuntu-latest' }} | ||||||
|  |     strategy: | ||||||
|  |       fail-fast: true | ||||||
|  |       matrix: | ||||||
|  |         config: | ||||||
|  |           - { python-version: "3.8",  tox-env: security } | ||||||
|  |           - { python-version: "3.9",  tox-env: security } | ||||||
|  |           - { python-version: "3.10", tox-env: security } | ||||||
|  |           - { python-version: "3.11", tox-env: security } | ||||||
|  |           - { python-version: "3.10", tox-env: lint } | ||||||
|  |           - { python-version: "3.10", tox-env: docs } | ||||||
|  |           - { python-version: "3.8",  tox-env: type-checking } | ||||||
|  |           - { python-version: "3.9",  tox-env: type-checking } | ||||||
|  |           - { python-version: "3.10", tox-env: type-checking } | ||||||
|  |           - { python-version: "3.11", tox-env: type-checking } | ||||||
|  |           - { python-version: "3.8",  tox-env: py38,          max-attempts: 3 } | ||||||
|  |           - { python-version: "3.8",  tox-env: py38-no-ext,   max-attempts: 3 } | ||||||
|  |           - { python-version: "3.9",  tox-env: py39,          max-attempts: 3 } | ||||||
|  |           - { python-version: "3.9",  tox-env: py39-no-ext,   max-attempts: 3 } | ||||||
|  |           - { python-version: "3.10", tox-env: py310,         max-attempts: 3 } | ||||||
|  |           - { python-version: "3.10", tox-env: py310-no-ext,  max-attempts: 3 } | ||||||
|  |           - { python-version: "3.11", tox-env: py311,         max-attempts: 3 } | ||||||
|  |           - { python-version: "3.11", tox-env: py311-no-ext,  max-attempts: 3 } | ||||||
|  |           - { python-version: "3.8",  tox-env: py38-no-ext,   platform: windows-latest, ignore-errors: true } | ||||||
|  |           - { python-version: "3.9",  tox-env: py39-no-ext,   platform: windows-latest, ignore-errors: true } | ||||||
|  |           - { python-version: "3.10", tox-env: py310-no-ext,  platform: windows-latest, ignore-errors: true } | ||||||
|  |           - { python-version: "3.11", tox-env: py310-no-ext,  platform: windows-latest, ignore-errors: true } | ||||||
|  |     steps: | ||||||
|  |       - name: Run tests | ||||||
|  |         uses: sanic-org/simple-tox-action@v1 | ||||||
|  |         with: | ||||||
|  |           python-version: ${{ matrix.config.python-version }} | ||||||
|  |           tox-env: ${{ matrix.config.tox-env }} | ||||||
|  |           max-attempts: ${{ matrix.config.max-attempts || 1 }} | ||||||
|  |           ignore-errors: ${{ matrix.config.ignore-errors || false }} | ||||||
							
								
								
									
										35
									
								
								README.rst
									
									
									
									
									
								
							
							
						
						
									
										35
									
								
								README.rst
									
									
									
									
									
								
							| @@ -11,7 +11,7 @@ Sanic | Build fast. Run fast. | |||||||
|     :stub-columns: 1 |     :stub-columns: 1 | ||||||
|  |  | ||||||
|     * - Build |     * - Build | ||||||
|       - | |Py310Test| |Py39Test| |Py38Test| |Py37Test| |       - | |Tests| | ||||||
|     * - Docs |     * - Docs | ||||||
|       - | |UserGuide| |Documentation| |       - | |UserGuide| |Documentation| | ||||||
|     * - Package |     * - Package | ||||||
| @@ -19,7 +19,7 @@ Sanic | Build fast. Run fast. | |||||||
|     * - Support |     * - Support | ||||||
|       - | |Forums| |Discord| |Awesome| |       - | |Forums| |Discord| |Awesome| | ||||||
|     * - Stats |     * - Stats | ||||||
|       - | |Downloads| |WkDownloads| |Conda downloads| |       - | |Monthly Downloads| |Weekly Downloads| |Conda downloads| | ||||||
|  |  | ||||||
| .. |UserGuide| image:: https://img.shields.io/badge/user%20guide-sanic-ff0068 | .. |UserGuide| image:: https://img.shields.io/badge/user%20guide-sanic-ff0068 | ||||||
|    :target: https://sanicframework.org/ |    :target: https://sanicframework.org/ | ||||||
| @@ -27,14 +27,8 @@ Sanic | Build fast. Run fast. | |||||||
|    :target: https://community.sanicframework.org/ |    :target: https://community.sanicframework.org/ | ||||||
| .. |Discord| image:: https://img.shields.io/discord/812221182594121728?logo=discord | .. |Discord| image:: https://img.shields.io/discord/812221182594121728?logo=discord | ||||||
|    :target: https://discord.gg/FARQzAEMAA |    :target: https://discord.gg/FARQzAEMAA | ||||||
| .. |Py310Test| image:: https://github.com/sanic-org/sanic/actions/workflows/pr-python310.yml/badge.svg?branch=main | .. |Tests| image:: https://github.com/sanic-org/sanic/actions/workflows/tests.yml/badge.svg?branch=main | ||||||
|    :target: https://github.com/sanic-org/sanic/actions/workflows/pr-python310.yml |    :target: https://github.com/sanic-org/sanic/actions/workflows/tests.yml | ||||||
| .. |Py39Test| image:: https://github.com/sanic-org/sanic/actions/workflows/pr-python39.yml/badge.svg?branch=main |  | ||||||
|    :target: https://github.com/sanic-org/sanic/actions/workflows/pr-python39.yml |  | ||||||
| .. |Py38Test| image:: https://github.com/sanic-org/sanic/actions/workflows/pr-python38.yml/badge.svg?branch=main |  | ||||||
|    :target: https://github.com/sanic-org/sanic/actions/workflows/pr-python38.yml |  | ||||||
| .. |Py37Test| image:: https://github.com/sanic-org/sanic/actions/workflows/pr-python37.yml/badge.svg?branch=main |  | ||||||
|    :target: https://github.com/sanic-org/sanic/actions/workflows/pr-python37.yml |  | ||||||
| .. |Documentation| image:: https://readthedocs.org/projects/sanic/badge/?version=latest | .. |Documentation| image:: https://readthedocs.org/projects/sanic/badge/?version=latest | ||||||
|    :target: http://sanic.readthedocs.io/en/latest/?badge=latest |    :target: http://sanic.readthedocs.io/en/latest/?badge=latest | ||||||
| .. |PyPI| image:: https://img.shields.io/pypi/v/sanic.svg | .. |PyPI| image:: https://img.shields.io/pypi/v/sanic.svg | ||||||
| @@ -52,19 +46,23 @@ Sanic | Build fast. Run fast. | |||||||
| .. |Awesome| image:: https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg | .. |Awesome| image:: https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg | ||||||
|     :alt: Awesome Sanic List |     :alt: Awesome Sanic List | ||||||
|     :target: https://github.com/mekicha/awesome-sanic |     :target: https://github.com/mekicha/awesome-sanic | ||||||
| .. |Downloads| image:: https://pepy.tech/badge/sanic/month | .. |Monthly Downloads| image:: https://img.shields.io/pypi/dm/sanic.svg | ||||||
|     :alt: Downloads |     :alt: Downloads | ||||||
|     :target: https://pepy.tech/project/sanic |     :target: https://pepy.tech/project/sanic | ||||||
| .. |WkDownloads| image:: https://pepy.tech/badge/sanic/week | .. |Weekly Downloads| image:: https://img.shields.io/pypi/dw/sanic.svg | ||||||
|     :alt: Downloads |     :alt: Downloads | ||||||
|     :target: https://pepy.tech/project/sanic |     :target: https://pepy.tech/project/sanic | ||||||
| .. |Conda downloads| image:: https://img.shields.io/conda/dn/conda-forge/sanic.svg | .. |Conda downloads| image:: https://img.shields.io/conda/dn/conda-forge/sanic.svg | ||||||
|     :alt: Downloads |     :alt: Downloads | ||||||
|     :target: https://anaconda.org/conda-forge/sanic |     :target: https://anaconda.org/conda-forge/sanic | ||||||
|  | .. |Linode| image:: https://www.linode.com/wp-content/uploads/2021/01/Linode-Logo-Black.svg | ||||||
|  |     :alt: Linode | ||||||
|  |     :target: https://www.linode.com | ||||||
|  |     :width: 200px | ||||||
|  |  | ||||||
| .. end-badges | .. end-badges | ||||||
|  |  | ||||||
| Sanic is a **Python 3.7+** web server and web framework that's written to go fast. It allows the usage of the ``async/await`` syntax added in Python 3.5, which makes your code non-blocking and speedy. | Sanic is a **Python 3.8+** web server and web framework that's written to go fast. It allows the usage of the ``async/await`` syntax added in Python 3.5, which makes your code non-blocking and speedy. | ||||||
|  |  | ||||||
| Sanic is also ASGI compliant, so you can deploy it with an `alternative ASGI webserver <https://sanicframework.org/en/guide/deployment/running.html#asgi>`_. | Sanic is also ASGI compliant, so you can deploy it with an `alternative ASGI webserver <https://sanicframework.org/en/guide/deployment/running.html#asgi>`_. | ||||||
|  |  | ||||||
| @@ -141,17 +139,17 @@ And, we can verify it is working: ``curl localhost:8000 -i`` | |||||||
|  |  | ||||||
| **Now, let's go build something fast!** | **Now, let's go build something fast!** | ||||||
|  |  | ||||||
| Minimum Python version is 3.7. If you need Python 3.6 support, please use v20.12LTS. | Minimum Python version is 3.8. If you need Python 3.7 support, please use v22.12LTS. | ||||||
|  |  | ||||||
| Documentation | Documentation | ||||||
| ------------- | ------------- | ||||||
|  |  | ||||||
| `User Guide <https://sanicframework.org>`__ and `API Documentation <http://sanic.readthedocs.io/>`__. | `User Guide <https://sanic.dev>`__ and `API Documentation <http://sanic.readthedocs.io/>`__. | ||||||
|  |  | ||||||
| Changelog | Changelog | ||||||
| --------- | --------- | ||||||
|  |  | ||||||
| `Release Changelogs <https://github.com/sanic-org/sanic/blob/master/CHANGELOG.rst>`__. | `Release Changelogs <https://sanic.readthedocs.io/en/stable/sanic/changelog.html>`__. | ||||||
|  |  | ||||||
|  |  | ||||||
| Questions and Discussion | Questions and Discussion | ||||||
| @@ -163,8 +161,3 @@ Contribution | |||||||
| ------------ | ------------ | ||||||
|  |  | ||||||
| We are always happy to have new contributions. We have `marked issues good for anyone looking to get started <https://github.com/sanic-org/sanic/issues?q=is%3Aopen+is%3Aissue+label%3Abeginner>`_, and welcome `questions on the forums <https://community.sanicframework.org/>`_. Please take a look at our `Contribution guidelines <https://github.com/sanic-org/sanic/blob/master/CONTRIBUTING.rst>`_. | We are always happy to have new contributions. We have `marked issues good for anyone looking to get started <https://github.com/sanic-org/sanic/issues?q=is%3Aopen+is%3Aissue+label%3Abeginner>`_, and welcome `questions on the forums <https://community.sanicframework.org/>`_. Please take a look at our `Contribution guidelines <https://github.com/sanic-org/sanic/blob/master/CONTRIBUTING.rst>`_. | ||||||
|  |  | ||||||
| .. |Linode| image:: https://www.linode.com/wp-content/uploads/2021/01/Linode-Logo-Black.svg |  | ||||||
|     :alt: Linode |  | ||||||
|     :target: https://www.linode.com |  | ||||||
|     :width: 200px |  | ||||||
|   | |||||||
| @@ -1,9 +1,13 @@ | |||||||
|  | ARG BASE_IMAGE_ORG | ||||||
|  | ARG BASE_IMAGE_NAME | ||||||
| ARG BASE_IMAGE_TAG | ARG BASE_IMAGE_TAG | ||||||
|  |  | ||||||
| FROM sanicframework/sanic-build:${BASE_IMAGE_TAG} | FROM ${BASE_IMAGE_ORG}/${BASE_IMAGE_NAME}:${BASE_IMAGE_TAG} | ||||||
|  |  | ||||||
| RUN apk update | RUN apk update | ||||||
| RUN update-ca-certificates | RUN update-ca-certificates | ||||||
|  |  | ||||||
| RUN pip install sanic | ARG SANIC_PYPI_VERSION | ||||||
|  |  | ||||||
|  | RUN pip install -U pip && pip install sanic==${SANIC_PYPI_VERSION} | ||||||
| RUN apk del build-base | RUN apk del build-base | ||||||
|   | |||||||
| @@ -73,14 +73,6 @@ class MOTDTTY(MOTD): | |||||||
|             self.value_width = min( |             self.value_width = min( | ||||||
|                 max(map(len, self.data.values())), self.max_value_width |                 max(map(len, self.data.values())), self.max_value_width | ||||||
|             ) |             ) | ||||||
|         if self.extra: |  | ||||||
|             self.key_width = max( |  | ||||||
|                 self.key_width, max(map(len, self.extra.keys())) |  | ||||||
|             ) |  | ||||||
|             self.value_width = min( |  | ||||||
|                 max((*map(len, self.extra.values()), self.value_width)), |  | ||||||
|                 self.max_value_width, |  | ||||||
|             ) |  | ||||||
|         self.logo_lines = self.logo.split("\n") if self.logo else [] |         self.logo_lines = self.logo.split("\n") if self.logo else [] | ||||||
|         self.logo_line_length = 24 |         self.logo_line_length = 24 | ||||||
|         self.centering_length = ( |         self.centering_length = ( | ||||||
| @@ -112,7 +104,7 @@ class MOTDTTY(MOTD): | |||||||
|         self._render_data(lines, self.data, 0) |         self._render_data(lines, self.data, 0) | ||||||
|         if self.extra: |         if self.extra: | ||||||
|             logo_part = self._get_logo_part(len(lines) - 4) |             logo_part = self._get_logo_part(len(lines) - 4) | ||||||
|             lines.append(f"│ {logo_part} ├{display_filler}┤") |             lines.append(f"| {logo_part} ├{display_filler}┤") | ||||||
|             self._render_data(lines, self.extra, len(lines) - 4) |             self._render_data(lines, self.extra, len(lines) - 4) | ||||||
|  |  | ||||||
|         self._render_fill(lines) |         self._render_fill(lines) | ||||||
|   | |||||||
| @@ -90,7 +90,6 @@ else:  # no cov | |||||||
| class StartupMixin(metaclass=SanicMeta): | class StartupMixin(metaclass=SanicMeta): | ||||||
|     _app_registry: ClassVar[Dict[str, Sanic]] |     _app_registry: ClassVar[Dict[str, Sanic]] | ||||||
|  |  | ||||||
|     name: str |  | ||||||
|     config: Config |     config: Config | ||||||
|     listeners: Dict[str, List[ListenerType[Any]]] |     listeners: Dict[str, List[ListenerType[Any]]] | ||||||
|     state: ApplicationState |     state: ApplicationState | ||||||
| @@ -606,7 +605,6 @@ class StartupMixin(metaclass=SanicMeta): | |||||||
|             server = "ASGI" if self.asgi else "unknown"  # type: ignore |             server = "ASGI" if self.asgi else "unknown"  # type: ignore | ||||||
|  |  | ||||||
|         display = { |         display = { | ||||||
|             "app": self.name, |  | ||||||
|             "mode": " ".join(mode), |             "mode": " ".join(mode), | ||||||
|             "server": server, |             "server": server, | ||||||
|             "python": platform.python_version(), |             "python": platform.python_version(), | ||||||
| @@ -659,10 +657,9 @@ class StartupMixin(metaclass=SanicMeta): | |||||||
|     def get_server_location( |     def get_server_location( | ||||||
|         server_settings: Optional[Dict[str, Any]] = None |         server_settings: Optional[Dict[str, Any]] = None | ||||||
|     ) -> str: |     ) -> str: | ||||||
|         serve_location = "" |  | ||||||
|         proto = "http" |         proto = "http" | ||||||
|         if not server_settings: |         if not server_settings: | ||||||
|             return serve_location |             return "" | ||||||
|  |  | ||||||
|         host = server_settings["host"] |         host = server_settings["host"] | ||||||
|         port = server_settings["port"] |         port = server_settings["port"] | ||||||
| @@ -670,16 +667,33 @@ class StartupMixin(metaclass=SanicMeta): | |||||||
|         if server_settings.get("ssl") is not None: |         if server_settings.get("ssl") is not None: | ||||||
|             proto = "https" |             proto = "https" | ||||||
|         if server_settings.get("unix"): |         if server_settings.get("unix"): | ||||||
|             serve_location = f'{server_settings["unix"]} {proto}://...' |             return f'{server_settings["unix"]} {proto}://localhost' | ||||||
|         elif server_settings.get("sock"): |         if server_settings.get("sock"): | ||||||
|             host, port, *_ = server_settings["sock"].getsockname() |             host, port, *_ = server_settings["sock"].getsockname() | ||||||
|  |         if not host or not port: | ||||||
|  |             return "" | ||||||
|  |  | ||||||
|         if not serve_location and host and port: |         # colon(:) is legal for a host only in an ipv6 address | ||||||
|             # colon(:) is legal for a host only in an ipv6 address |         url_host = f"[{host}]" if ":" in host else host | ||||||
|             display_host = f"[{host}]" if ":" in host else host |         url_port = ( | ||||||
|             serve_location = f"{proto}://{display_host}:{port}" |             "" | ||||||
|  |             if ( | ||||||
|  |                 (proto == "https" and port == 443) | ||||||
|  |                 or (proto == "http" and port == 80) | ||||||
|  |             ) | ||||||
|  |             else f":{port}" | ||||||
|  |         ) | ||||||
|  |  | ||||||
|         return serve_location |         special = { | ||||||
|  |             "127.0.0.1": "IPv4", | ||||||
|  |             "0.0.0.0": "IPv4 wildcard", | ||||||
|  |             "::1": "IPv6", | ||||||
|  |             "::": "IPv6 wildcard", | ||||||
|  |         }.get(host, "") | ||||||
|  |         if special: | ||||||
|  |             return f"({special}) {proto}://localhost{url_port}" | ||||||
|  |  | ||||||
|  |         return f"{proto}://{url_host}{url_port}" | ||||||
|  |  | ||||||
|     @staticmethod |     @staticmethod | ||||||
|     def get_address( |     def get_address( | ||||||
|   | |||||||
| @@ -532,12 +532,11 @@ class WebsocketImplProtocol: | |||||||
|             raise WebsocketClosed( |             raise WebsocketClosed( | ||||||
|                 "Cannot receive from websocket interface after it is closed." |                 "Cannot receive from websocket interface after it is closed." | ||||||
|             ) |             ) | ||||||
|  |         assembler_get: Optional[asyncio.Task] = None | ||||||
|         try: |         try: | ||||||
|             self.recv_cancel = asyncio.Future() |             self.recv_cancel = asyncio.Future() | ||||||
|             tasks = ( |             assembler_get = asyncio.create_task(self.assembler.get(timeout)) | ||||||
|                 self.recv_cancel, |             tasks = (self.recv_cancel, assembler_get) | ||||||
|                 asyncio.ensure_future(self.assembler.get(timeout)), |  | ||||||
|             ) |  | ||||||
|             done, pending = await asyncio.wait( |             done, pending = await asyncio.wait( | ||||||
|                 tasks, |                 tasks, | ||||||
|                 return_when=asyncio.FIRST_COMPLETED, |                 return_when=asyncio.FIRST_COMPLETED, | ||||||
| @@ -551,6 +550,11 @@ class WebsocketImplProtocol: | |||||||
|             else: |             else: | ||||||
|                 self.recv_cancel.cancel() |                 self.recv_cancel.cancel() | ||||||
|                 return done_task.result() |                 return done_task.result() | ||||||
|  |         except asyncio.CancelledError: | ||||||
|  |             # recv was cancelled | ||||||
|  |             if assembler_get: | ||||||
|  |                 assembler_get.cancel() | ||||||
|  |             raise | ||||||
|         finally: |         finally: | ||||||
|             self.recv_cancel = None |             self.recv_cancel = None | ||||||
|             self.recv_lock.release() |             self.recv_lock.release() | ||||||
| @@ -584,16 +588,15 @@ class WebsocketImplProtocol: | |||||||
|                 "Cannot receive from websocket interface after it is closed." |                 "Cannot receive from websocket interface after it is closed." | ||||||
|             ) |             ) | ||||||
|         messages = [] |         messages = [] | ||||||
|  |         assembler_get: Optional[asyncio.Task] = None | ||||||
|         try: |         try: | ||||||
|             # Prevent pausing the transport when we're |             # Prevent pausing the transport when we're | ||||||
|             # receiving a burst of messages |             # receiving a burst of messages | ||||||
|             self.can_pause = False |             self.can_pause = False | ||||||
|             self.recv_cancel = asyncio.Future() |             self.recv_cancel = asyncio.Future() | ||||||
|             while True: |             while True: | ||||||
|                 tasks = ( |                 assembler_get = asyncio.create_task(self.assembler.get(0)) | ||||||
|                     self.recv_cancel, |                 tasks = (self.recv_cancel, assembler_get) | ||||||
|                     asyncio.ensure_future(self.assembler.get(timeout=0)), |  | ||||||
|                 ) |  | ||||||
|                 done, pending = await asyncio.wait( |                 done, pending = await asyncio.wait( | ||||||
|                     tasks, |                     tasks, | ||||||
|                     return_when=asyncio.FIRST_COMPLETED, |                     return_when=asyncio.FIRST_COMPLETED, | ||||||
| @@ -616,6 +619,11 @@ class WebsocketImplProtocol: | |||||||
|                 # next message to pass into the Assembler |                 # next message to pass into the Assembler | ||||||
|                 await asyncio.sleep(0) |                 await asyncio.sleep(0) | ||||||
|             self.recv_cancel.cancel() |             self.recv_cancel.cancel() | ||||||
|  |         except asyncio.CancelledError: | ||||||
|  |             # recv_burst was cancelled | ||||||
|  |             if assembler_get: | ||||||
|  |                 assembler_get.cancel() | ||||||
|  |             raise | ||||||
|         finally: |         finally: | ||||||
|             self.recv_cancel = None |             self.recv_cancel = None | ||||||
|             self.can_pause = True |             self.can_pause = True | ||||||
|   | |||||||
							
								
								
									
										1
									
								
								setup.py
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								setup.py
									
									
									
									
									
								
							| @@ -143,6 +143,7 @@ docs_require = [ | |||||||
|     "m2r2", |     "m2r2", | ||||||
|     "enum-tools[sphinx]", |     "enum-tools[sphinx]", | ||||||
|     "mistune<2.0.0", |     "mistune<2.0.0", | ||||||
|  |     "autodocsumm>=0.2.11", | ||||||
| ] | ] | ||||||
|  |  | ||||||
| dev_require = tests_require + [ | dev_require = tests_require + [ | ||||||
|   | |||||||
| @@ -31,11 +31,10 @@ def test_motd_with_expected_info(app, run_startup): | |||||||
|     logs = run_startup(app) |     logs = run_startup(app) | ||||||
|  |  | ||||||
|     assert logs[1][2] == f"Sanic v{__version__}" |     assert logs[1][2] == f"Sanic v{__version__}" | ||||||
|     assert logs[3][2] == "app: test_motd_with_expected_info" |     assert logs[3][2] == "mode: debug, single worker" | ||||||
|     assert logs[4][2] == "mode: debug, single worker" |     assert logs[4][2] == "server: sanic, HTTP/1.1" | ||||||
|     assert logs[5][2] == "server: sanic, HTTP/1.1" |     assert logs[5][2] == f"python: {platform.python_version()}" | ||||||
|     assert logs[6][2] == f"python: {platform.python_version()}" |     assert logs[6][2] == f"platform: {platform.platform()}" | ||||||
|     assert logs[7][2] == f"platform: {platform.platform()}" |  | ||||||
|  |  | ||||||
|  |  | ||||||
| def test_motd_init(): | def test_motd_init(): | ||||||
| @@ -62,7 +61,7 @@ def test_motd_display(caplog): | |||||||
|   │                                │ |   │                                │ | ||||||
|   ├───────────────────────┬────────┤ |   ├───────────────────────┬────────┤ | ||||||
|   │        foobar         │ one: 1 │ |   │        foobar         │ one: 1 │ | ||||||
|   │                       ├────────┤ |   |                       ├────────┤ | ||||||
|   │                       │ two: 2 │ |   │                       │ two: 2 │ | ||||||
|   └───────────────────────┴────────┘ |   └───────────────────────┴────────┘ | ||||||
| """ | """ | ||||||
|   | |||||||
| @@ -517,7 +517,7 @@ def test_stack_trace_on_not_found(app, static_file_directory, caplog): | |||||||
|     counter = Counter([(r[0], r[1]) for r in caplog.record_tuples]) |     counter = Counter([(r[0], r[1]) for r in caplog.record_tuples]) | ||||||
|  |  | ||||||
|     assert response.status == 404 |     assert response.status == 404 | ||||||
|     assert counter[("sanic.root", logging.INFO)] == 10 |     assert counter[("sanic.root", logging.INFO)] == 9 | ||||||
|     assert counter[("sanic.root", logging.ERROR)] == 0 |     assert counter[("sanic.root", logging.ERROR)] == 0 | ||||||
|     assert counter[("sanic.error", logging.ERROR)] == 0 |     assert counter[("sanic.error", logging.ERROR)] == 0 | ||||||
|     assert counter[("sanic.server", logging.INFO)] == 2 |     assert counter[("sanic.server", logging.INFO)] == 2 | ||||||
| @@ -536,7 +536,7 @@ def test_no_stack_trace_on_not_found(app, static_file_directory, caplog): | |||||||
|     counter = Counter([(r[0], r[1]) for r in caplog.record_tuples]) |     counter = Counter([(r[0], r[1]) for r in caplog.record_tuples]) | ||||||
|  |  | ||||||
|     assert response.status == 404 |     assert response.status == 404 | ||||||
|     assert counter[("sanic.root", logging.INFO)] == 10 |     assert counter[("sanic.root", logging.INFO)] == 9 | ||||||
|     assert counter[("sanic.root", logging.ERROR)] == 0 |     assert counter[("sanic.root", logging.ERROR)] == 0 | ||||||
|     assert counter[("sanic.error", logging.ERROR)] == 0 |     assert counter[("sanic.error", logging.ERROR)] == 0 | ||||||
|     assert counter[("sanic.server", logging.INFO)] == 2 |     assert counter[("sanic.server", logging.INFO)] == 2 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user