Skip to content

Commit a52935c

Browse files
committed
Merge branch 'master' into altendky-just_twisted
2 parents 1a1459f + 6996e05 commit a52935c

File tree

12 files changed

+124
-88
lines changed

12 files changed

+124
-88
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: CI
22

3-
on: [push, pull_request]
3+
on: [push, pull_request, workflow_dispatch]
44

55
jobs:
66
Windows:
@@ -9,17 +9,18 @@ jobs:
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
python: ['3.7', '3.8', '3.9', '3.10']
12+
python: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.14t']
1313

1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v2
17-
- name: Setup python
18-
uses: actions/setup-python@v2
16+
uses: actions/checkout@v6
17+
- name: Setup Python
18+
uses: actions/setup-python@v6
1919
with:
2020
python-version: ${{ matrix.python }}
21+
allow-prereleases: true
2122
cache: pip
22-
cache-dependency-path: test-requirements.txt
23+
cache-dependency-path: pyproject.toml
2324
- name: Run tests
2425
run: ./ci.sh
2526
shell: bash
@@ -34,7 +35,7 @@ jobs:
3435
strategy:
3536
fail-fast: false
3637
matrix:
37-
python: ['3.7', '3.8', '3.9', '3.10', '3.11-dev']
38+
python: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.14t']
3839
check_formatting: ['0']
3940
extra_name: ['']
4041
include:
@@ -43,19 +44,14 @@ jobs:
4344
extra_name: ', check formatting'
4445
steps:
4546
- name: Checkout
46-
uses: actions/checkout@v2
47-
- name: Setup python
48-
uses: actions/setup-python@v2
49-
if: "!endsWith(matrix.python, '-dev')"
47+
uses: actions/checkout@v6
48+
- name: Setup Python
49+
uses: actions/setup-python@v6
5050
with:
5151
python-version: ${{ matrix.python }}
52+
allow-prereleases: true
5253
cache: pip
53-
cache-dependency-path: test-requirements.txt
54-
- name: Setup python (dev)
55-
uses: deadsnakes/action@v2.0.2
56-
if: endsWith(matrix.python, '-dev')
57-
with:
58-
python-version: '${{ matrix.python }}'
54+
cache-dependency-path: pyproject.toml
5955
- name: Run tests
6056
run: ./ci.sh
6157
env:
@@ -70,18 +66,36 @@ jobs:
7066
strategy:
7167
fail-fast: false
7268
matrix:
73-
python: ['3.7', '3.8', '3.9', '3.10']
69+
python: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.14t']
7470
steps:
7571
- name: Checkout
76-
uses: actions/checkout@v2
77-
- name: Setup python
78-
uses: actions/setup-python@v2
72+
uses: actions/checkout@v6
73+
- name: Setup Python
74+
uses: actions/setup-python@v6
7975
with:
8076
python-version: ${{ matrix.python }}
77+
allow-prereleases: true
8178
cache: pip
82-
cache-dependency-path: test-requirements.txt
79+
cache-dependency-path: pyproject.toml
80+
- name: Set PYTHON_GIL
81+
if: endsWith(matrix.python-version, 't')
82+
run: |
83+
echo "PYTHON_GIL=0" >> "$GITHUB_ENV"
8384
- name: Run tests
8485
run: ./ci.sh
8586
env:
8687
# Should match 'name:' up above
8788
JOB_NAME: 'macOS (${{ matrix.python }})'
89+
90+
alls-green:
91+
if: always()
92+
needs:
93+
- Windows
94+
- Ubuntu
95+
- macOS
96+
runs-on: ubuntu-latest
97+
steps:
98+
- name: Decide whether all jobs succeeded or not
99+
uses: re-actors/alls-green@release/v1
100+
with:
101+
jobs: ${{ toJSON(needs) }}

.readthedocs.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
# https://docs.readthedocs.io/en/latest/yaml-config.html
2+
version: 2
3+
4+
build:
5+
os: ubuntu-24.04
6+
tools:
7+
python: "3.12"
8+
jobs:
9+
install:
10+
- python -m pip install --no-cache-dir "pip >= 25.1"
11+
- python -m pip install --upgrade --upgrade-strategy only-if-needed --no-cache-dir --group rtd .
12+
213
formats:
314
- htmlzip
415
- epub
516

6-
requirements_file: ci/rtd-requirements.txt
7-
8-
python:
9-
version: 3
10-
pip_install: True
17+
sphinx:
18+
configuration: docs/source/conf.py

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
include README.rst CHEATSHEET.rst LICENSE* CODE_OF_CONDUCT* CONTRIBUTING*
22
include .coveragerc .style.yapf
3-
include test-requirements.txt
43
recursive-include docs *
54
prune docs/build

