Skip to content
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

Blacken pulp_python #177

Closed
wants to merge 1 commit into from
Closed

Blacken pulp_python #177

wants to merge 1 commit into from

Conversation

werwty
Copy link
Contributor

@werwty werwty commented Jun 1, 2018

No description provided.

@pep8speaks
Copy link

pep8speaks commented Jun 1, 2018

Hello @werwty! Thanks for updating the PR.

Cheers ! There are no PEP8 issues in this Pull Request. 🍻

Comment last updated on June 01, 2018 at 18:58 Hours UTC

metadata_version = serializers.CharField(
help_text=_('Version of the file format')
help_text=_(
"The type of the distribution package " "(e.g. sdist, bdist_wheel, bdist_egg, etc)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is weird

required=False,
allow_blank=True,
help_text=_(
"The maintainer's name at a minimum; " "additional contact information may be provided."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here it is again

required=False,
allow_blank=True,
help_text=_(
"The Python version(s) that the distribution is guaranteed to be " "compatible with."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

**digest)
python_models.DistributionDigest.objects.create(
project_specifier=specifier, **digest
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I like how it does this. It makes sense in a bunch of places but it feels wrong here.

_(
"Either the 'repository' or 'repository_version' need to be specified "
"but not both."
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this

'project_packages': package_detail_data
})
with open(metadata_relative_path, "w") as simple_metadata:
context = Context({"project_name": name, "project_packages": package_detail_data})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks nicer on two lines

@@ -73,7 +73,8 @@ def _fetch_inventory(version):
inventory = set()
if version:
for content in python_models.PythonPackageContent.objects.filter(
pk__in=version.content).only("filename"):
pk__in=version.content
).only("filename"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meh

})
self.assertEqual(len(page['results']), 1)
page = self.client.get(PYTHON_PUBLISHER_PATH, params={"name": self.publisher["name"]})
self.assertEqual(len(page["results"]), 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of these tests look better on two lines

@werwty
Copy link
Contributor Author

werwty commented Jun 1, 2018

XD we're too opinionated for black

And it does try to format this line https://github.com/pulp/pulp_python/pull/177/files#diff-27efe7f2ffa6f1561afb34c9ffa703faR257
to be for repo_version in self.repo_versions[index + 1 :]: which is not pep8 compliant

It was worth a try, but black's probably not quite right for us right now

@dralley
Copy link
Contributor

dralley commented Jun 1, 2018

I'm not sure how I feel about it. I agree with some of the things it did and disagree with a lot of others. I don't really like the idea of formatting the smash tests because I want to be able to easily compare them against the file smash tests.

@werwty werwty added the 3.0 label Jun 1, 2018
@werwty
Copy link
Contributor Author

werwty commented Jun 1, 2018

TBF we can point it only to pulp_python/app and not have it touch the smash tests.
I do like a lot of the changes it made, and I like the idea of auto code formatting. But I'm not 100% loving black's style

@dralley
Copy link
Contributor

dralley commented Jun 1, 2018

I wouldn't mind taking "the good suggestions" and making a formatting PR for them

@werwty
Copy link
Contributor Author

werwty commented Jun 1, 2018

That's not a bad idea, I can modify this PR to be "good" formatting only.
We do lose a lot of the power black brings to the table, but I can keep looking for good auto formatting tools.

@dralley
Copy link
Contributor

dralley commented Jun 1, 2018

I think at a minimum we can autoformat outright PEP8 errors, and I know tools for that exist.

@dralley dralley closed this Jun 1, 2018
@dralley dralley reopened this Jun 1, 2018
@dralley
Copy link
Contributor

dralley commented Jun 1, 2018

Wrong button sorry

@werwty werwty closed this Jun 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants