Skip to content

Commit

Permalink
[CODE QUALITY]
Browse files Browse the repository at this point in the history
  • Loading branch information
Kye committed Dec 21, 2023
1 parent 124802b commit bd78fda
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "swarms-torch"
version = "0.1.2"
version = "0.1.3"
description = "swarms-torch - Pytorch"
license = "MIT"
authors = ["Kye Gomez <[email protected]>"]
Expand Down
9 changes: 2 additions & 7 deletions scripts/get_package_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,13 @@ def get_package_versions(requirements_path, output_path):

for requirement in requirements:
# Skip empty lines and comments
if (
requirement.strip() == ""
or requirement.strip().startswith("#")
):
if requirement.strip() == "" or requirement.strip().startswith("#"):
continue

# Extract package name
package_name = requirement.split("==")[0].strip()
try:
version = pkg_resources.get_distribution(
package_name
).version
version = pkg_resources.get_distribution(package_name).version
package_versions.append(f"{package_name}=={version}")
except pkg_resources.DistributionNotFound:
package_versions.append(f"{package_name}: not installed")
Expand Down
9 changes: 2 additions & 7 deletions scripts/requirementstxt_to_pyproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,10 @@ def update_pyproject_versions(pyproject_path):
print(f"Error: The file '{pyproject_path}' was not found.")
return
except toml.TomlDecodeError:
print(
f"Error: The file '{pyproject_path}' is not a valid TOML"
" file."
)
print(f"Error: The file '{pyproject_path}' is not a valid TOML" " file.")
return

dependencies = (
data.get("tool", {}).get("poetry", {}).get("dependencies", {})
)
dependencies = data.get("tool", {}).get("poetry", {}).get("dependencies", {})

for package in dependencies:
if package.lower() == "python":
Expand Down

0 comments on commit bd78fda

Please sign in to comment.