Skip to content

Commit 321a39c

Browse files
authored
Merge pull request #118 from smarie/feature/112_support_py314
Add support for python 3.14
2 parents 4573c65 + 39f061e commit 321a39c

File tree

7 files changed

+27
-32
lines changed

7 files changed

+27
-32
lines changed

.github/workflows/base.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ jobs:
2323
runs-on: ubuntu-latest
2424
steps:
2525
- name: Checkout
26-
uses: actions/checkout@v4.1.1
26+
uses: actions/checkout@v4
2727

2828
- name: Install python 3.9
29-
uses: actions/setup-python@v5.1.0
29+
uses: actions/setup-python@v5
3030
with:
3131
python-version: 3.9
3232
architecture: x64
@@ -57,7 +57,7 @@ jobs:
5757
runs-on: ${{ matrix.os }}
5858
steps:
5959
- name: Checkout
60-
uses: actions/checkout@v4.1.1
60+
uses: actions/checkout@v4
6161

6262
# General case
6363
- name: Install python ${{ matrix.nox_session.python }} for tests (not 3.5 not 3.14)
@@ -99,7 +99,7 @@ jobs:
9999
cache-build: true
100100

101101
- name: Install python 3.12 for nox
102-
uses: actions/setup-python@v5.1.0
102+
uses: actions/setup-python@v5
103103
with:
104104
python-version: 3.12
105105
architecture: x64
@@ -118,7 +118,7 @@ jobs:
118118
# Share ./docs/reports so that they can be deployed with doc in next job
119119
- name: Share reports with other jobs
120120
if: runner.os == 'Linux'
121-
uses: actions/upload-artifact@v4.3.1
121+
uses: actions/upload-artifact@v4
122122
with:
123123
name: reports_dir
124124
path: ./docs/reports
@@ -128,10 +128,10 @@ jobs:
128128
if: github.event_name == 'pull_request'
129129
steps:
130130
- name: Checkout
131-
uses: actions/checkout@v4.1.1
131+
uses: actions/checkout@v4
132132

133133
- name: Install python 3.9 for nox
134-
uses: actions/setup-python@v5.1.0
134+
uses: actions/setup-python@v5
135135
with:
136136
python-version: 3.9
137137
architecture: x64
@@ -153,20 +153,20 @@ jobs:
153153
run: echo "$GITHUB_CONTEXT"
154154

155155
- name: Checkout with no depth
156-
uses: actions/checkout@v4.1.1
156+
uses: actions/checkout@v4
157157
with:
158158
fetch-depth: 0 # so that gh-deploy works
159159
# persist-credentials: false # see https://github.com/orgs/community/discussions/25702
160160

161161
- name: Install python 3.9 for nox
162-
uses: actions/setup-python@v5.1.0
162+
uses: actions/setup-python@v5
163163
with:
164164
python-version: 3.9
165165
architecture: x64
166166

167167
# 1) retrieve the reports generated previously
168168
- name: Retrieve reports
169-
uses: actions/download-artifact@v4.1.4
169+
uses: actions/download-artifact@v4
170170
with:
171171
name: reports_dir
172172
path: ./docs/reports
@@ -198,7 +198,7 @@ jobs:
198198
EOF
199199
- name: \[not on TAG\] Publish coverage report
200200
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads')
201-
uses: codecov/codecov-action@v4.1.1
201+
uses: codecov/codecov-action@v4
202202
with:
203203
files: ./docs/reports/coverage/coverage.xml
204204
- name: \[not on TAG\] Build wheel and sdist

.github/workflows/updater.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v4.1.1
15+
- uses: actions/checkout@v4
1616
with:
1717
# [Required] Access token with `workflow` scope.
1818
token: ${{ secrets.WORKFLOW_SECRET }}
1919

2020
- name: Run GitHub Actions Version Updater
21-
uses: saadmk11/[email protected].1
21+
uses: saadmk11/[email protected]
2222
with:
2323
# [Required] Access token with `workflow` scope.
2424
token: ${{ secrets.WORKFLOW_SECRET }}

docs/changelog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
### 1.16.0 - (in progress) new python versions scope
44

