There are several ways to develop a Python package and open-source it. Below we outline a common approach which we are currently using in our group at UW-Madison. Any person who intends to develop a Python package from scratch could start by reading this overview.
The main steps of developing and open-sourcing a Python package would include: creating a Python repository, coding, testing, documenting, reviewing, releasing, and maintaining, as the figure below illustrates:
Workflow
1. The developer first creates a Python repository for the package. Read about the guidelines to create a Python repository here.
2. The developer then writes code or modifies the existing code. For example, the developer may add a new feature or fix a bug. Read about the coding guidelines here.
3. Next, the developer writes documentation such as docstrings and comments in the code. Read about the documenting guidelines here.
4. Next, the developer writes unit test cases for the code written. Then the developer runs the tests and if there are any failed tests, the developer goes back to step 2. Read about the unit testing guidelines here.
5. After unit testing, the developer runs regression tests (which is a set of previously written unit tests) to make sure that existing functionalities are not broken. If there are any failed tests, the developer goes back to step 2. Read about the regression testing guidelines here.
6. Next, the developer may need to write and run performance tests, if required. If the performance results are not as expected, the developer goes back to step 2. Read about the performance testing guidelines here.
7. Next, the developer should make sure the code runs across different Python versions and OS platforms that the package is expected to support. Read about testing across different Python versions and OS platforms here.
8. After the testing the code compatibility, the developer invites some reviewers to review the code. Based on the review comments, the developer goes back to any of steps 2-7. Read about the review guidelines here.
9. Now, if the developer has added all the features and no more issues with the code, the package can be released for the end users. Read about the release process here.
10. After the code is released, the package has to be maintained. Read about the maintenance guidelines here.
Resources