Skip to content

Commit ef41984

Browse files
Migrate to hatch (#889)
* Migrate to hatch * Checkout full history * Install project * Remove clone depth * Build package in container multi-stage build to ensure correct versioning * Remove debugging pip install command * Fetch full depth to correctly calculate version * Reinstate entrypoints
1 parent e39d59c commit ef41984

File tree

11 files changed

+113
-3119
lines changed

11 files changed

+113
-3119
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
.*
21
Dockerfile
2+
dist/

.github/workflows/release.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ jobs:
88

99
steps:
1010
- name: Checkout source
11-
uses: actions/checkout@v2
11+
uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
1214

1315
- name: Set up Python 3.10
1416
uses: actions/setup-python@v1
1517
with:
1618
python-version: "3.10"
1719

1820
- name: Install pypa/build and chartpress
19-
run: python -m pip install build wheel chartpress pyyaml
21+
run: python -m pip install hatch build wheel chartpress pyyaml
2022

2123
# chartpress pushes a packages Helm chart to dask/helm-chart's gh-pages
2224
# branch, so we need to have a git user.email and user.name configured
@@ -27,14 +29,11 @@ jobs:
2729
2830
- name: Build distributions
2931
shell: bash -l {0}
30-
run: python setup.py sdist bdist_wheel
32+
run: hatch build
3133

3234
- name: Publish package to PyPI
3335
if: github.repository == 'dask/dask-kubernetes' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
34-
uses: pypa/gh-action-pypi-publish@master
35-
with:
36-
user: __token__
37-
password: ${{ secrets.pypi_password }}
36+
uses: pypa/gh-action-pypi-publish@release/v1
3837

3938
- name: Get the version
4039
id: get_version

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,7 @@ credentials.csv
141141

142142
# IDEs
143143
.idea/
144-
.vscode/
144+
.vscode/
145+
146+
# Version
147+
_version.py

dask_kubernetes/__init__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from warnings import warn
33

44
from . import config
5-
from . import _version
5+
66
from .common.auth import (
77
AutoRefreshConfiguration,
88
AutoRefreshKubeConfigLoader,
@@ -15,7 +15,13 @@
1515
from .helm import HelmCluster
1616

1717
__all__ = ["HelmCluster", "KubeCluster"]
18-
__version__ = _version.get_versions()["version"]
18+
19+
try:
20+
from ._version import version as __version__ # noqa
21+
from ._version import version_tuple as __version_tuple__ # noqa
22+
except ImportError:
23+
__version__ = "0.0.0"
24+
__version_tuple__ = (0, 0, 0)
1925

2026

2127
def __getattr__(name):

0 commit comments

Comments
 (0)