2024-12-19 19:34:09 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
# List of package names
|
2025-04-01 18:07:14 +00:00
|
|
|
packages=(transitions websockets passlib docopt PyYAML)
|
2024-12-19 19:34:09 +00:00
|
|
|
|
|
|
|
echo "" >requirements.txt
|
|
|
|
# Loop through the packages
|
|
|
|
for package in "${packages[@]}"; do
|
|
|
|
# Get the latest version number using jq and curl
|
|
|
|
latest_version=$(curl -s "https://pypi.org/pypi/${package}/json" | jq -r '.releases | keys | .[]' | sort -V | tail -n 1)
|
|
|
|
# Print the formatted output
|
2025-04-01 18:07:14 +00:00
|
|
|
echo "\"${package}==${latest_version}\", # https://pypi.org/project/${package}" >>requirements.txt
|
2024-12-19 19:34:09 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
2025-04-04 19:06:41 +00:00
|
|
|
packages_dev=(hypothesis mypy pre-commit psutil pylint pytest-asyncio pytest-cov pytest-logdog pytest-timeout pytest ruff setuptools types-mock types-PyYAML types-setuptools)
|
2024-12-19 19:34:09 +00:00
|
|
|
|
|
|
|
echo "" >requirements-dev.txt
|
|
|
|
# Loop through the packages
|
|
|
|
for package in "${packages_dev[@]}"; do
|
|
|
|
# Get the latest version number using jq and curl
|
|
|
|
latest_version=$(curl -s "https://pypi.org/pypi/${package}/json" | jq -r '.releases | keys | .[]' | sort -V | tail -n 1)
|
|
|
|
# Print the formatted output
|
2025-04-01 18:07:14 +00:00
|
|
|
echo "\"${package}>=${latest_version}\", # https://pypi.org/project/${package}" >>requirements-dev.txt
|
2024-12-19 19:34:09 +00:00
|
|
|
done
|