File tree Expand file tree Collapse file tree 3 files changed +28
-6
lines changed Expand file tree Collapse file tree 3 files changed +28
-6
lines changed Original file line number Diff line number Diff line change @@ -423,7 +423,7 @@ RUN sh /uv-installer.sh && rm /uv-installer.sh
423423
424424ENV PATH="/root/.local/bin:$PATH"
425425
426- COPY pyproject.toml uv.lock ./
426+ COPY . ./
427427
428428RUN --mount=type=cache,target=/root/.cache/uv \
429429 uv venv -p {python_version} \
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ use anyhow::{bail, Result};
55use crate :: {
66 file_manager:: save_file_with_content,
77 project_info:: { ProjectInfo , ProjectManager } ,
8- utils:: is_python_312_or_greater ,
8+ utils:: is_python_311_or_greater ,
99} ;
1010
1111fn create_dunder_main_file ( module : & str , is_async_project : bool ) -> String {
@@ -235,7 +235,7 @@ fn create_version_test_file(
235235 } ;
236236
237237 if let Some ( v) = version_test {
238- if is_python_312_or_greater ( min_python_version) ? {
238+ if is_python_311_or_greater ( min_python_version) ? {
239239 Ok ( Some ( format ! (
240240 r#"import tomllib
241241from pathlib import Path
Original file line number Diff line number Diff line change 11use anyhow:: { bail, Result } ;
22
3+ pub fn is_python_311_or_greater ( version : & str ) -> Result < bool > {
4+ let version_parts = split_version ( version) ?;
5+
6+ if version_parts. 1 >= 11 {
7+ Ok ( true )
8+ } else {
9+ Ok ( false )
10+ }
11+ }
12+
313pub fn is_python_312_or_greater ( version : & str ) -> Result < bool > {
414 let version_parts = split_version ( version) ?;
515
@@ -38,23 +48,35 @@ mod tests {
3848 use super :: * ;
3949
4050 #[ test]
41- fn test_python_312 ( ) {
51+ fn test_python_312_312 ( ) {
4252 let result = is_python_312_or_greater ( "3.12" ) . unwrap ( ) ;
4353 assert ! ( result) ;
4454 }
4555
4656 #[ test]
47- fn test_python_313 ( ) {
57+ fn test_python_312_313 ( ) {
4858 let result = is_python_312_or_greater ( "3.13" ) . unwrap ( ) ;
4959 assert ! ( result) ;
5060 }
5161
5262 #[ test]
53- fn test_python_311 ( ) {
63+ fn test_python_312_311 ( ) {
5464 let result = is_python_312_or_greater ( "3.11" ) . unwrap ( ) ;
5565 assert ! ( !result) ;
5666 }
5767
68+ #[ test]
69+ fn test_python_311_311 ( ) {
70+ let result = is_python_311_or_greater ( "3.11" ) . unwrap ( ) ;
71+ assert ! ( result) ;
72+ }
73+
74+ #[ test]
75+ fn test_python_311_310 ( ) {
76+ let result = is_python_311_or_greater ( "3.10" ) . unwrap ( ) ;
77+ assert ! ( result) ;
78+ }
79+
5880 #[ cfg( feature = "fastapi" ) ]
5981 #[ test]
6082 fn test_is_allowed_fastapi_python_version ( ) {
You can’t perform that action at this time.
0 commit comments