Skip to content

Commit 8c3ba16

Browse files
committed
uv-based instructions
1 parent 9cf4442 commit 8c3ba16

File tree

2 files changed

+27
-33
lines changed

2 files changed

+27
-33
lines changed

CONTRIBUTING.md

Lines changed: 8 additions & 14 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
5953
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: 19 additions & 19 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).
@@ -84,29 +88,18 @@ DataCrunch's Public API documentation [is available here](https://api.datacrunch
8488

8589
### Setting up the local development environment
8690

91+
Prerequisite: install [`uv`](https://docs.astral.sh/uv/).
92+
8793
- Clone the repository:
8894

8995
```bash
9096
git clone
9197
```
9298

93-
- Create local virtual environment:
99+
- Create local virtual environment and install dependencies:
94100

95101
```bash
96-
python3 -m venv datacrunch_env && source ./datacrunch_env/bin/activate
97-
```
98-
99-
or if using [fish shell](https://fishshell.com/):
100-
101-
```fish
102-
python3 -m venv datacrunch_env && source ./datacrunch_env/bin/activate.fish
103-
```
104-
105-
- Install Dependencies:
106-
107-
```bash
108-
pip3 install -e .[test]
109-
pip3 install -U pytest
102+
uv sync
110103
```
111104

112105
### Running Tests
@@ -116,20 +109,21 @@ We use pytest for testing.
116109
- To execute all tests
117110

118111
```bash
119-
pytest
112+
uv run pytest
120113
```
121114

122115
- To execute a single test file
123116

124117
```bash
125-
pytest ./tests/unit_tests/test_file.py
118+
uv run pytest ./tests/unit_tests/test_file.py
126119
```
127120

128121
### Local Manual Testing
129122

130-
Create this file in the root directory of the project:
123+
Create a file in the root directory of the project:
131124

132125
```python
126+
# example.py
133127
from datacrunch.datacrunch import DataCrunchClient
134128

135129
CLIENT_SECRET = 'secret'
@@ -139,6 +133,12 @@ CLIENT_ID = 'your-id'
139133
datacrunch = DataCrunchClient(CLIENT_ID, CLIENT_SECRET, base_url='http://localhost:3001/v1')
140134
```
141135

136+
Run it:
137+
138+
```bash
139+
uv run python example.py
140+
```
141+
142142
### Generating the documentation
143143

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

0 commit comments

Comments
 (0)