Skip to content

Commit

Permalink
Migrate to hatch (#889)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
jacobtomlinson authored Apr 30, 2024
1 parent e39d59c commit ef41984
Show file tree
Hide file tree
Showing 11 changed files with 113 additions and 3,119 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.*
Dockerfile
dist/
13 changes: 6 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ jobs:

steps:
- name: Checkout source
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python 3.10
uses: actions/setup-python@v1
with:
python-version: "3.10"

- name: Install pypa/build and chartpress
run: python -m pip install build wheel chartpress pyyaml
run: python -m pip install hatch build wheel chartpress pyyaml

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

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

- name: Get the version
id: get_version
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,7 @@ credentials.csv

# IDEs
.idea/
.vscode/
.vscode/

# Version
_version.py
10 changes: 8 additions & 2 deletions dask_kubernetes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from warnings import warn

from . import config
from . import _version

from .common.auth import (
AutoRefreshConfiguration,
AutoRefreshKubeConfigLoader,
Expand All @@ -15,7 +15,13 @@
from .helm import HelmCluster

__all__ = ["HelmCluster", "KubeCluster"]
__version__ = _version.get_versions()["version"]

try:
from ._version import version as __version__ # noqa
from ._version import version_tuple as __version_tuple__ # noqa
except ImportError:
__version__ = "0.0.0"
__version_tuple__ = (0, 0, 0)


def __getattr__(name):
Expand Down
Loading

0 comments on commit ef41984

Please sign in to comment.