Skip to content

Commit

Permalink
✨ Support for Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
foosel committed Oct 4, 2023
1 parent bfc3b39 commit a922ff8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
name: 🧪 Unit tests
strategy:
matrix:
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
needs: build
strategy:
matrix:
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
installable: ["wheel", "sdist"]
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ access control as necessary.
OctoPrint depends on a few python modules to do its job. Those are automatically installed when installing
OctoPrint via `pip`.

OctoPrint currently supports Python 3.7, 3.8, 3.9, 3.10 and 3.11.
OctoPrint currently supports Python 3.7, 3.8, 3.9, 3.10, 3.11 and 3.12.

## Usage

Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# ----------------------------------------------------------------------------------------

# Supported python versions
PYTHON_REQUIRES = ">=3.7, <3.12"
PYTHON_REQUIRES = ">=3.7, <3.13"

# Requirements for setup.py
SETUP_REQUIRES = []
Expand Down Expand Up @@ -350,6 +350,7 @@ def params():
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: JavaScript",
Expand Down
12 changes: 8 additions & 4 deletions versioneer.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,10 +443,14 @@ def get_config_from_root(root):
# the top of versioneer.py for instructions on writing your setup.cfg .
setup_cfg = os.path.join(root, "setup.cfg")

# TODO: find a py2 compatible solution for the configparser deprecation issues
parser = configparser.SafeConfigParser()
with io.open(setup_cfg, "rt", encoding="utf-8") as f:
parser.readfp(f)
try:
parser = configparser.SafeConfigParser()
with io.open(setup_cfg, "rt", encoding="utf-8") as f:
parser.readfp(f)
except AttributeError: # python 3.12 no longer has SafeConfigParser
parser = configparser.ConfigParser()
with io.open(setup_cfg, "rt", encoding="utf-8") as f:
parser.read_file(f)

VCS = parser.get("versioneer", "VCS") # mandatory

Expand Down

0 comments on commit a922ff8

Please sign in to comment.