break `commands.py` into individual files
See original GitHub issueHow would this feature be useful?
commands.py
has grown to be quite large, so breaking it into file names corresponding to the command name will help reduce the barrier to entry for new devs in pipx’s codebase.
Describe the solution you’d like
Make a folder called commands
and in that folder add files corresponding to each pipx command, such as commands/list_command.py
, commands/install_command.py
, etc.
Describe alternatives you’ve considered
Break commands.py
into files in the same directory. This will make it harder to distinguish between libraries, classes and commands though, so I think putting commands in a commands
dir will be the option of least astonishment.
Notes
- Created per suggestion in https://github.com/pipxproject/pipx/pull/246#pullrequestreview-304527855.
- Marking as good first issue because it’s purely a refactor. Existing unit tests should be sufficient.
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (8 by maintainers)
Top Results From Across the Web
How to Split a File into a List in Python - GeeksforGeeks
Python list slicing can be used to split a list. To begin, we read the file with the readlines() method. The file's first-half/upper...
Read more >Splitting and Joining Files - Programming Python, Second ...
The join script simply uses os.listdir to collect all the part files in a directory created by split, and sorts the filename list...
Read more >The Fastest Way to Split a Text File Using Python
The fastest way to split text in Python is with the split() method. This is a built-in method that is useful for separating...
Read more >How to split a single file into multiple file of different size using ...
First, I would suggest to convert your list into a list of 2-tuples, and use integers for the numbers instead of strings.
Read more >Commands in separate files loses arguments and options ...
When the commands are in one single file we have the commands arguments and options help description, but if we separate them in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Closed via #382 🎉
It’s partially done, but there are still several commands defined in commands.py. If you or anyone else reading would like to progress it further, feel free to.