Skip to content
← All Python tracks

Modules, Packaging and Tooling

Python

See how Python finds your modules, fix circular imports, and pass dependencies in so you can test each part on its own. Then build and install a wheel, lock your dependencies, and set up Ruff, mypy and CI.

This track uses Python. You can make it your practice mode to browse related content across the site.

15 exercises

26 articles

Explore freely. Sign in to keep your progress.

Your learning sequence

  1. 1 Know Which Copy of Your Package You Import Read
  2. 2 Not solved yet. Find the Folder Python Imports a Package From Practice · Easy
  3. 3 How Python Finds a Module Read
  4. 4 Not solved yet. Work Out the First Entry on sys.path Practice · Medium
  5. 5 Keep __init__.py Small and Its Exports Clear Read
  6. 6 Not solved yet. List a Module's Functions with ast Practice · Easy
  7. 7 Not solved yet. Work Out What a Module Exports Practice · Hard
  8. 8 Packages Without __init__.py Read
  9. 9 Fix a Circular Import Read
  10. 10 Not solved yet. Find One Import Cycle Practice · Easy
  11. 11 Not solved yet. List Every Import Cycle Once Practice · Hard
  12. 12 Ask for Only the Methods You Use with a Protocol Read
  13. 13 Split Code into Domain, Application and Adapter Layers Read
  14. 14 Not solved yet. Check That Imports Follow Your Layers Practice · Hard
  15. 15 Pass Dependencies In Instead of Importing Them Read
  16. 16 Not solved yet. Pass a Clock and a Store into a Rate Limiter Practice · Hard
  17. 17 Build Your Objects in One Place at Startup Read
  18. 18 Not solved yet. Close Only What You Created Practice · Medium
  19. 19 Test Your Module Boundaries in CI Read
  20. 20 Not solved yet. Find Import Chains That Reach a Forbidden Package Practice · Hard
  21. 21 Seven Ways to Test Code Structure Read
  22. 22 Build a Wheel and Install It Read
  23. 23 Not solved yet. Find the Files Missing from a Wheel Practice · Easy
  24. 24 Describe Your Project in pyproject.toml Read
  25. 25 Choose a Build Backend and Test the Wheel Read
  26. 26 Manage a Project with uv Read
  27. 27 Choose Version Ranges for Your Dependencies Read
  28. 28 Not solved yet. Check a Version Against a Specifier Practice · Medium
  29. 29 Group Dev, Test and Optional Dependencies Read
  30. 30 Not solved yet. Expand a Dependency Group into Its Requirements Practice · Medium
  31. 31 Install the Same Versions Everywhere with a Lockfile Read
  32. 32 Turn a Function into a Command Read
  33. 33 Not solved yet. Parse an Entry-Point Reference Practice · Medium
  34. 34 Set Up Ruff for Linting and Formatting Read
  35. 35 Decide Which Ruff Rules Should Fail CI Read
  36. 36 Not solved yet. Clean Up Old noqa Comments Practice · Easy
  37. 37 Find Hard-to-Follow Functions with Complexity Scores Read
  38. 38 Turn On mypy Checks Beyond --strict Read
  39. 39 Choose Which Checks Block a Merge Read
  40. 40 Design a CI Pipeline That Tests the Release Read
  41. 41 Pick the Oldest Python Version You Support Read

Check yourself

6 questions · not saved while you're signed out

Use these questions to check your understanding and compare explanations. Your score does not affect track completion.

0 / 6 correct

What does this print?

Choose one answer to reveal the explanations. Answers are kept only while this page is open.

import ast

source = '''
def load(path): ...

class Store:
    def get(self, key): ...

def save(store, path): ...
'''
tree = ast.parse(source)
print([type(node).__name__ for node in tree.body])
Question 1 of 6