Create an Open-Source Project in Python

Create an Open-Source Project in Python

1h 25mIntermediate2023-03-30

Authors

Cheuk Ting Ho

Cheuk Ting Ho

Developer Advocate at Anaconda | Python Community Leader

Course details

For open-source projects, it can be a challenge to ensure development coherence and avoid errors and bugs. In this course, Python community leader Cheuk Ting Ho guides you through the complete process of starting, building, testing, and maintaining an open-source project in Python. Cheuk introduces you to Poetry, a popular dependency management tool, and shows you how to use it in starting a Python project. She defines pytests and goes over how to write simple tests, test with multiple parameters, and test if an exception is raised. Cheuk covers fixtures and how to use them, as well as when it is okay to skip a test. She discusses using PEP 8, Black, linters like Flake8, and pre-commits to tidy up your code. Cheuk demonstrates how to use a tool called tox to standardize your testing, as well as how to set up a workflow on GitHub Action. Plus, she highlights some best practices for open-source projects.

Skills covered

Cross-Platform DevelopmentMobile DevelopmentPythonProjectProgramming LanguagesOpen SourceSoftware Development

Concepts

Introduction

  • Create an open-source project in Python
  • What you should know

Starting a Project with Poetry

  • What is Poetry
  • Install Poetry
  • Starting a project
  • What is pyproject.toml
  • Adding dependencies
  • Poetry lock and install
  • Checkpoint - What you have so far

Power Up Your Tests

  • What is pytest
  • Introduction to your project
  • Writing simple tests
  • Testing with multiple parameters
  • Test if an exception is raised
  • What is a fixture
  • Using fixture
  • Skipping a test, with good reasons
  • Checkpoint - What you have so far

Tidy Up Your Code

  • What is PEP 8
  • What is Black
  • Formatting your code with Black
  • What is a linter
  • Linting your code with Flake8
  • Using pre-commit to clean up automatically
  • Checkpoint - What you have so far

Standardize Testing Using tox

  • What is tox
  • tox basic usage
  • tox advance usage
  • Checkpoint - What you have so far

Setting up a Workflow on GitHub Action

  • What is GitHub Action
  • Setting up a workflow for testing
  • Why do you need code coverage
  • Adding code coverage to workflow

Conclusion

  • Open-source project with good practice
40,000 Toman