Skip to content

Commit 27c896b

Browse files
authored
Fix version handling (#372)
1 parent c91836b commit 27c896b

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
os: [ubuntu-latest, windows-latest, macos-latest]
22-
python-version: ["3.8", "3.11"]
22+
python-version: ["3.8", "3.12"]
2323
include:
2424
- os: windows-latest
2525
python-version: "3.9"
2626
- os: ubuntu-latest
2727
python-version: "pypy-3.8"
2828
- os: ubuntu-latest
29-
python-version: "3.12.0-beta.1"
29+
python-version: "3.11"
3030
- os: macos-latest
3131
python-version: "3.10"
3232
steps:

nbformat/_version.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
"""The version information for nbformat."""
22
# Use "hatchling version xx.yy.zz" to handle version changes
33
import re
4+
from importlib.metadata import version
45

5-
try:
6-
from importlib.metadata import version
7-
except ImportError:
8-
from importlib_metadata import version # type:ignore
9-
10-
__version__ = version("nbformat")
6+
__version__ = version("nbformat") or "0.0.0"
117

128
# matches tbump regex in pyproject.toml
139
_version_regex = re.compile(

pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ classifiers = [
1818
"Programming Language :: Python :: 3.8",
1919
"Programming Language :: Python :: 3.9",
2020
"Programming Language :: Python :: 3.10",
21-
"Programming Language :: Python :: 3.11"
21+
"Programming Language :: Python :: 3.11",
22+
"Programming Language :: Python :: 3.12"
2223
]
2324
requires-python = ">=3.8"
2425
dependencies = [
@@ -151,11 +152,11 @@ ignore_missing_imports = true
151152
[tool.black]
152153
line-length = 100
153154
skip-string-normalization = true
154-
target-version = ["py37"]
155+
target-version = ["py38"]
155156
extend-exclude = "^/tests.*ipynb$"
156157

157158
[tool.ruff]
158-
target-version = "py37"
159+
target-version = "py38"
159160
line-length = 100
160161
select = [
161162
"A", "B", "C", "DTZ", "E", "EM", "F", "FBT", "I", "ICN", "ISC", "N",

0 commit comments

Comments
 (0)