Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Final changes for stable release 0.9. #449

Merged
merged 4 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
compiler: 'g++'
- os: ubuntu-latest
python-version: '3.11'
- os: ubuntu-latest
python-version: '3.12'

steps:
- uses: actions/checkout@v3
Expand All @@ -37,6 +39,7 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true

- name: Install/Upgrade Python dependencies
run: python -m pip install --upgrade pip wheel 'setuptools>=60.2'
Expand All @@ -61,7 +64,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.11', '3.10', '3.9', '3.8']
python-version: ['3.12', '3.11', '3.10', '3.9', '3.8']

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -102,6 +105,8 @@ jobs:
python-version: '3.9'
- os: ubuntu-latest
python-version: '3.11'
- os: ubuntu-latest
python-version: '3.12'

steps:
- uses: actions/checkout@v3
Expand All @@ -117,6 +122,7 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true

- name: Install/Upgrade Python dependencies
run: python -m pip install --upgrade pip wheel
Expand Down
11 changes: 7 additions & 4 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ HPy Quickstart
This section shows how to quickly get started with HPy by creating
a simple HPy extension from scratch.

Install HPy:
Install latest HPy release:

..
This should be updated to pip install hpy once this version is released
.. code-block:: console

python3 -m pip install hpy

Alternatively, you can also install HPy from the development repository:

.. code-block:: console

python3 -m pip install git+https://github.com/hpyproject/hpy.git#egg=hpy.universal
python3 -m pip install git+https://github.com/hpyproject/hpy.git#egg=hpy

Create a new directory for the new HPy extension. Location and name of the directory
do not matter. Add the following two files:
Expand Down
2 changes: 1 addition & 1 deletion hpy/debug/src/debug_ctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ const char *debug_ctx_Type_GetName(HPyContext *dctx, DHPy type)
ctx_info->is_valid = false;
const char *name = HPyType_GetName(uctx, uh_type);
ctx_info->is_valid = true;
n_name = strlen(name);
n_name = strlen(name) + 1;
return (const char *)protect_and_associate_data_ptr(type, (void *)name, n_name);
}

Expand Down
10 changes: 9 additions & 1 deletion hpy/devel/src/runtime/structseq.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,15 @@ HPyStructSequence_New(HPyContext *ctx, HPy type, HPy_ssize_t nargs, HPy *args)
tp = (PyTypeObject *)_h2py(type);
name = PyUnicode_FromStringAndSize(s_n_fields, sizeof(s_n_fields));
// CPython also accesses the dict directly
v = PyDict_GetItemWithError(tp->tp_dict, name);
#if PY_VERSION_HEX >= 0x030C0000
PyObject *dict = PyType_GetDict(tp);
#else
PyObject *dict = tp->tp_dict;
#endif
v = PyDict_GetItemWithError(dict, name);
#if PY_VERSION_HEX >= 0x030C0000
Py_DECREF(dict);
#endif
Py_DECREF(name);
if (v == NULL && !PyErr_Occurred()) {
goto type_error;
Expand Down