Skip to content

Commit d088a68

Browse files
authored
Merge branch 'master' into fix/args-no-frame
2 parents a8a3fe2 + 0280bfe commit d088a68

File tree

13 files changed

+134
-73
lines changed

13 files changed

+134
-73
lines changed

.ci/osx_ci.sh

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

.github/workflows/deploy.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ jobs:
88
runs-on: macos-latest
99
env:
1010
CIBW_BUILD_VERBOSITY: 3
11-
CIBW_BUILD: cp3{6,7,8,9,10}-*
12-
CIBW_ARCHS: "x86_64 universal2 arm64"
11+
CIBW_BUILD: "cp37-macosx_x86_64 cp38-macosx_universal2 cp39-macosx_universal2 cp310-macosx_universal2 cp311-macosx_universal2 cp312-macosx_universal2"
12+
CIBW_ARCHS_MACOS: "x86_64 universal2"
1313
CIBW_TEST_COMMAND: python -c "from pyobjus import autoclass, objc_str"
1414
CIBW_TEST_SKIP: "*arm64*"
1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v4
1717

1818
- name: Set up Python
19-
uses: actions/setup-python@v1
19+
uses: actions/setup-python@v5
2020
with:
2121
python-version: '3.x'
2222

2323
- name: Install dependencies
24-
run: python -m pip install --upgrade twine cibuildwheel cython
24+
run: python -m pip install --upgrade twine cibuildwheel~=2.16.2 cython setuptools
2525

2626
- name: Build sdist
2727
run: |
@@ -32,14 +32,14 @@ jobs:
3232
python -m cibuildwheel --output-dir dist
3333
3434
- name: Create artifacts
35-
uses: actions/upload-artifact@v1
35+
uses: actions/upload-artifact@v4
3636
with:
3737
name: wheels
3838
path: dist
3939

4040
- name: Upload to GitHub Releases
4141
if: startsWith(github.ref, 'refs/tags/')
42-
uses: softprops/action-gh-release@v0.1.14
42+
uses: softprops/action-gh-release@v2.0.8
4343
env:
4444
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4545
with:

.github/workflows/no-reponse.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: No Response
2+
3+
# Both `issue_comment` and `scheduled` event types are required for this Action
4+
# to work properly.
5+
on:
6+
issue_comment:
7+
types: [created]
8+
schedule:
9+
# Schedule for five minutes after the hour, every hour
10+
- cron: '5 * * * *'
11+
12+
jobs:
13+
noResponse:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: lee-dohm/no-response@9bb0a4b5e6a45046f00353d5de7d90fb8bd773bb
17+
# This commit hash targets release v0.5.0 of lee-dohm/no-response.
18+
# Targeting a commit hash instead of a tag has been done for security reasons.
19+
# Please be aware that the commit hash specifically targets the "Automatic compilation"
20+
# done by `github-actions[bot]` as the `no-response` Action needs to be compiled.
21+
with:
22+
token: ${{ github.token }}
23+
daysUntilClose: 42
24+
responseRequiredLabel: 'awaiting-reply'
25+
closeComment: >
26+
This issue has been automatically closed because there has been no response
27+
to our request for more information from the original author. With only the
28+
information that is currently in the issue, we don't have the means
29+
to take action. Please reach out if you have or find the answers we need so
30+
that we can investigate further.

.github/workflows/python-package.yml

Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,48 +5,40 @@ on: [push, pull_request]
55
jobs:
66
build:
77

