Skip to content

Commit f7fe4c6

Browse files
committed
Add support for building the package in Python 3.12
As discussed in the [issue](#725) there is an issue when trying to install this package when using Python 3.12. The issue is caused by [PEP-632](https://peps.python.org/pep-0632/) removing `distutils` from the built-in libraries this version of python is shipped with. In versions 6.0.0 and lower of PyYaml, this causes the build the fail. As mentioned in their [issue](yaml/pyyaml#756) using v6.0.1 or later will resolve this issue. So updating our `setup.py` install_requires dependency specifications to reflect this. While I'm here, also update the classifiers to include support for PY3.12 and show this more clearly on the README of the repo.
1 parent 05d59c8 commit f7fe4c6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![Build Status](https://github.com/Shopify/shopify_python_api/workflows/CI/badge.svg)](https://github.com/Shopify/shopify_python_api/actions)
44
[![PyPI version](https://badge.fury.io/py/ShopifyAPI.svg)](https://badge.fury.io/py/ShopifyAPI)
5+
![Supported Python Versions](https://img.shields.io/badge/python-3.7%20|%203.8%20|%203.9%20|%203.10%20|%203.11%20|%203.12-brightgreen)
56
[![codecov](https://codecov.io/gh/Shopify/shopify_python_api/branch/main/graph/badge.svg?token=pNTx0TARUx)](https://codecov.io/gh/Shopify/shopify_python_api)
67
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/Shopify/shopify_python_api/blob/main/LICENSE)
78
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
install_requires=[
2525
"pyactiveresource>=2.2.2",
2626
"PyJWT >= 2.0.0",
27-
"PyYAML",
27+
"PyYAML>=6.0.1; python_version>='3.12'",
28+
"PyYAML; python_version<'3.12'",
2829
"six",
2930
],
3031
test_suite="test",
@@ -44,6 +45,7 @@
4445
"Programming Language :: Python :: 3.9",
4546
"Programming Language :: Python :: 3.10",
4647
"Programming Language :: Python :: 3.11",
48+
"Programming Language :: Python :: 3.12",
4749
"Topic :: Software Development",
4850
"Topic :: Software Development :: Libraries",
4951
"Topic :: Software Development :: Libraries :: Python Modules",

0 commit comments

Comments
 (0)