Skip to content

Commit

Permalink
Reformatted files with upgraded black
Browse files Browse the repository at this point in the history
[noissue]
  • Loading branch information
Manisha15 committed Aug 27, 2020
1 parent f25313c commit 6f77d00
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 10 deletions.
14 changes: 11 additions & 3 deletions .travis/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,23 @@
parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter, description=helper)

parser.add_argument(
"release_part", type=str, help="Whether the release should be major, minor or patch.",
"release_part",
type=str,
help="Whether the release should be major, minor or patch.",
)

parser.add_argument(
"--lower", type=str, required=False, help="Lower bound of pulpcore requirement.",
"--lower",
type=str,
required=False,
help="Lower bound of pulpcore requirement.",
)

parser.add_argument(
"--upper", type=str, required=False, help="Upper bound of pulpcore requirement.",
"--upper",
type=str,
required=False,
help="Upper bound of pulpcore requirement.",
)

args = parser.parse_args()
Expand Down
6 changes: 5 additions & 1 deletion pulp_deb/app/models/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,11 @@ def filename(self, component=""):
else:
prefix = sourcename[0]
return os.path.join(
"pool", component, prefix, sourcename, "{}.{}".format(self.name, self.SUFFIX),
"pool",
component,
prefix,
sourcename,
"{}.{}".format(self.name, self.SUFFIX),
)

class Meta:
Expand Down
3 changes: 2 additions & 1 deletion pulp_deb/app/serializers/remote_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ class AptRemoteSerializer(RemoteSerializer):
"""

distributions = CharField(
help_text="Whitespace separated list of distributions to sync", required=True,
help_text="Whitespace separated list of distributions to sync",
required=True,
)

components = CharField(
Expand Down
13 changes: 9 additions & 4 deletions pulp_deb/app/tasks/publishing.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ def publish(repository_version_pk, simple=False, structured=False, signing_servi
distribution = "default"
component = "all"
architectures = (
Package.objects.filter(pk__in=repo_version.content.order_by("-pulp_created"),)
Package.objects.filter(
pk__in=repo_version.content.order_by("-pulp_created"),
)
.distinct("architecture")
.values_list("architecture", flat=True)
)
Expand Down Expand Up @@ -123,13 +125,15 @@ def publish(repository_version_pk, simple=False, structured=False, signing_servi
pk__in=repo_version.content.order_by("-pulp_created"),
):
architectures = ReleaseArchitecture.objects.filter(
pk__in=repo_version.content.order_by("-pulp_created"), release=release,
pk__in=repo_version.content.order_by("-pulp_created"),
release=release,
).values_list("architecture", flat=True)
architectures = list(architectures)
if "all" not in architectures:
architectures.append("all")
components = ReleaseComponent.objects.filter(
pk__in=repo_version.content.order_by("-pulp_created"), release=release,
pk__in=repo_version.content.order_by("-pulp_created"),
release=release,
)
release_helper = _ReleaseHelper(
publication=publication,
Expand Down Expand Up @@ -278,7 +282,8 @@ def finish(self):
with open(release_path, "wb") as release_file:
self.release.dump(release_file)
release_metadata = PublishedMetadata.create_from_file(
publication=self.publication, file=File(open(release_path, "rb")),
publication=self.publication,
file=File(open(release_path, "rb")),
)
release_metadata.save()
if self.signing_service:
Expand Down
3 changes: 2 additions & 1 deletion pulp_deb/tests/functional/setup_signing_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
from pulp_deb.app.models import AptReleaseSigningService

AptReleaseSigningService.objects.create(
name="sign_deb_release", script=script_path,
name="sign_deb_release",
script=script_path,
)

0 comments on commit 6f77d00

Please sign in to comment.