-
Notifications
You must be signed in to change notification settings - Fork 2
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
build: upgrade dev dependency versions #60
Conversation
Many of the changes in a2b9ea8 have been produced by the following script: import toml
import requests
def get_latest_compatible_version(package_name, min_py_version="3.8", max_py_version="3.11"):
"""
Fetch the latest version of a package from PyPI that's compatible with the specified Python version range.
"""
response = requests.get(f"https://pypi.org/pypi/{package_name}/json")
if response.status_code == 200:
data = response.json()
versions = list(data["releases"].keys())
# Sort versions in descending order
versions.sort(key=lambda v: tuple(map(int, v.split('.'))), reverse=True)
for version in versions:
classifiers = data["releases"][version][0].get("classifiers", [])
for classifier in classifiers:
if classifier.startswith("Programming Language :: Python ::"):
supported_version = classifier.split()[-1]
if min_py_version <= supported_version < max_py_version:
return "^" + version
return None
else:
print(f"Failed to get version for {package_name}. Using existing version.")
return None
def main():
# Read the pyproject.toml file
with open("pyproject.toml", "r") as f:
data = toml.load(f)
# Check if dev-dependencies exist
if "tool" in data and "poetry" in data["tool"] and "dev-dependencies" in data["tool"]["poetry"]:
dev_dependencies = data["tool"]["poetry"]["dev-dependencies"]
# Fetch latest version for each dev dependency
for package, version in dev_dependencies.items():
print(f"Fetching latest version for {package}...")
latest_version = get_latest_version(package)
if latest_version:
dev_dependencies[package] = "^" + latest_version
# Update the pyproject.toml file with the latest versions
with open("pyproject.toml", "w") as f:
toml.dump(data, f)
print("Dev dependencies have been updated to their latest versions.")
else:
print("No dev-dependencies found in pyproject.toml.")
if __name__ == "__main__":
main() The sync by another simple script that: exports pyproject.toml in requirements.txt format with the command |
e660dd6
to
937855e
Compare
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. |
Simple PR, nothing special, ready for review. |
Lgtm |
Proposed changes
This PR upgrades
pyproject.toml
dev dependencies' versions, and syncstox.ini
dependencies with the new versions.