8-
name: "build (${{ matrix.runs_on }}, ${{ matrix.python }})"
9-
defaults:
10-
run:
11-
shell: ${{ matrix.run_wrapper || 'bash --noprofile --norc -eo pipefail {0}' }}
12-
runs-on: ${{ matrix.runs_on || 'macos-latest' }}
8+
name: "build (${{ matrix.runs_on }}, ${{ matrix.python }} - Cython ${{ matrix.cython }})"
9+
runs-on: ${{ matrix.runs_on }}
1310
strategy:
1411
matrix:
15-
include:
16-
- runs_on: macos-latest
17-
python: "3.7"
18-
- runs_on: macos-latest
19-
python: "3.8"
20-
- runs_on: macos-latest
21-
python: "3.9"
22-
- runs_on: macos-latest
23-
python: "3.10"
24-
- runs_on: apple-silicon-m1
25-
run_wrapper: arch -arm64 bash --noprofile --norc -eo pipefail {0}
26-
python: "3.9.11"
27-
- runs_on: apple-silicon-m1
28-
run_wrapper: arch -arm64 bash --noprofile --norc -eo pipefail {0}
29-
python: "3.10.3"
12+
# macos-latest (ATM macos-14) runs on Apple Silicon,
13+
# macos-13 runs on Intel
14+
runs_on: ['macos-latest', 'macos-13']
15+
python:
16+
- "3.8"
17+
- "3.9"
18+
- "3.10"
19+
- "3.11"
20+
- "3.12"
21+
cython:
22+
- "<3"
23+
- ">=3"
3024
steps:
31-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v4
26+
3227
- name: Set up Python ${{ matrix.python }}
33-
# Needs to be skipped on our self-hosted runners tagged as 'apple-silicon-m1'
34-
if: ${{ matrix.runs_on != 'apple-silicon-m1' }}
35-
uses: actions/setup-python@v2
28+
uses: actions/setup-python@v5
3629
with:
3730
python-version: ${{ matrix.python }}
3831

32+
- name: Force Cython version
33+
run: sed -i.bak 's/"Cython"/"Cython${{matrix.cython}}"/' pyproject.toml
34+
3935
- name: Install project
4036
run: |
41-
source .ci/osx_ci.sh
42-
arm64_set_path_and_python_version ${{ matrix.python }}
43-
pip install cython pytest
37+
pip install cython pytest setuptools
4438
pip install .
4539
4640
- name: Test with pytest
4741
run: |
48-
source .ci/osx_ci.sh
49-
arm64_set_path_and_python_version ${{ matrix.python }}
5042
make test_lib
5143
make
5244
make tests

.readthedocs.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Read the Docs configuration file for Sphinx projects
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
version: 2
5+
6+
build:
7+
os: ubuntu-22.04
8+
tools:
9+
python: "3"
10+
11+
python:
12+
install:
13+
- requirements: docs/requirements.txt
14+
15+
sphinx:
16+
configuration: docs/source/conf.py

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,9 @@ If you need assistance, you can ask for help on our mailing list:
3535
* User Group : https://groups.google.com/group/kivy-users
3636
3737

38-
We also have an IRC channel:
38+
We also have a Discord server:
3939

