Skip to content

Python 3.12 support #36

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

Merged
merged 2 commits into from
Apr 16, 2024
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
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
name: "Test"
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]
os: [ubuntu-latest, macos-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
runs-on: "${{ matrix.os }}"
steps:
# Check out the code
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
- name: "Set up python"
uses: "actions/setup-python@v4"
with:
python-version: "3.11"
python-version: "3.12"

- name: "Get Python Path"
id: get-py-path
Expand Down Expand Up @@ -217,6 +217,7 @@ jobs:
- cp39
- cp310
- cp311
- cp312

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -252,7 +253,7 @@ jobs:

distribute:
name: "Distribute Cargo, WASM, and Python Sdist Packages"
needs: [ "build", "build-wheels" ]
needs: ["build", "build-wheels"]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
Expand All @@ -263,7 +264,7 @@ jobs:
- name: "Set up python"
uses: "actions/setup-python@v4"
with:
python-version: "3.11"
python-version: "3.12"

# Generate the lockfile
- name: "Generate Cargo Lockfile"
Expand Down Expand Up @@ -355,7 +356,7 @@ jobs:

distribute-py-wheels:
name: "Distribute Python Wheels"
needs: [ "distribute" ]
needs: ["distribute"]
runs-on: ubuntu-latest
# upload to PyPI on every tag starting with 'v'
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ languages. The table below describes current language support:
| -------------------- | -------------------------------------------------------------------------- |
| Rust | [Cargo](https://crates.io/crates/jsonlogic-rs) |
| JavaScript (as WASM) | Node Package via [NPM](https://www.npmjs.com/package/@bestow/jsonlogic-rs) |
| Python | [PyPI](https://pypi.org/project/jsonlogic-rs/) |
| Python | [PyPI](https://pypi.org/project/jsonlogic-rs/) |

## Installation

Expand Down Expand Up @@ -58,7 +58,7 @@ Note that the package is distributed as a node package, so you'll need to use

### Python

Supports Python 3.6+.
Supports Python 3.7+.

Wheels are distributed for many platforms, so you can often just run:

Expand Down Expand Up @@ -203,7 +203,7 @@ true

You must have Rust installed and `cargo` available in your `PATH`.

If you would like to build or test the Python distribution, Python 3.6 or
If you would like to build or test the Python distribution, Python 3.7 or
newer must be available in your `PATH`. The `venv` module must be part of the
Python distribution (looking at you, Ubuntu).

Expand Down
2 changes: 1 addition & 1 deletion build-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export PATH=/root/.cargo/bin:$PATH

mkdir -p build && rm -rf build/*

for PYBIN in /opt/python/{cp37-cp37m,cp38-cp38,cp39-cp39,cp310-cp310,cp311-cp311}/bin; do
for PYBIN in /opt/python/{cp37-cp37m,cp38-cp38,cp39-cp39,cp310-cp310,cp311-cp311,cp312-cp312}/bin; do
export PYTHON_SYS_EXECUTABLE="$PYBIN/python"

"${PYBIN}/python" -m ensurepip
Expand Down
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from pathlib import Path
from subprocess import PIPE, Popen

from setuptools import setup
from setuptools_rust import Binding, RustExtension
from subprocess import Popen, PIPE

PKG_ROOT = Path(__file__).parent
SETUP_REQUIRES = ["setuptools-rust", "wheel", "setuptools"]
Expand All @@ -21,6 +22,7 @@ def generate_lockfile():
raise RuntimeError(f"Could not generate Cargo lockfile: {err}")
return


def get_version():
generate_lockfile()
proc = Popen(("cargo", "pkgid"), stdout=PIPE, stderr=PIPE)
Expand Down Expand Up @@ -51,7 +53,7 @@ def get_version():
classifiers=[
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers for all
# available setup classifiers
'Development Status :: 5 - Production/Stable',
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
Expand All @@ -65,6 +67,7 @@ def get_version():
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Rust",
# 'Programming Language :: Python :: Implementation :: PyPy',
],
Expand Down
Loading