Closed chfw closed 5 years ago
Regarding "update changelog to be yaml lint friendly" , if you are removing the backtick at the beginning of the line, you can usually also remove the quotes around the line.
If we take a step back, this PR did not bring any harm to setup.py but shrink its longest line within a limit. So would you agree to merge it?
I believe it will break the mobans repo, because black will try to rewrite this line again to be longer.
current modification is black-compatible.
https://github.com/peterjc/flake8-black might also help
It looks like it is, however the output still isnt. Why fix just one line when the rest of the file is still incompatible? And it is pointless to fix it once; there needs to be a CI test to ensure it stays compatible. Otherwise the generated output still must be excluded from various linting rules to avoid constant breakages.
> python3 -m black tests/fixtures/setup.py.output
reformatted tests/fixtures/setup.py.output
All done! ✨ 🍰 ✨
1 file reformatted.
> GIT_PAGER=cat git diff
diff --git a/tests/fixtures/setup.py.output b/tests/fixtures/setup.py.output
index 75b982f..b0e03e9 100644
--- a/tests/fixtures/setup.py.output
+++ b/tests/fixtures/setup.py.output
@@ -32,15 +32,11 @@ AUTHOR = "C.W."
VERSION = ""
EMAIL = "wangc_2011@hotmail.com"
LICENSE = "NEW BSD"
-DESCRIPTION = (
- "Scaffolding templates for your Python project."
-)
+DESCRIPTION = "Scaffolding templates for your Python project."
URL = "https://github.com/moremoban/pypi-mobans"
DOWNLOAD_URL = "%s/archive/0.0.0.tar.gz" % URL
FILES = ["README.rst", "CHANGELOG.rst"]
-KEYWORDS = [
- "python",
-]
+KEYWORDS = ["python"]
CLASSIFIERS = [
"Topic :: Software Development :: Libraries",
@@ -52,15 +48,11 @@ CLASSIFIERS = [
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
-
"Programming Language :: Python :: 3.7",
-
"Programming Language :: Python :: 3.8",
-
]
-INSTALL_REQUIRES = [
-]
+INSTALL_REQUIRES = []
SETUP_COMMANDS = {}
@@ -70,12 +62,11 @@ EXTRAS_REQUIRE = {}
PUBLISH_COMMAND = "{python} setup.py sdist bdist_wheel upload -r pypi".format(
python=sys.executable
)
-GS_COMMAND = ("gs pypi-mobans v0.0.0 " +
- "Find 0.0.0 in changelog for more details")
-NO_GS_MESSAGE = ("Automatic github release is disabled. " +
- "Please install gease to enable it.")
-UPLOAD_FAILED_MSG = (
- 'Upload failed. please run "%s" yourself.' % PUBLISH_COMMAND)
+GS_COMMAND = "gs pypi-mobans v0.0.0 " + "Find 0.0.0 in changelog for more details"
+NO_GS_MESSAGE = (
+ "Automatic github release is disabled. " + "Please install gease to enable it."
+)
+UPLOAD_FAILED_MSG = 'Upload failed. please run "%s" yourself.' % PUBLISH_COMMAND
HERE = os.path.abspath(os.path.dirname(__file__))
@@ -118,9 +109,7 @@ class PublishCommand(Command):
sys.exit()
-SETUP_COMMANDS.update({
- "publish": PublishCommand
-})
+SETUP_COMMANDS.update({"publish": PublishCommand})
def has_gease():
@@ -131,6 +120,7 @@ def has_gease():
"""
try:
import gease # noqa
+
return True
except ImportError:
return False
@@ -198,5 +188,5 @@ if __name__ == "__main__":
include_package_data=True,
zip_safe=False,
classifiers=CLASSIFIERS,
- cmdclass=SETUP_COMMANDS
+ cmdclass=SETUP_COMMANDS,
)
OK. I accept your point. Yes, it is quite clear now that black will do more formatting.
so that it will pass flake8 all the time.