File tree 1 file changed +27
-0
lines changed
content/contributing-code/python-guidelines
1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,33 @@ warning for [Whitespace before ':' (E203)][e203].
63
63
[ skipe203 ] : https://github.com/search?q=org%3Acreativecommons+%22noqa%3A+E203%22&type=code
64
64
[ flake8actions ] : https://github.com/search?q=org%3Acreativecommons+%22pipenv+run+flake8%22&type=code
65
65
66
+ ## Handling Imports
67
+
68
+ ### Overview
69
+
70
+ All the imports in the Python code must be done via [ isort] [ isort ] , a Python utility/library
71
+ to sort imports alphabetically, and automatically separated into sections and by type.
72
+ It provides a command line utility, Python library and [ plugins for various editors] ( https://github.com/pycqa/isort/wiki/isort-Plugins )
73
+ to quickly sort all your imports. It requires Python 3.6+ to run but
74
+ supports formatting Python 2 code too.
75
+
76
+ [ isort ] : https://github.com/pycqa/isort
77
+
78
+
79
+ ### Configuration
80
+
81
+ There's a good ` isort ` config which one should follow while contributing
82
+ in the Python projects of the creativecommons. These configurations should be a part of
83
+ ` pyproject.toml ` labelled as ` [tools.isort] `
84
+
85
+ - Isort Configuration (` pyproject.toml ` ): [ GitHub Search · org: creativecommons
86
+ filename: pyproject .toml] [ isortconfig ]
87
+ - GitHub Actions workflow: [ GitHub Search · org: creativecommons "pipenv run
88
+ isort"] [ isortactions ]
89
+
90
+ [ isortconfig ] : https://github.com/search?q=org%3Acreativecommons+filename:pyproject.toml
91
+ [ isortactions ] : https://github.com/search?q=org%3Acreativecommons+%22pipenv+run+isort%22&type=code
92
+
66
93
67
94
## Development Environment
68
95
You can’t perform that action at this time.
0 commit comments