Skip to content

Commit a151cde

Browse files
committed
Use config.python_full_version instead of config.python_version
1 parent 3b2f538 commit a151cde

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

readthedocs/doc_builder/config.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,7 @@ def extra_requirements(self):
5151

5252
@property
5353
def python_interpreter(self):
54-
ver = self.python_version
55-
if ver in [2, 3]:
56-
# Get the highest version of the major series version if user only
57-
# gave us a version of '2', or '3'
58-
ver = max(
59-
list(
60-
filter(
61-
lambda x: x < ver + 1,
62-
self._yaml_config.get_valid_python_versions(),
63-
)))
54+
ver = self.python_full_version
6455
return 'python{0}'.format(ver)
6556

6657
@property
@@ -75,6 +66,20 @@ def python_version(self):
7566
version = 3
7667
return version
7768

69+
@property
70+
def python_full_version(self):
71+
ver = self.python_version
72+
if ver in [2, 3]:
73+
# Get the highest version of the major series version if user only
74+
# gave us a version of '2', or '3'
75+
ver = max(
76+
list(
77+
filter(
78+
lambda x: x < ver + 1,
79+
self._yaml_config.get_valid_python_versions(),
80+
)))
81+
return ver
82+
7883
@property
7984
def use_system_site_packages(self):
8085
if 'use_system_site_packages' in self._yaml_config.get('python', {}):

readthedocs/doc_builder/python_environments.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def is_obsolete(self):
142142
# used to create the venv but we can still compare it against the new
143143
# one coming from the project version config.
144144
return any([
145-
env_python_version != self.config.python_version,
145+
env_python_version != self.config.python_full_version,
146146
env_build_image != build_image,
147147
])
148148

@@ -153,7 +153,7 @@ def save_environment_json(self):
153153

154154
data = {
155155
'python': {
156-
'version': self.config.python_version,
156+
'version': self.config.python_full_version,
157157
},
158158
'build': {
159159
'image': build_image,

0 commit comments

Comments
 (0)