You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# This workflow will upload a Python Package using Twine when a release is created
2
-
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3
-
4
-
name: Upload Python Package
1
+
# Based on https://docs.astral.sh/uv/guides/integration/github/#publishing-to-pypi
2
+
name: Publish to PyPI
5
3
6
4
on:
7
5
release:
8
6
types: [published]
9
7
10
8
jobs:
11
9
deploy:
12
-
runs-on: ubuntu-latest
10
+
runs-on: ubuntu-24.04
11
+
12
+
environment:
13
+
name: pypi
14
+
15
+
permissions:
16
+
id-token: write
17
+
contents: read
13
18
14
19
steps:
15
-
- uses: actions/checkout@v2
20
+
- uses: actions/checkout@v5
16
21
17
-
- name: Set up Python
18
-
uses: actions/setup-python@v2
22
+
- name: Install uv
23
+
uses: astral-sh/setup-uv@v6
19
24
with:
20
-
python-version: '3.x'
25
+
version: "0.9.5"
26
+
27
+
- name: Set up Python
28
+
run: uv python install
21
29
22
-
- name: Install dependencies
23
-
run: |
24
-
python -m pip install --upgrade pip
25
-
pip install setuptools wheel twine
30
+
- name: Build
31
+
run: uv build
26
32
27
-
- name: Build and publish
33
+
- name: Publish
34
+
# TODO(shamrin) switch to trusted publishing and remove secrets https://docs.astral.sh/uv/guides/integration/github/#publishing-to-pypi
Copy file name to clipboardExpand all lines: CHANGELOG.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [Unreleased]
9
9
10
+
### Changed
11
+
12
+
- Migrated to `uv`
13
+
- Removed `datacrunch.__version__.VERSION`. Use standard [importlib.metadata.version()](https://docs.python.org/3/library/importlib.metadata.html#importlib.metadata.version) instead:
14
+
```python
15
+
from importlib.metadata import version
16
+
print(version('datacrunch'))
17
+
```
18
+
- Migrated to Ruff for linting
19
+
- Upgraded pytest
20
+
21
+
If you are working on the library itself, do a fresh clone or upgrade your local development environment in-place:
@@ -40,27 +41,20 @@ You can open pull requests by following the steps:
40
41
41
42
5. Make your local changes
42
43
43
-
6.Install dependencies for test:
44
+
6.Run tests:
44
45
45
46
```bash
46
-
pip3 install -e .[test]
47
-
pip3 install -U pytest
47
+
uv run pytest
48
48
```
49
49
50
-
7.Run tests:
50
+
7.Commit and push:
51
51
52
52
```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"
60
54
git push origin {branch-name}
61
55
```
62
56
63
-
9. Submit a pull request in GitHub.
57
+
8. Submit a pull request in GitHub.
64
58
65
59
## Pull Request Guidelines
66
60
@@ -71,10 +65,21 @@ You can open pull requests by following the steps:
71
65
72
66
To release a new version:
73
67
74
-
1. Update the version in `__version__.py`
75
-
2. Add an entry to the `CHANGELOG.md` file
76
-
3.`git tag v{major}.{minor}.{patch}`
77
-
4.`git push origin master`
78
-
5.`git push --tags`
79
-
6.[Draft and publish](https://github.com/DataCrunch-io/datacrunch-python/releases) a new release.
80
-
7. 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 uv.lock
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).
0 commit comments