Skip to content

Commit 8e3b955

Browse files
committed
Make everything more consistent to 3.13
1 parent a51175a commit 8e3b955

4 files changed

Lines changed: 21 additions & 4 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ RUN useradd -m dev && chown -R dev:dev /workspaces/dfetch
1717
USER dev
1818

1919
ENV PATH="/home/dev/.local/bin:${PATH}"
20-
ENV PYTHONPATH="/home/dev/.local/lib/python3.12"
20+
ENV PYTHONPATH="/home/dev/.local/lib/python3.13"
2121
ENV PYTHONUSERBASE="/home/dev/.local"
2222

2323
COPY --chown=dev:dev . .

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ formats:
1616
build:
1717
os: ubuntu-22.04
1818
tools:
19-
python: "3.12"
19+
python: "3.13"
2020

2121
# Optionally set the version of Python and requirements required to build your docs
2222
python:

doc/contributing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ and install all runtime dependencies from ``pyproject.toml``.
1919
2020
script/create_venv.py
2121
22-
.. important :: *dfetch* is primarily developed with python 3.12
22+
.. important :: *dfetch* is primarily developed with python 3.13
2323
2424
Running in Github Codespaces
2525
----------------------------

script/create_venv.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,32 @@
1-
#!/usr/bin/env python3.12
1+
#!/usr/bin/env python3
22
"""Script to setup a venv."""
33

44
import argparse
55
import pathlib
66
import subprocess # nosec
7+
import sys
78
import venv
89
from typing import Any
910

1011
PROJECT_ROOT = pathlib.Path(__file__).resolve().parent.parent
1112

1213

14+
MIN_VERSION = (3, 9) # minimum supported; change if needed
15+
RECOMMENDED_VERSION = (3, 13) # preferred for development
16+
17+
18+
if sys.version_info[:2] < MIN_VERSION:
19+
raise RuntimeError(
20+
f"⚠ Unsupported Python version {sys.version_info.major}.{sys.version_info.minor}. "
21+
f"Please use Python {MIN_VERSION[0]}.{MIN_VERSION[1]} or newer."
22+
)
23+
if sys.version_info[:2] != RECOMMENDED_VERSION:
24+
print(
25+
f"⚠ Warning: Running with Python {sys.version_info.major}.{sys.version_info.minor}, "
26+
f", dfetch is primarily developed with Python {RECOMMENDED_VERSION[0]}.{RECOMMENDED_VERSION[1]}."
27+
)
28+
29+
1330
class MyEnvBuilder(venv.EnvBuilder):
1431
"""Create a virtual environment.
1532

0 commit comments

Comments
 (0)