Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ on:
jobs:
build:

runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: [3.11, 3.12, 3.13, 3.14]

steps:
Expand Down
3 changes: 2 additions & 1 deletion src/makeapp/appmaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def __init__(

# Support for user-supplied template directories.
for template in templates_to_use or []:
if '/' in template:
if os.sep in template:
parent = str(Path(template).parent)
if parent not in search_paths:
search_paths.append(parent)
Expand Down Expand Up @@ -302,6 +302,7 @@ def rollout(
:param remote_push: Whether to push to remote.

"""
dest = os.path.abspath(dest)

@mgefimov mgefimov May 6, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixing a double-chdir crash when dest is relative

self.logger.info(f'Application target path: {dest}')

# Make remote available for hooks.
Expand Down
10 changes: 5 additions & 5 deletions src/makeapp/apptemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ def get_files(self) -> dict[str, 'TemplateFile']:

full_path = os.path.join(path, fname)

rel_path = full_path.replace(templates_path, '').lstrip('/')
rel_path = os.path.relpath(full_path, templates_path)

template_file = TemplateFile(
template=self,
path_full=full_path,
path_rel=rel_path,
path_rel=rel_path.replace(os.sep, '/'),
)

rel_path = rel_path.replace(maker.package_dir_marker, maker.settings['package_name'])
Expand Down Expand Up @@ -174,9 +174,9 @@ def _find(cls, name_or_path: str, search_paths: tuple[str, ...]) -> tuple[str, s

"""
for supposed_path in search_paths:
if '/' in supposed_path and os.path.exists(supposed_path):
if os.sep in supposed_path and os.path.exists(supposed_path):
path = str(os.path.abspath(supposed_path))
return path.split('/')[-1], path
return path.split(os.sep)[-1], path

raise AppMakerException(
f"Unable to find application template {name_or_path}. "
Expand Down Expand Up @@ -221,7 +221,7 @@ def parent_paths(self):

if os.path.exists(path_full):
# Check parent file exists in template.
paths.append(os.path.join(parent.name, path_rel))
paths.append(f'{parent.name}/{path_rel}')

if parent.is_default:
break
Expand Down
6 changes: 5 additions & 1 deletion src/makeapp/helpers/vcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ def commit(self, message: str):
:param message: Commit description.

"""
self.run_command("commit -m '%s'" % message.replace("'", "''"))
with NamedTemporaryFile() as f:
f.write(message.encode())
f.flush()

self.run_command(f'commit -F "{f.name}"')

def get_remotes(self):
"""Returns a list of remotes."""
Expand Down
13 changes: 7 additions & 6 deletions src/makeapp/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,10 @@ def check_command(command: str, *, hint: str):
:param hint:

"""
try:
run_command(f'type {command}')

except CommandError as e:
if shutil.which(command) is None:
raise CommandError(
f"Failed to execute '{command}' command. "
f"Check {hint} is installed and available.") from e
f"Check {hint} is installed and available.")


def run_command(command: str, *, err_msg: str = '', env: dict | None = None, capture: bool = True) -> list[str]:
Expand Down Expand Up @@ -187,4 +184,8 @@ def sync(cls) -> list[str]:

@classmethod
def install(cls):
return run_command('curl -LsSf https://astral.sh/uv/install.sh | sh', capture=False)
if sys.platform == 'win32':
cmd = 'powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"'
else:
cmd = 'curl -LsSf https://astral.sh/uv/install.sh | sh'
return run_command(cmd, capture=False)
Loading