ci.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pip install -U pip setuptools wheel
1010

1111
if [ "$CHECK_FORMATTING" = "1" ]; then
1212
pip install yapf==${YAPF_VERSION}
13-
if ! yapf -rpd setup.py sniffio; then
13+
if ! yapf -rpd sniffio; then
1414
cat <<EOF
1515
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1616
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -43,11 +43,7 @@ EOF
4343
exit 0
4444
fi
4545

46-
python setup.py sdist --formats=zip
47-
pip install dist/*.zip
48-
49-
# Actual tests
50-
pip install -Ur test-requirements.txt
46+
pip install --upgrade --group test .
5147

5248
mkdir empty
5349
cd empty

ci/rtd-requirements.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/source/history.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ Release history
55

66
.. towncrier release notes start
77
8+
Sniffio 1.3.1 (2024-02-26)
9+
--------------------------
10+
11+
Bugfixes
12+
~~~~~~~~
13+
14+
- Added missing ``thread_local`` to ``sniffio.__all__`` (`#44 <https://github.com/python-trio/sniffio/issues/44>`__)
15+
16+
817
sniffio 1.3.0 (2022-09-01)
918
--------------------------
1019

pyproject.toml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,59 @@
1+
[build-system]
2+
requires = [
3+
"setuptools >= 64",
4+
"setuptools_scm >= 6.4"
5+
]
6+
build-backend = "setuptools.build_meta"
7+
8+
[project]
9+
name = "sniffio"
10+
description = "Sniff out which async library your code is running under"
11+
readme = "README.rst"
12+
authors = [{name = "Nathaniel J. Smith", email = "njs@pobox.com"}]
13+
license = {text = "MIT OR Apache-2.0"}
14+
keywords = ["async", "trio", "asyncio", "twisted"]
15+
classifiers = [
16+
"License :: OSI Approved :: MIT License",
17+
"License :: OSI Approved :: Apache Software License",
18+
"Framework :: Trio",
19+
"Framework :: AsyncIO",
20+
"Framework :: Twisted",
21+
"Operating System :: POSIX :: Linux",
22+
"Operating System :: MacOS :: MacOS X",
23+
"Operating System :: Microsoft :: Windows",
24+
"Programming Language :: Python :: 3 :: Only",
25+
"Programming Language :: Python :: Implementation :: CPython",
26+
"Programming Language :: Python :: Implementation :: PyPy",
27+
"Intended Audience :: Developers",
28+
"Development Status :: 5 - Production/Stable",
29+
]
30+
requires-python = ">= 3.10"
31+
dynamic = ["version"]
32+
33+
[project.urls]
34+
Homepage = "https://github.com/python-trio/sniffio"
35+
Documentation = "https://sniffio.readthedocs.io/"
36+
Changelog = "https://sniffio.readthedocs.io/en/latest/history.html"
37+
38+
[dependency-groups]
39+
test = [
40+
"pytest",
41+
"pytest-cov",
42+
"curio",
43+
]
44+
rtd = [
45+
"sphinx >= 1.6.1",
46+
"sphinx_rtd_theme",
47+
"sphinxcontrib-trio",
48+
]
49+
50+
[tool.setuptools.dynamic]
51+
version = {attr = "sniffio._version.__version__"}
52+
53+
[tool.setuptools.packages.find]
54+
include = ["sniffio*"]
55+
namespaces = false
56+
157
[tool.towncrier]
258
package = "sniffio"
359
filename = "docs/source/history.rst"

setup.py

Lines changed: 0 additions & 41 deletions
This file was deleted.

sniffio/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
"""Top-level package for sniffio."""
22

33
__all__ = [
4-
"current_async_library", "AsyncLibraryNotFoundError",
5-
"current_async_library_cvar"
4+
"current_async_library",
5+
"AsyncLibraryNotFoundError",
6+
"current_async_library_cvar",
7+
"thread_local",
68
]
79

810
from ._version import __version__

sniffio/_tests/test_sniffio.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ async def this_is_asyncio():
5858
current_async_library()
5959

6060

61-
# https://github.com/dabeaz/curio/pull/354
6261
@pytest.mark.skipif(
63-
os.name == "nt" and sys.version_info >= (3, 9),
64-
reason="Curio breaks on Python 3.9+ on Windows. Fix was not released yet",
62+
sys.version_info >= (3, 12),
63+
reason=
64+
"curio broken on 3.12 (https://github.com/python-trio/sniffio/pull/42)",
6565
)
6666
def test_curio():
6767
import curio

0 commit comments

Comments
 (0)