Skip to content

Commit 0c090b3

Browse files
authored
Merge pull request #3 from chrisburr/python-3.12+
2 parents 950351d + eb35ef7 commit 0c090b3

File tree

6 files changed

+148
-48
lines changed

6 files changed

+148
-48
lines changed

.github/workflows/build.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [iostreamConfigurable]
6+
tags: ["v*"]
7+
pull_request:
8+
branches: [iostreamConfigurable]
9+
workflow_dispatch:
10+
11+
jobs:
12+
build:
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
include:
17+
- platform: linux-64
18+
os: ubuntu-latest
19+
- platform: linux-aarch64
20+
os: ubuntu-24.04-arm
21+
- platform: osx-64
22+
os: macos-13
23+
- platform: osx-arm64
24+
os: macos-14
25+
26+
runs-on: ${{ matrix.os }}
27+
name: Build (${{ matrix.platform }})
28+
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- name: Install pixi
33+
uses: prefix-dev/setup-pixi@v0.8.1
34+
with:
35+
pixi-version: v0.59.0
36+
cache: false
37+
38+
- name: Build packages
39+
run: pixi build --output-dir dist
40+
41+
- name: Test packages
42+
run: |
43+
for pkg in dist/*.conda; do
44+
echo "Testing $pkg"
45+
rattler-build test --package-file "$pkg"
46+
done
47+
48+
- name: Upload artifacts
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: packages-${{ matrix.platform }}
52+
path: dist/*.conda
53+
if-no-files-found: error
54+
55+
merge-artifacts:
56+
needs: build
57+
runs-on: ubuntu-latest
58+
name: Merge artifacts
59+
60+
steps:
61+
- name: Download all artifacts
62+
uses: actions/download-artifact@v4
63+
with:
64+
path: packages
65+
pattern: packages-*
66+
merge-multiple: true
67+
68+
- name: Upload merged artifacts
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: all-packages
72+
path: packages/*.conda
73+
if-no-files-found: error

pixi.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[workspace]
2+
name = "tornado"
3+
channels = ["conda-forge"]
4+
platforms = ["linux-64", "linux-aarch64", "osx-64", "osx-arm64"]
5+
preview = ["pixi-build"]
6+
7+
[workspace.build-variants]
8+
python = ["3.11.*", "3.12.*", "3.13.*", "3.14.*"]
9+
10+
[workspace.target.linux.build-variants]
11+
c_stdlib = ["sysroot"]
12+
c_stdlib_version = ["2.17"]
13+
14+
[workspace.target.osx.build-variants]
15+
c_stdlib = ["macosx_deployment_target"]
16+
c_stdlib_version = ["11.0"]
17+
18+
[package]
19+
name = "tornado"
20+
version = "5.1.1+dirac.3"
21+
description = "Fork of tornado for DIRAC with a patch to allow for configurable iostream"
22+
license = "Apache-2.0"
23+
license-file = "LICENSE"
24+
readme = "README.rst"
25+
homepage = "http://www.tornadoweb.org/"
26+
repository = "https://github.com/DIRACGrid/tornado"
27+
28+
[package.build]
29+
backend = { name = "pixi-build-rattler-build", version = "*", channels = ["conda-forge"] }

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["setuptools"]
3+
build-backend = "setuptools.build_meta"

recipe.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package:
2+
name: tornado
3+
version: 5.1.1+dirac.3
4+
5+
source:
6+
- path: .
7+
8+
build:
9+
number: 0
10+
script:
11+
- ${{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation
12+
13+
requirements:
14+
build:
15+
- ${{ compiler('c') }}
16+
- ${{ stdlib('c') }}
17+
host:
18+
- pip
19+
- python ${{ python }}
20+
- setuptools
21+
run:
22+
- python ${{ python }}
23+
24+
tests:
25+
- python:
26+
imports:
27+
- tornado
28+
- tornado.platform
29+
pip_check: true
30+
31+
about:
32+
homepage: http://www.tornadoweb.org/
33+
license: Apache-2.0
34+
license_file: LICENSE
35+
summary: Fork of tornado for DIRAC with a patch to allow for configurable iostream
36+
repository: https://github.com/DIRACGrid/tornado

setup.py

Lines changed: 4 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,11 @@
1515

1616
import os
1717
import platform
18-
import ssl
1918
import sys
2019
import warnings
2120

22-
try:
23-
# Use setuptools if available, for install_requires (among other things).
24-
import setuptools
25-
from setuptools import setup
26-
except ImportError:
27-
setuptools = None
28-
from distutils.core import setup
29-
30-
from distutils.core import Extension
31-
32-
# The following code is copied from
33-
# https://github.com/mongodb/mongo-python-driver/blob/master/setup.py
34-
# to support installing without the extension on platforms where
35-
# no compiler is available.
36-
from distutils.command.build_ext import build_ext
21+
from setuptools import setup, Extension
22+
from setuptools.command.build_ext import build_ext
3723

3824

3925
class custom_build_ext(build_ext):
@@ -103,7 +89,7 @@ def build_extension(self, ext):
10389

10490
kwargs = {}
10591

106-
version = "5.1.1+dirac.2"
92+
version = "5.1.1+dirac.3"
10793

10894
with open('README.rst') as f:
10995
kwargs['long_description'] = f.read()
@@ -123,29 +109,7 @@ def build_extension(self, ext):
123109
kwargs['cmdclass'] = {'build_ext': custom_build_ext}
124110

125111

126-
if setuptools is not None:
127-
# If setuptools is not available, you're on your own for dependencies.
128-
install_requires = []
129-
if sys.version_info < (3, 2):
130-
install_requires.append('futures')
131-
if sys.version_info < (3, 4):
132-
install_requires.append('singledispatch')
133-
if sys.version_info < (3, 5):
134-
install_requires.append('backports_abc>=0.4')
135-
kwargs['install_requires'] = install_requires
136-
137-
python_requires = '>= 2.7, !=3.0.*, !=3.1.*, !=3.2.*, != 3.3.*'
138-
kwargs['python_requires'] = python_requires
139-
140-
# Verify that the SSL module has all the modern upgrades. Check for several
141-
# names individually since they were introduced at different versions,
142-
# although they should all be present by Python 3.4 or 2.7.9.
143-
if (not hasattr(ssl, 'SSLContext') or
144-
not hasattr(ssl, 'create_default_context') or
145-
not hasattr(ssl, 'match_hostname')):
146-
raise ImportError("Tornado requires an up-to-date SSL module. This means "
147-
"Python 2.7.9+ or 3.4+ (although some distributions have "
148-
"backported the necessary changes to older versions).")
112+
kwargs['python_requires'] = '>= 3.11'
149113

150114
setup(
151115
name="tornado",

tornado/iostream.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,7 +1590,8 @@ def _verify_cert(self, peercert):
15901590
15911591
The ssl handshake already tested the certificate for a valid
15921592
CA signature; the only thing that remains is to check
1593-
the hostname.
1593+
the hostname. On Python 3.4+, SSLContext.check_hostname handles
1594+
this automatically during the handshake.
15941595
"""
15951596
if isinstance(self._ssl_options, dict):
15961597
verify_mode = self._ssl_options.get('cert_reqs', ssl.CERT_NONE)
@@ -1603,13 +1604,7 @@ def _verify_cert(self, peercert):
16031604
if cert is None and verify_mode == ssl.CERT_REQUIRED:
16041605
gen_log.warning("No SSL certificate given")
16051606
return False
1606-
try:
1607-
ssl.match_hostname(peercert, self._server_hostname)
1608-
except ssl.CertificateError as e:
1609-
gen_log.warning("Invalid SSL certificate: %s" % e)
1610-
return False
1611-
else:
1612-
return True
1607+
return True
16131608

16141609
def _handle_read(self):
16151610
if self._ssl_accepting:

0 commit comments

Comments
 (0)