Skip to content

Commit

Permalink
Merge branch 'master' into type_compiled_wip
Browse files Browse the repository at this point in the history
# Conflicts:
#	falcon/routing/compiled.py
  • Loading branch information
CaselIT committed Jul 13, 2024
2 parents 8e4adf1 + c345420 commit 57406ef
Show file tree
Hide file tree
Showing 219 changed files with 5,606 additions and 1,742 deletions.
8 changes: 7 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
[run]
branch = True
source = falcon
omit = falcon/tests*,falcon/cmd/bench.py,falcon/bench*,falcon/vendor/*
omit = falcon/tests*,falcon/typing.py,falcon/cmd/bench.py,falcon/bench/*,falcon/vendor/*

parallel = True

[report]
show_missing = True
exclude_lines =
if TYPE_CHECKING:
if not TYPE_CHECKING:
pragma: nocover
pragma: no cover
pragma: no py39,py310 cover
24 changes: 24 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
{
"name": "Python 3",
"image": "mcr.microsoft.com/devcontainers/python:3.11",
"features": {
"ghcr.io/devcontainers-contrib/features/tox:1": {}
}

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "pip3 install --user -r requirements.txt",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# top-most EditorConfig file
root = true

# Unix-style newlines with a final newline; trim trailing whitespace
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

# Set default charset for sources
[*.{html,js,py,pyx}]
charset = utf-8

# 4 space indentation
[*.{py,pyx}]
indent_style = space
indent_size = 4

# 2 space indentation
[*.{yaml,yml}]
indent_style = space
indent_size = 2
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ If an item doesn't apply to your pull request, **check it anyway** to make it ap
- [ ] Updated all relevant supporting documentation files under `docs/`.
- [ ] A copyright notice is included at the top of any new modules (using your own name or the name of your organization).
- [ ] Changed/added classes/methods/functions have appropriate `versionadded`, `versionchanged`, or `deprecated` [directives](http://www.sphinx-doc.org/en/stable/usage/restructuredtext/directives.html?highlight=versionadded#directive-versionadded).
- [ ] Changes (and possible deprecations) have [towncrier](https://towncrier.readthedocs.io/en/actual-freaking-docs/index.html) news fragments under `docs/_newsfragments/`, with the file name format `{issue_number}.{fragment_type}.rst`. (Run `towncrier --draft` to ensure it renders correctly.)
- [ ] Changes (and possible deprecations) have [towncrier](https://towncrier.readthedocs.io/en/latest/quickstart.html#creating-news-fragments) news fragments under `docs/_newsfragments/`, with the file name format `{issue_number}.{fragment_type}.rst`. (Run `towncrier --draft` to ensure it renders correctly.)

If you have *any* questions to *any* of the points above, just **submit and ask**! This checklist is here to *help* you, not to deter you from contributing!

Expand Down
86 changes: 28 additions & 58 deletions .github/workflows/create-wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,26 @@ jobs:
- "windows-latest"
- "macos-latest"
python-version:
- "3.5"
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
architecture:
- x64

include:
- python-version: "3.5"
pytest-extra: --ignore=tests/asgi

fail-fast: false

steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Set up Python
uses: actions/setup-python@v2.1.4
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
Expand All @@ -63,9 +61,6 @@ jobs:
# - install the created wheel without using the pypi index
# - check the cython extension
# - runs the tests
env:
FALCON_ASGI_WRAP_NON_COROUTINES: Y
FALCON_TESTING_SESSION: Y
run: |
pip install tox
tox -e wheel_check -- ${{ matrix.pytest-extra }}
Expand Down Expand Up @@ -100,23 +95,20 @@ jobs:
- "ubuntu-latest"
python-version:
# the versions are <python tag>-<abi tag> as specified in PEP 425.
- cp35-cp35m
- cp36-cp36m
- cp37-cp37m
- cp38-cp38
- cp39-cp39
- cp310-cp310
- cp311-cp311
- cp312-cp312
architecture:
- x64

include:
- python-version: cp35-cp35m
pytest-extra: --ignore=tests/asgi

fail-fast: false

steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 2

Expand All @@ -125,35 +117,23 @@ jobs:
env:
py_tag: ${{ matrix.python-version }}
run: |
version="${py_tag: 2:1}.${py_tag: 3:1}"
platform=${py_tag%%-*}
version=${platform:2:1}.${platform:3:3}
echo $version
echo "::set-output name=python-version::$version"
- name: Set up Python
uses: actions/setup-python@v2.1.4
uses: actions/setup-python@v4
with:
python-version: ${{ steps.linux-py-version.outputs.python-version }}
architecture: ${{ matrix.architecture }}

- name: Create wheel for manylinux 2010 and 1
# this step uses the image provided by pypa here https://github.com/pypa/manylinux to generate the wheels on linux
# the action uses the image for manylinux2010 but can generate also a manylinux1 wheel
# change the tag of this image to change the image used
uses: RalfG/[email protected]_x86_64
# this action generates 3 wheels in dist/. linux manylinux1 and manylinux2010
with:
python-versions: ${{ matrix.python-version }}
build-requirements: "setuptools>=47 wheel>=0.34"
# `--no-deps` is used to only generate the wheel for the current library. Redundant in falcon since it has no dependencies
pip-wheel-args: "-w ./dist -v --no-deps"

- name: Create wheel for manylinux 2014
# as previous step but for manylinux2014
uses: RalfG/[email protected]_x86_64
uses: RalfG/[email protected]_x86_64
# this action generates 2 wheels in dist/. linux, manylinux2014
with:
# Remove previous original wheel just to be sure it is recreated. Should not be needed
pre-build-command: "rm ./dist/*-linux*.whl"
pre-build-command: "rm -f ./dist/*-linux*.whl"
python-versions: ${{ matrix.python-version }}
build-requirements: "setuptools>=47 wheel>=0.34"
pip-wheel-args: "-w ./dist -v --no-deps"
Expand All @@ -162,9 +142,6 @@ jobs:
# - install the created wheel without using the pypi index
# - check the cython extension
# - runs the tests
env:
FALCON_ASGI_WRAP_NON_COROUTINES: Y
FALCON_TESTING_SESSION: Y
run: |
pip install tox
tox -e wheel_check -- ${{ matrix.pytest-extra }}
Expand Down Expand Up @@ -196,20 +173,20 @@ jobs:
os:
- "ubuntu-latest"
python-version:
- "3.9"
- "3.10"
architecture:
- x64

fail-fast: false

steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Set up Python
uses: actions/setup-python@v2.1.4
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
Expand Down Expand Up @@ -250,29 +227,26 @@ jobs:
- "ubuntu-latest"
python-version:
# the versions are <python tag>-<abi tag> as specified in PEP 425.
- cp35-cp35m
- cp36-cp36m
- cp37-cp37m
- cp38-cp38
- cp39-cp39
- cp310-cp310
- cp311-cp311
- cp312-cp312
architecture:
- aarch64
- s390x

include:
- python-version: cp35-cp35m
pytest-extra: --ignore=tests/asgi

fail-fast: false

steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Cache wheels
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: .pip
key: ${{ matrix.python-version }}-${{ matrix.architecture }}-pip-${{ hashFiles('requirements/tests') }}
Expand All @@ -283,8 +257,8 @@ jobs:
- name: Create wheel for manylinux 2014 for arm
if: ${{ matrix.architecture == 'aarch64' }}
uses: RalfG/python-wheels-manylinux-build@v0.3.2-manylinux2014_aarch64
# this action generates 2 wheels in dist/. linux manylinux1 and manylinux2010
uses: RalfG/python-wheels-manylinux-build@v0.6.0-manylinux2014_aarch64
# this action generates 2 wheels in dist/. linux, manylinux2014
with:
python-versions: ${{ matrix.python-version }}
build-requirements: "setuptools>=47 wheel>=0.34"
Expand All @@ -294,8 +268,6 @@ jobs:
if: ${{ matrix.architecture == 'aarch64' }}
uses: docker://quay.io/pypa/manylinux2014_aarch64
env:
FALCON_ASGI_WRAP_NON_COROUTINES: Y
FALCON_TESTING_SESSION: Y
PIP_CACHE_DIR: /github/workspace/.pip/
PYTHON_VERSION: ${{ matrix.python-version }}
with:
Expand All @@ -308,8 +280,8 @@ jobs:
- name: Create wheel for manylinux 2014 for s390x
if: ${{ matrix.architecture == 's390x' }}
uses: RalfG/python-wheels-manylinux-build@v0.3.2-manylinux2014_s390x
# this action generates 2 wheels in dist/. linux manylinux1 and manylinux2010
uses: RalfG/python-wheels-manylinux-build@v0.6.0-manylinux2014_s390x
# this action generates 2 wheels in dist/. linux, manylinux2014
with:
python-versions: ${{ matrix.python-version }}
build-requirements: "setuptools>=47 wheel>=0.34"
Expand All @@ -319,8 +291,6 @@ jobs:
if: ${{ matrix.architecture == 's390x' }}
uses: docker://quay.io/pypa/manylinux2014_s390x
env:
FALCON_ASGI_WRAP_NON_COROUTINES: Y
FALCON_TESTING_SESSION: Y
PIP_CACHE_DIR: /github/workspace/.pip/
with:
args: |
Expand All @@ -338,9 +308,9 @@ jobs:
files: 'dist/*manylinux*'

- name: Set up Python
uses: actions/setup-python@v2.1.4
uses: actions/setup-python@v4
with:
python-version: "3.8"
python-version: "3.10"
architecture: "x64"

- name: Publish wheel
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/mintest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Run tests (contributor's checklist)

on:
# Trigger the workflow on master but also allow it to run manually.
workflow_dispatch:
push:
branches:
- master

jobs:
run_tox:
name: tox (default envlist on ${{matrix.python-version}})
runs-on: "ubuntu-latest"
strategy:
fail-fast: false
matrix:
python-version:
- "3.8"
- "3.10"
- "3.11"
- "3.12"

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U setuptools tox wheel
python --version
pip --version
tox --version
- name: Adjust .coveragerc
if: ${{ matrix.python-version != '3.10' }}
run: |
tools/sed_coverage_rc.py
- name: Run tox inside sdist
run: |
tools/tox_sdist.py
Loading

0 comments on commit 57406ef

Please sign in to comment.