mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-20 12:24:59 +00:00
style: Run linter on Python script
This commit is contained in:
parent
ee6cbddf65
commit
7a0196e039
1 changed files with 7 additions and 4 deletions
|
@ -2,6 +2,7 @@ import requests
|
||||||
from packaging import version
|
from packaging import version
|
||||||
from packaging.specifiers import SpecifierSet
|
from packaging.specifiers import SpecifierSet
|
||||||
|
|
||||||
|
|
||||||
def get_versions_supporting_python38(package_name):
|
def get_versions_supporting_python38(package_name):
|
||||||
# Fetch package information from PyPI
|
# Fetch package information from PyPI
|
||||||
url = f"https://pypi.org/pypi/{package_name}/json"
|
url = f"https://pypi.org/pypi/{package_name}/json"
|
||||||
|
@ -13,13 +14,13 @@ def get_versions_supporting_python38(package_name):
|
||||||
data = response.json()
|
data = response.json()
|
||||||
compatible_versions = []
|
compatible_versions = []
|
||||||
|
|
||||||
for release, release_data in data['releases'].items():
|
for release, release_data in data["releases"].items():
|
||||||
if not release_data: # Skip empty releases
|
if not release_data: # Skip empty releases
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Check the 'requires_python' field
|
# Check the 'requires_python' field
|
||||||
requires_python = release_data[0].get('requires_python')
|
requires_python = release_data[0].get("requires_python")
|
||||||
|
|
||||||
if requires_python is None:
|
if requires_python is None:
|
||||||
# If 'requires_python' is not specified, assume it's compatible
|
# If 'requires_python' is not specified, assume it's compatible
|
||||||
compatible_versions.append(release)
|
compatible_versions.append(release)
|
||||||
|
@ -34,6 +35,7 @@ def get_versions_supporting_python38(package_name):
|
||||||
|
|
||||||
return compatible_versions
|
return compatible_versions
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
package_name = "aider-chat" # Replace with your package name
|
package_name = "aider-chat" # Replace with your package name
|
||||||
compatible_versions = get_versions_supporting_python38(package_name)
|
compatible_versions = get_versions_supporting_python38(package_name)
|
||||||
|
@ -42,5 +44,6 @@ def main():
|
||||||
for v in compatible_versions:
|
for v in compatible_versions:
|
||||||
print(v)
|
print(v)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue