Skip to content

Commit e5be67c

Browse files
committed
uv-based instructions
1 parent ef8b0ea commit e5be67c

File tree

2 files changed

+33
-45
lines changed

2 files changed

+33
-45
lines changed

CONTRIBUTING.md

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ You can open pull requests by following the steps:
88

99
## Code Contribution
1010

11+
Prerequisite: install [`uv`](https://docs.astral.sh/uv/).
12+
1113
1. Fork the `datacrunch-python` repo on GitHub.
1214

1315
2. Clone your fork locally:
@@ -17,11 +19,10 @@ You can open pull requests by following the steps:
1719
cd datacrunch-python
1820
```
1921

20-
3. Create virtual environment & install this local copy into the virtual environment:
22+
3. Set up local environment and install dependencies:
2123

2224
```bash
23-
python3 -m venv datacrunch_env && source ./datacrunch_env/bin/activate
24-
python3 setup.py develop
25+
uv sync
2526
```
2627

2728
4. Create a new branch:
@@ -40,27 +41,20 @@ You can open pull requests by following the steps:
4041

4142
5. Make your local changes
4243

43-
6. Install dependencies for test:
44-
45-
```bash
46-
pip3 install -e .[test]
47-
pip3 install -U pytest
48-
```
49-
50-
7. Run tests:
44+
6. Run tests:
5145

5246
```bash
53-
pytest
47+
uv run pytest
5448
```
5549

56-
8. Commit and push:
50+
7. Commit and push:
5751

5852
```bash
59-
git commit .am "Detailed commit message"
53+
git commit -am "Detailed commit message"
6054
git push origin {branch-name}
6155
```
6256

63-
9. Submit a pull request in GitHub.
57+
8. Submit a pull request in GitHub.
6458

6559
## Pull Request Guidelines
6660

README.md

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,14 @@ DataCrunch's Public API documentation [is available here](https://api.datacrunch
1616

1717
## Getting Started - Using the SDK:
1818

19-
- Install via pip:
19+
- Install:
2020

2121
```bash
22+
# via pip
2223
pip3 install datacrunch
24+
25+
# via uv
26+
uv add datacrunch
2327
```
2428

2529
- Generate your client credentials - [instructions in the public API docs](https://api.datacrunch.io/v1/docs#description/quick-start-guide).
@@ -82,54 +86,38 @@ DataCrunch's Public API documentation [is available here](https://api.datacrunch
8286

8387
## Development
8488

85-
### Setting up the local development environment
86-
87-
- Clone the repository:
88-
89-
```bash
90-
git clone
91-
```
92-
93-
- Create local virtual environment:
94-
95-
```bash
96-
python3 -m venv datacrunch_env && source ./datacrunch_env/bin/activate
97-
```
98-
99-
or if using [fish shell](https://fishshell.com/):
89+
### Set up the local development environment
10090

101-
```fish
102-
python3 -m venv datacrunch_env && source ./datacrunch_env/bin/activate.fish
103-
```
91+
Prerequisite: install [`uv`](https://docs.astral.sh/uv/).
10492

105-
- Install Dependencies:
93+
Clone the repository, create local environment and install dependencies:
10694

10795
```bash
108-
pip3 install -e .[test]
109-
pip3 install -U pytest
96+
git clone git@github.com:DataCrunch-io/datacrunch-python.git
97+
cd datacrunch-python
98+
uv sync
11099
```
111100

112-
### Running Tests
113-
114-
We use pytest for testing.
101+
### Run Tests
115102

116-
- To execute all tests
103+
- Execute all tests
117104

118105
```bash
119-
pytest
106+
uv run pytest
120107
```
121108

122-
- To execute a single test file
109+
- Execute a single test file
123110

124111
```bash
125-
pytest ./tests/unit_tests/test_file.py
112+
uv run pytest ./tests/unit_tests/test_file.py
126113
```
127114

128115
### Local Manual Testing
129116

130-
Create this file in the root directory of the project:
117+
Create a file in the root directory of the project:
131118

132119
```python
120+
# example.py
133121
from datacrunch.datacrunch import DataCrunchClient
134122

135123
CLIENT_SECRET = 'secret'
@@ -139,6 +127,12 @@ CLIENT_ID = 'your-id'
139127
datacrunch = DataCrunchClient(CLIENT_ID, CLIENT_SECRET, base_url='http://localhost:3001/v1')
140128
```
141129

130+
Run it:
131+
132+
```bash
133+
uv run python example.py
134+
```
135+
142136
### Generating the documentation
143137

144138
If added a new service, create a documentation template under api/services for that service.

0 commit comments

Comments
 (0)