55
- Removed official support for python versions `<3.9`. These versions will not run in CI anymore.
6-
6+
- Fixed `RuntimeError` in tests when running on python 3.14. Added python 3.14 to CI. Fixes
7+
[#112](https://github.com/smarie/python-makefun/issues/112)
78

89
### 1.15.6 - compatibility fix
910

noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class Folders:
5252

5353

5454
ENVS = {
55-
# PY314: {"coverage": False, "pkg_specs": {"pip": ">19"}},
55+
PY314: {"coverage": False, "pkg_specs": {"pip": ">19"}},
5656
PY313: {"coverage": False, "pkg_specs": {"pip": ">19"}},
5757
PY312: {"coverage": False, "pkg_specs": {"pip": ">19"}},
5858
PY311: {"coverage": False, "pkg_specs": {"pip": ">19"}},

setup.cfg

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,6 @@ classifiers =
1919
License :: OSI Approved :: BSD License
2020
Topic :: Software Development :: Libraries :: Python Modules
2121
Programming Language :: Python
22-
Programming Language :: Python :: 2
23-
Programming Language :: Python :: 2.7
24-
Programming Language :: Python :: 3
25-
Programming Language :: Python :: 3.5
26-
Programming Language :: Python :: 3.6
27-
Programming Language :: Python :: 3.7
28-
Programming Language :: Python :: 3.8
2922
Programming Language :: Python :: 3.9
3023
Programming Language :: Python :: 3.10
3124
Programming Language :: Python :: 3.11
@@ -41,6 +34,7 @@ install_requires =
4134
funcsigs;python_version<'3.3'
4235
tests_require =
4336
pytest
37+
pytest-asyncio
4438
# for some reason these pytest dependencies were not declared in old versions of pytest
4539
six;python_version<'3.6'
4640
attr;python_version<'3.6'

tests/test_generators_coroutines.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def my_gencoroutine_handler(first_msg):
7676

7777

7878
@pytest.mark.skipif(sys.version_info < (3, 5), reason="native coroutines with async/await require python3.6 or higher")
79-
def test_native_coroutine():
79+
async def test_native_coroutine():
8080
""" Tests that we can use a native async coroutine as function_handler in `create_function`"""
8181

8282
# define the handler that should be called
@@ -92,13 +92,12 @@ def test_native_coroutine():
9292
assert is_native_co(dynamic_fun)
9393

9494
# verify that the new function is a native coroutine and behaves correctly
95-
from asyncio import get_event_loop
96-
out = get_event_loop().run_until_complete(dynamic_fun(0.1))
95+
out = await dynamic_fun(0.1)
9796
assert out == 0.1
9897

9998

10099
@pytest.mark.skipif(sys.version_info < (3, 5), reason="native coroutines with async/await require python3.6 or higher")
101-
def test_issue_96():
100+
async def test_issue_96():
102101
"""Same as `test_native_coroutine` but tests that we can use 'return' in the coroutine name"""
103102

104103
# define the handler that should be called
@@ -114,6 +113,5 @@ def test_issue_96():
114113
assert is_native_co(dynamic_fun)
115114

116115
# verify that the new function is a native coroutine and behaves correctly
117-
from asyncio import get_event_loop
118-
out = get_event_loop().run_until_complete(dynamic_fun(0.1))
116+
out = await dynamic_fun(0.1)
119117
assert out == 0.1

tests/test_issues.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def f(a):
228228

229229

230230
@pytest.mark.skipif(sys.version_info < (3, 6), reason="requires python 3.6 or higher (async generator)")
231-
def test_issue_77_async_generator_wraps():
231+
async def test_issue_77_async_generator_wraps():
232232
import asyncio
233233
from ._test_py36 import make_async_generator, make_async_generator_wrapper
234234

@@ -238,11 +238,12 @@ def test_issue_77_async_generator_wraps():
238238
assert inspect.isasyncgenfunction(f)
239239
assert inspect.isasyncgenfunction(wrapper)
240240

241-
assert asyncio.get_event_loop().run_until_complete(asyncio.ensure_future(wrapper(1).__anext__())) == 1
241+
out = await asyncio.ensure_future(wrapper(1).__anext__())
242+
assert out == 1
242243

243244

244245
@pytest.mark.skipif(sys.version_info < (3, 6), reason="requires python 3.6 or higher (async generator)")
245-
def test_issue_77_async_generator_partial():
246+
async def test_issue_77_async_generator_partial():
246247
import asyncio
247248
from ._test_py36 import make_async_generator
248249

@@ -252,7 +253,8 @@ def test_issue_77_async_generator_partial():
252253
assert inspect.isasyncgenfunction(f)
253254
assert inspect.isasyncgenfunction(f_partial)
254255

255-
assert asyncio.get_event_loop().run_until_complete(asyncio.ensure_future(f_partial().__anext__())) == 1
256+
out = await asyncio.ensure_future(f_partial().__anext__())
257+
assert out == 1
256258

257259

258260
@pytest.mark.skipif(sys.version_info < (3, 7, 6), reason="The __wrapped__ behavior in get_type_hints being tested was not added until python 3.7.6.")

0 commit comments

Comments
 (0)