Skip to content

Commit

Permalink
linting get_latest_pypi_version.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ioannis-vm committed Oct 9, 2023
1 parent 7f5b56f commit 5935eb3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/osmg/get_latest_pypi_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@

def get_latest_version(package_name):
url = f"https://pypi.org/pypi/{package_name}/json"

try:
response = requests.get(url)
package_info = response.json()
latest_version = package_info['info']['version']
latest_version = package_info["info"]["version"]
return latest_version
except Exception as e:
print(f"An error occurred: {e}")
return None


if __name__ == '__main__':
package = 'osmg'
if __name__ == "__main__":
package = "osmg"
version = get_latest_version(package)
print(version)

0 comments on commit 5935eb3

Please sign in to comment.