Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Improve AliBuild typing and linter strictness #882

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

singiamtel
Copy link
Collaborator

I'm currently trying to type the codebase as much as possible, and use a stronger mypy filter.

Not ready to merge yet, just want to get the tests running

@@ -233,7 +218,7 @@ def fetch_symlinks(self, spec):
os.path.join(self.workdir, links_path, linkname))

def upload_symlinks_and_tarball(self, spec):
pass
dieOnError(True, "HTTP backend does not support uploading directly")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Is this change correct? The tests seem to suggest that it should fail silently, instead of crashing like how the CVMFS backend fails

Comment on lines 70 to 72
destFp = None
try:
destFp = open(dest+".tmp", "wb") if dest else None
if dest: destFp = open(dest+".tmp", "wb")
Copy link
Member

Choose a reason for hiding this comment

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

Not sure this is an improvement.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I did this one so destFp is always bounded on the finally block, otherwise if open() throws aliBuild would crash trying to access it

Copy link
Member

Choose a reason for hiding this comment

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

is the finally actually needed / working? is there a case where open throws and still returns destFp? Maybe we should fix that.

Copy link
Member

Choose a reason for hiding this comment

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

maybe we should split the opening of the file from the rest of the try catch...

Copy link
Member

Choose a reason for hiding this comment

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

I would live this particular change out and continue with the rest of the PR, since to that I have no particular objections.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Okay, leaving it out

aliBuild Show resolved Hide resolved
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.

2 participants