Skip to content

Commit

Permalink
fmt.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tansy Arron committed Apr 24, 2024
1 parent bcfe521 commit c322515
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pants.toml
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,4 @@ args = ["-Yrangepos", "-Xlint:unused"]
force_add_siblings_as_dependencies = false

[pypi-audit]
lockfile_vulnerability_excludes = {"python-default" = ["GHSA-w596-4wvx-j9j6"]}
lockfile_vulnerability_excludes = { "python-default" = ["GHSA-w596-4wvx-j9j6"] }
10 changes: 5 additions & 5 deletions src/python/pants/backend/python/util_rules/pex_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from __future__ import annotations

import importlib.resources
import logging
import json
import logging
from dataclasses import dataclass, field
from typing import TYPE_CHECKING, Iterable, Iterator
from urllib.parse import urlparse
Expand Down Expand Up @@ -178,19 +178,19 @@ def get_metadata(
)
return metadata


def get_constraints_strings_from_pex_lock_file(lockfile_bytes: bytes) -> FrozenOrderedSet[str]:
lockfile_string = strip_comments_from_pex_json_lockfile(lockfile_bytes)
lockfile_json = json.loads(lockfile_string)
locked_requirements = lockfile_json['locked_resolves'][0]['locked_requirements']
locked_requirements = lockfile_json["locked_resolves"][0]["locked_requirements"]
constraints_strings = []
for package_blob in locked_requirements:
package_name = package_blob['project_name']
version = package_blob['version']
package_name = package_blob["project_name"]
version = package_blob["version"]
constraints_strings.append(f"{package_name}=={version}")
return FrozenOrderedSet(sorted(constraints_strings))



@rule
async def load_lockfile(
request: LoadedLockfileRequest,
Expand Down

0 comments on commit c322515

Please sign in to comment.