Skip to content

Commit 3071fca

Browse files
committed
uv-based instructions
1 parent ef8b0ea commit 3071fca

File tree

2 files changed

+51
-55
lines changed

2 files changed

+51
-55
lines changed

CONTRIBUTING.md

Lines changed: 27 additions & 25 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+
6. Run tests:
4445

4546
```bash
46-
pip3 install -e .[test]
47-
pip3 install -U pytest
47+
uv run pytest
4848
```
4949

50-
7. Run tests:
50+
7. Commit and push:
5151

5252
```bash
53-
pytest
54-
```
55-
56-
8. Commit and push:
57-
58-
```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

@@ -71,13 +65,21 @@ You can open pull requests by following the steps:
7165

7266
To release a new version:
7367

74-
1. Update version and push:
75-
```
76-
uv version --bump minor # also `major` or `patch`
77-
git commit -m v$(uv version --short)
78-
git tag v$(uv version --short)
79-
git push origin master
80-
git push --tags
81-
```
82-
2. [Draft and publish](https://github.com/DataCrunch-io/datacrunch-python/releases) a new release.
83-
3. Check that package is automatically published to [PyPI](https://pypi.org/project/datacrunch/) via [GitHub action](https://github.com/DataCrunch-io/datacrunch-python/actions/workflows/publish_package.yml).
68+
1. Bump version:
69+
```bash
70+
uv version --bump minor # also `major` or `patch`
71+
```
72+
73+
2. Update `CHANGELOG.md`
74+
75+
3. Commit and push:
76+
```bash
77+
git commit -m v$(uv version --short) CHANGELOG.md pyproject.toml
78+
git tag v$(uv version --short)
79+
git push origin master
80+
git push --tags
81+
```
82+
83+
4. [Draft and publish](https://github.com/DataCrunch-io/datacrunch-python/releases) a new release.
84+
85+
5. Check that package is automatically published to [PyPI](https://pypi.org/project/datacrunch/) via [GitHub action](https://github.com/DataCrunch-io/datacrunch-python/actions/workflows/publish_package.yml).

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)