@@ -9,19 +9,49 @@ It also has some sane defaults for development environment setups.
99## Getting started
1010
11111 . Use this template repository to create a new repository in your own / organization's profile.
12-
13- Register the function
12+ 1 . Register the function
1413
1514### Add new dependencies
1615
17- To add new Python package dependencies to the project, use the following:
18- ` $ poetry add pandas `
16+ To add new Python package dependencies to the project, edit the ` pyproject.toml ` file:
17+
18+ ** For packages your function needs to run** (like pandas, requests, etc.):
19+ ``` toml
20+ dependencies = [
21+ " specklepy==3.0.0" ,
22+ " pandas==2.1.0" , # Add production dependencies here
23+ ]
24+ ```
25+
26+ ** For development tools** (like testing or formatting tools):
27+ ``` toml
28+ [project .optional-dependencies ]
29+ dev = [
30+ " black==23.12.1" ,
31+ " pytest-mock==3.11.1" , # Add development dependencies here
32+ # ... other dev tools
33+ ]
34+ ```
35+
36+ ** How to decide which section?**
37+ - If your ` main.py ` (or other function logic) imports it → ` dependencies `
38+ - If it's just a tool to help you code → ` [project.optional-dependencies].dev `
39+
40+ Example:
41+ ``` python
42+ # In your main.py
43+ import pandas as pd # ← This goes in dependencies
44+ import specklepy # ← This goes in dependencies
45+
46+ # You won't import these in main.py:
47+ # pytest, black, mypy ← These go in [project.optional-dependencies].dev
48+ ```
1949
2050### Change launch variables
2151
2252Describe how the launch.json should be edited.
2353
24- ### Github Codespaces
54+ ### GitHub Codespaces
2555
2656Create a new repo from this template, and use the create new code.
2757
@@ -43,13 +73,57 @@ Create a new repo from this template, and use the create new code.
4373## Developer Requirements
4474
45751 . Install the following:
46- - [ Python 3] ( https://www.python.org/downloads/ )
47- - [ Poetry] ( https://python-poetry.org/docs/#installing-with-the-official-installer )
48- 1 . Run ` poetry shell && poetry install ` to install the required Python packages.
76+ - [ Python 3.11+] ( https://www.python.org/downloads/ )
77+ 1 . Run the following to set up your development environment:
78+ ``` bash
79+ python -m venv .venv
80+ # On Windows
81+ .venv\S cripts\a ctivate
82+ # On macOS/Linux
83+ source .venv/bin/activate
84+
85+ pip install --upgrade pip
86+ pip install .[dev]
87+ ```
88+
89+ ** What this installs:**
90+ - All the packages your function needs to run (` dependencies` )
91+ - Plus development tools like testing and code formatting (` [project.optional-dependencies].dev` )
92+
93+ ** Why separate sections?**
94+ - ` dependencies` : Only what gets deployed with your function (lightweight)
95+ - ` dev` dependencies: Extra tools to help you write better code locally
4996
5097# # Building and Testing
5198
52- The code can be tested locally by running ` poetry run pytest ` .
99+ The code can be tested locally by running ` pytest` .
100+
101+ # ## Alternative dependency managers
102+
103+ This template uses the modern ** PEP 621** standard in ` pyproject.toml` , which works with all modern Python dependency managers:
104+
105+ # ### Using Poetry
106+ ` ` ` bash
107+ poetry install # Automatically reads pyproject.toml
108+ ` ` `
109+
110+ # ### Using uv
111+ ` ` ` bash
112+ uv sync # Automatically reads pyproject.toml
113+ ` ` `
114+
115+ # ### Using pip-tools
116+ ` ` ` bash
117+ pip-compile pyproject.toml # Generate requirements.txt from pyproject.toml
118+ pip install -r requirements.txt
119+ ` ` `
120+
121+ # ### Using pdm
122+ ` ` ` bash
123+ pdm install # Automatically reads pyproject.toml
124+ ` ` `
125+
126+ ** Advantage** : All tools read the same ` pyproject.toml` file, so there' s no need to keep multiple files in sync!
53127
54128### Building and running the Docker Container Image
55129
0 commit comments