Skip to content

Commit b9f307b

Browse files
Make it easier to use purely pip and venv instead of requiring Hatch (#228)
* Make it easier to use purely `pip` and `venv` instead of requiring Hatch. * Rename and README updates.
1 parent ada3f00 commit b9f307b

4 files changed

Lines changed: 49 additions & 10 deletions

File tree

python/README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,27 @@ After defining your types, TypeChat takes care of the rest by:
1616

1717
Types are all you need!
1818

19-
## Installation
19+
## Getting Started
2020

21-
TypeChat for Python is not yet on PyPI, but you can try our [examples](./examples/) by cloning this repository.
21+
Install TypeChat:
2222

23-
You will need [Python >=3.11](https://www.python.org/downloads/) and [hatch](https://hatch.pypa.io/1.6/install/).
23+
```sh
24+
pip install typechat
25+
```
26+
27+
You can also develop TypeChat from source, which needs [Python >=3.11](https://www.python.org/downloads/), [hatch](https://hatch.pypa.io/1.6/install/), and [Node.js >=20](https://nodejs.org/en/download):
2428

2529
```sh
2630
git clone https://github.com/microsoft/TypeChat
2731
cd TypeChat/python
2832
hatch shell
33+
npm ci
2934
```
3035

36+
To see TypeChat in action, we recommend exploring the [TypeChat example projects](https://github.com/microsoft/TypeChat/tree/main/python/examples). You can try them on your local machine or in a GitHub Codespace.
37+
38+
To learn more about TypeChat, visit the [documentation](https://microsoft.github.io/TypeChat) which includes more information on TypeChat and how to get started.
39+
3140
## Contributing
3241

3342
This project welcomes contributions and suggestions. Most contributions require you to agree to a

python/examples/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,23 @@ hatch shell
3434
python examples/sentiment/demo.py
3535
```
3636

37+
Alternatively, you can just use `venv` and `pip`:
38+
39+
```sh
40+
git clone https://github.com/microsoft/TypeChat
41+
cd TypeChat/python
42+
python -m venv ../.venv
43+
44+
# Activate the virtual environment
45+
# Windows
46+
../.venv/Scripts/Activate.ps1
47+
# Unix/POSIX
48+
source ../.venv/bin/activate
49+
50+
pip install .[examples]
51+
52+
python examples/sentiment/demo.py
53+
```
3754

3855
### Option 2: GitHub Codespaces
3956

python/pyproject.toml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,20 @@ dependencies = [
2828
"typing_extensions>=4.10.0",
2929
]
3030

31+
[project.optional-dependencies]
32+
# Development-time dependencies.
33+
dev = [
34+
"coverage[toml]>=6.5",
35+
"pytest>=8.0.2",
36+
"syrupy>=4.6.1",
37+
]
38+
39+
# Dependencies for examples.
40+
examples = [
41+
"python-dotenv>=1.0.0",
42+
"spotipy",
43+
]
44+
3145
[project.urls]
3246
Documentation = "https://github.com/microsoft/TypeChat#readme"
3347
Issues = "https://github.com/microsoft/TypeChat/issues"
@@ -44,12 +58,11 @@ path = "src/typechat/__about__.py"
4458
type = "virtual"
4559
path = "../.venv"
4660

47-
dependencies = [
48-
"coverage[toml]>=6.5",
49-
"python-dotenv>=1.0.0",
50-
"pytest>=8.0.2",
51-
"syrupy>=4.6.1",
52-
"spotipy", # for examples
61+
# Include dependencies from optional-dependencies for
62+
# development of the core package along with examples.
63+
features = [
64+
"dev",
65+
"examples"
5366
]
5467

5568
[tool.hatch.envs.default.scripts]

typescript/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ npm install
3333
npm run build
3434
```
3535

36-
To see TypeChat in action, we recommend exploring the [TypeChat example projects](./examples). You can try them on your local machine or in a GitHub Codespace.
36+
To see TypeChat in action, we recommend exploring the [TypeChat example projects](https://github.com/microsoft/TypeChat/tree/main/typescript/examples). You can try them on your local machine or in a GitHub Codespace.
3737

3838
To learn more about TypeChat, visit the [documentation](https://microsoft.github.io/TypeChat) which includes more information on TypeChat and how to get started.
3939

0 commit comments

Comments
 (0)