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

add searching for latest revs and download #1

Merged
merged 3 commits into from
May 30, 2017

Conversation

bollenn
Copy link
Contributor

@bollenn bollenn commented May 30, 2017

  • Add some functions to search for latest modified file or latest "version"
  • Add function to download a file

@bollenn bollenn force-pushed the add_search_and_download branch from 31b7016 to 90744dd Compare May 30, 2017 11:35

def get_link_to_last_version(self, repo, path):
""" Searches for artifacts with the latest value in the "version" property. Only artifacts
with a "version" property expressly defined in lower case will be taken into account.
Copy link
Member

Choose a reason for hiding this comment

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

What do you mean by this? Will it give issue with version numbers like "V1.0.0" or "1.4.8-BETA"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, you need to set the "version" property... with this exact name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

btw, this is a copy paste from Artifactory API doc 😆

Copy link
Member

Choose a reason for hiding this comment

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

😞

Copy link
Member

Choose a reason for hiding this comment

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

@ptillemans Out of curiosity: Artifactory does not provide a more intelligent way of getting the latest versions? As it knows the different types of the repositories (pypi, nuget, debian,...) I would expect it to be able to know based what the latest version is without needing to add an extra version property?

url (str): Url to the file to be downloaded.
path_to_file (str): Path + filename to be used for downloading the file.
"""
r = requests.get(url, stream=True)
Copy link
Member

Choose a reason for hiding this comment

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

r --> downloaded_file?

path_to_file (str): Path + filename to be used for downloading the file.
"""
r = requests.get(url, stream=True)
with open(path_to_file, 'wb') as f:
Copy link
Member

Choose a reason for hiding this comment

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

f --> output_file?

@ptillemans ptillemans merged commit a633fa9 into melexis:master May 30, 2017
@bollenn bollenn deleted the add_search_and_download branch May 30, 2017 13:34
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