Skip to content

Conversation

@suricactus
Copy link
Collaborator

@suricactus suricactus commented Jul 16, 2025

I know there are delete_files but is a bit annoying that it only accepts glob. Sometimes you need a simple file to be deleted.

Copy link
Member

@gounux gounux left a comment

Choose a reason for hiding this comment

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

Code looks good, thanks !


_resp = ctx.obj["client"].delete_file(project_id, filename, version_id)

log(f'Successfully deleted file "{filename}" in project "{project_id}"…')
Copy link
Member

Choose a reason for hiding this comment

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

Am not super fan of those when logging the finish of a successful operation. Personal taste here, feel free to ignore.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Used quite intensively everywhere else. But in this case it is actually not needed, as it is nothing that takes longer time (processing), I just copy pasted another line in the code. Fixed.

self,
project_id: str,
filename: str,
version_id: Optional[str],
Copy link
Member

Choose a reason for hiding this comment

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

I was about to suggest the version_id: str | None typing, but it seems that the project is python >= 3.8, so better keep it this way.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, 3.9 is dead by the end of the year, then we upgade to a newer target Python version.

@suricactus suricactus merged commit 63ce585 into master Aug 5, 2025
8 checks passed
@suricactus suricactus deleted the delete_file branch August 5, 2025 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants