Skip to content

Commit 96f70f4

Browse files
committed
uv skeleton
1 parent 3ce5810 commit 96f70f4

File tree

7 files changed

+88
-73
lines changed

7 files changed

+88
-73
lines changed
Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
# 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
53

64
on:
75
release:
@@ -11,23 +9,27 @@ jobs:
119
deploy:
1210
runs-on: ubuntu-latest
1311

12+
# TODO(shamrin) configure trusted publishing and remove TWINE_* vars https://docs.astral.sh/uv/guides/integration/github/#publishing-to-pypi
13+
environment:
14+
name: pypi
15+
16+
permissions:
17+
id-token: write
18+
contents: read
19+
1420
steps:
15-
- uses: actions/checkout@v2
21+
- uses: actions/checkout@v5
1622

17-
- name: Set up Python
18-
uses: actions/setup-python@v2
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v6
1925
with:
20-
python-version: '3.x'
21-
22-
- name: Install dependencies
23-
run: |
24-
python -m pip install --upgrade pip
25-
pip install setuptools wheel twine
26-
27-
- name: Build and publish
28-
env:
29-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
30-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
31-
run: |
32-
python setup.py sdist bdist_wheel
33-
twine upload dist/*
26+
version: "0.9.5"
27+
28+
- name: Set up Python
29+
run: uv python install
30+
31+
- name: Build
32+
run: uv build
33+
34+
- name: Publish
35+
run: uv publish

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.13

CONTRIBUTING.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,13 @@ You can open pull requests by following the steps:
7171

7272
To release a new version:
7373

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).
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).

datacrunch/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
from datacrunch.datacrunch import DataCrunchClient
2+
3+
from datacrunch.__version__ import __version__

datacrunch/__version__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
VERSION = '1.15.0'
1+
try:
2+
from importlib.metadata import version
3+
__version__ = version('datacrunch')
4+
except Exception:
5+
__version__ = "0.0.0+dev" # fallback for development
6+
7+
VERSION = __version__ # legacy API

pyproject.toml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
[project]
2+
name = "datacrunch-python"
3+
version = "1.15.0"
4+
description = "Official Python SDK for DataCrunch Public API"
5+
readme = "README.md"
6+
requires-python = ">=3.11"
7+
8+
authors = [{ name = "DataCrunch Oy", email = "info@datacrunch.io" }]
9+
10+
classifiers = [
11+
"Development Status :: 5 - Production/Stable",
12+
"Intended Audience :: Developers",
13+
"License :: OSI Approved :: MIT License",
14+
"Natural Language :: English",
15+
"Operating System :: OS Independent",
16+
"Programming Language :: Python :: 3",
17+
"Programming Language :: Python :: 3.11",
18+
"Programming Language :: Python :: 3.12",
19+
"Programming Language :: Python :: 3.13",
20+
"Programming Language :: Python :: 3.14",
21+
]
22+
23+
dependencies = ["requests>=2.25.1,<3", "dataclasses_json>=0.6.7"]
24+
25+
[dependency-groups]
26+
dev = [
27+
"pytest-cov>=2.10.1,<3",
28+
"pytest-responses>=0.4.0,<1",
29+
"pytest>=6.2.1,<7",
30+
"responses>=0.12.1,<1",
31+
]
32+
33+
[project.urls]
34+
Homepage = "https://github.com/DataCrunch-io"
35+
Documentation = "https://datacrunch-python.readthedocs.io/"
36+
Repository = "https://github.com/DataCrunch-io/datacrunch-python"
37+
Changelog = "https://datacrunch-python.readthedocs.io/en/latest/changelog.html"
38+
39+
[build-system]
40+
requires = ["uv_build>=0.9.5,<0.10.0"]
41+
build-backend = "uv_build"
42+
43+
[tool.uv.build-backend]
44+
module-name = "datacrunch"
45+
module-root = ""

setup.py

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)