40-
* Server : irc.freenode.net
41-
* Port : 6667, 6697 (SSL only)
42-
* Channel : #kivy
40+
[https://chat.kivy.org/](https://chat.kivy.org/)
4341

4442

4543
## Contributing

docs/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Sphinx~=8.0.2
2+
furo==2024.8.6

docs/source/conf.py

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
# All configuration values have a default; values that are commented out
1212
# serve to show the default.
1313

14-
import sys, os
14+
import datetime
15+
import os
16+
import re
1517

1618
# If extensions (or modules to document with autodoc) are in another directory,
1719
# add these directories to sys.path here. If the directory is relative to the
@@ -40,17 +42,33 @@
4042
master_doc = 'index'
4143

4244
# General information about the project.
43-
project = u'Pyobjus'
44-
copyright = u'2012, Mathieu Virbel, Gabriel Pettier'
45+
project = 'pyobjus'
46+
47+
_today = datetime.datetime.now()
48+
49+
copyright = f'{_today.year}, Mathieu Virbel, Gabriel Pettier'
4550

4651
# The version info for the project you're documenting, acts as replacement for
4752
# |version| and |release|, also used in various other places throughout the
4853
# built documents.
4954
#
55+
56+
# Lookup the version from the pyobjus module, without installing it
57+
# since readthedocs.org may have issue to install it.
58+
# Read the version from the __init__.py file, without importing it.
59+
def get_version():
60+
with open(
61+
os.path.join(os.path.abspath("../.."), "pyobjus", "__init__.py")
62+
) as fp:
63+
for line in fp:
64+
m = re.search(r'^\s*__version__\s*=\s*([\'"])([^\'"]+)\1\s*$', line)
65+
if m:
66+
return m.group(2)
67+
5068
# The short X.Y version.
51-
version = '1.0'
69+
version = get_version()
5270
# The full version, including alpha/beta/rc tags.
53-
release = '1.0a1'
71+
release = get_version()
5472

5573
# The language for content autogenerated by Sphinx. Refer to documentation
5674
# for a list of supported languages.
@@ -91,7 +109,7 @@
91109

92110
# The theme to use for HTML and HTML Help pages. See the documentation for
93111
# a list of builtin themes.
94-
html_theme = 'default'
112+
html_theme = 'furo'
95113

96114
# Theme options are theme-specific and customize the look and feel of a theme
97115
# further. For a list of options available for each theme, see the

pyobjus/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = '1.2.2.dev0'
1+
__version__ = '1.2.4.dev0'
22
from .pyobjus import *

pyobjus/pyobjus.pyx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ from libcpp cimport bool
4949

5050
# library files
5151
include "config.pxi"
52+
53+
# from Cython 3.0, in the MetaJavaClass, this is accessed as _JavaClass__cls_storage
54+
# see https://cython.readthedocs.io/en/latest/src/userguide/migrating_to_cy30.html#class-private-name-mangling
55+
cdef CLS_STORAGE_NAME = '_JavaClass__cls_storage' if PYOBJUS_CYTHON_3 else '__cls_storage'
56+
5257
include "debug.pxi"
5358
include "common.pxi"
5459
include "type_enc.pxi"
@@ -129,7 +134,7 @@ class MetaObjcClass(type):
129134
raise ObjcException('Unable to find class {0!r}'.format(
130135
__objcclass__))
131136

132-
classDict['__cls_storage'] = storage
137+
classDict[CLS_STORAGE_NAME] = storage
133138

134139
cdef ObjcMethod om
135140
for name, value in classDict.iteritems():
@@ -430,8 +435,8 @@ cdef class ObjcMethod(object):
430435
if res_ptr == NULL:
431436
raise MemoryError('Unable to allocate res_ptr')
432437

433-
if not self.signature_return.startswith((b'(', b'{')):
434-
ffi_call(&self.f_cif, <void(*)()><id(*)(id, SEL)>objc_msgSend, res_ptr, f_args)
438+
if not self.signature_return[0].startswith((b'(', b'{')):
439+
ffi_call(&self.f_cif, <void(*)() noexcept><id(*)(id, SEL)>objc_msgSend, res_ptr, f_args)
435440

436441
else:
437442
# TODO FIXME NOTE: Currently this only work on x86_64 architecture and armv7 ios
@@ -460,20 +465,20 @@ cdef class ObjcMethod(object):
460465
stret = True
461466

462467
if stret and MACOS_HAVE_OBJMSGSEND_STRET:
463-
ffi_call(&self.f_cif, <void(*)()><id(*)(id, SEL)>objc_msgSend_stret__safe, res_ptr, f_args)
468+
ffi_call(&self.f_cif, <void(*)() noexcept><id(*)(id, SEL)>objc_msgSend_stret__safe, res_ptr, f_args)
464469
fun_name = "objc_msgSend_stret"
465470
del_res_ptr = False
466471
else:
467-
ffi_call(&self.f_cif, <void(*)()><id(*)(id, SEL)>objc_msgSend, res_ptr, f_args)
472+
ffi_call(&self.f_cif, <void(*)() noexcept><id(*)(id, SEL)>objc_msgSend, res_ptr, f_args)
468473
fun_name = "objc_msgSend"
469474
dprint("x86_64 architecture {0} call".format(fun_name), of_type='i')
470475

471476
ELIF PLATFORM == 'ios':
472477
IF ARCH == 'arm64':
473-
ffi_call(&self.f_cif, <void(*)()><id(*)(id, SEL)>objc_msgSend, res_ptr, f_args)
478+
ffi_call(&self.f_cif, <void(*)() noexcept><id(*)(id, SEL)>objc_msgSend, res_ptr, f_args)
474479
dprint('ios(arm64) platform objc_msgSend call')
475480
ELSE:
476-
ffi_call(&self.f_cif, <void(*)()><id(*)(id, SEL)>objc_msgSend_stret, res_ptr, f_args)
481+
ffi_call(&self.f_cif, <void(*)() noexcept><id(*)(id, SEL)>objc_msgSend_stret, res_ptr, f_args)
477482
dprint('ios(armv7) platform objc_msgSend_stret call')
478483

479484
ELSE:

0 commit comments

Comments
 (0)