Skip to content

Commit 3efcebc

Browse files
committed
feat: Update Python template imports from relative to absolute and rename Makefile targets by replacing colons with hyphens.
1 parent f638736 commit 3efcebc

32 files changed

Lines changed: 40 additions & 40 deletions

File tree

src/commands/template/init.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ async function addMakefileScripts(
5959
}
6060

6161
const makefileContent = `
62-
.PHONY: sandbox:build:dev
63-
sandbox:build:dev:
62+
.PHONY: sandbox-build-dev
63+
sandbox-build-dev:
6464
\t${cdPrefix}python ${files.buildDevFile}
6565
66-
.PHONY: sandbox:build:prod
67-
sandbox:build:prod:
66+
.PHONY: sandbox-build-prod
67+
sandbox-build-prod:
6868
\t${cdPrefix}python ${files.buildProdFile}
6969
`
7070

@@ -79,10 +79,10 @@ sandbox:build:prod:
7979

8080
console.log('\n📝 Added build scripts to Makefile:')
8181
console.log(
82-
` ${asPrimary('make sandbox:build:dev')} - Build development template`
82+
` ${asPrimary('make sandbox-build-dev')} - Build development template`
8383
)
8484
console.log(
85-
` ${asPrimary('make sandbox:build:prod')} - Build production template`
85+
` ${asPrimary('make sandbox-build-prod')} - Build production template`
8686
)
8787
} catch (err) {
8888
console.warn(
@@ -310,10 +310,10 @@ export const initCommand = new commander.Command('init')
310310
` ${asPrimary('pip install ucloud_sandbox')} (install SDK dependency)`
311311
)
312312
console.log(
313-
` ${asPrimary('make sandbox:build:dev')} (for development)`
313+
` ${asPrimary('make sandbox-build-dev')} (for development)`
314314
)
315315
console.log(
316-
` ${asPrimary('make sandbox:build:prod')} (for production)`
316+
` ${asPrimary('make sandbox-build-prod')} (for production)`
317317
)
318318
break
319319
default:

src/templates/python-build-async.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import asyncio
22
from ucloud_sandbox import AsyncTemplate, default_build_logger
3-
from .template import template
3+
from template import template
44

55

66
async def main():

src/templates/python-build-sync.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from ucloud_sandbox import Template, default_build_logger
2-
from .template import template
2+
from template import template
33

44

55
if __name__ == "__main__":

src/templates/readme.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ npm run sandbox:build:dev
3737
npm run sandbox:build:prod
3838
{{else if isPython}}
3939
# For development
40-
make sandbox:build:dev
40+
make sandbox-build-dev
4141

4242
# For production
43-
make sandbox:build:prod
43+
make sandbox-build-prod
4444
{{/if}}
4545
```
4646

tests/commands/template/fixtures/complex-python/expected/python-async/build_dev.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import asyncio
22
from ucloud_sandbox import AsyncTemplate, default_build_logger
3-
from .template import template
3+
from template import template
44

55

66
async def main():

tests/commands/template/fixtures/complex-python/expected/python-async/build_prod.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import asyncio
22
from ucloud_sandbox import AsyncTemplate, default_build_logger
3-
from .template import template
3+
from template import template
44

55

66
async def main():

tests/commands/template/fixtures/complex-python/expected/python-sync/build_dev.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from ucloud_sandbox import Template, default_build_logger
2-
from .template import template
2+
from template import template
33

44

55
if __name__ == "__main__":

tests/commands/template/fixtures/complex-python/expected/python-sync/build_prod.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from ucloud_sandbox import Template, default_build_logger
2-
from .template import template
2+
from template import template
33

44

55
if __name__ == "__main__":

tests/commands/template/fixtures/copy-variations/expected/python-async/build_dev.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import asyncio
22
from ucloud_sandbox import AsyncTemplate, default_build_logger
3-
from .template import template
3+
from template import template
44

55

66
async def main():

tests/commands/template/fixtures/copy-variations/expected/python-async/build_prod.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import asyncio
22
from ucloud_sandbox import AsyncTemplate, default_build_logger
3-
from .template import template
3+
from template import template
44

55

66
async def main():

0 commit comments

Comments
 (0)