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