diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..d3ebdbf --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,46 @@ +name: Publish to PyPI + +on: + release: + types: [published] + +jobs: + build: + name: Build distributions + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup uv + uses: astral-sh/setup-uv@v4 + + - name: Build package + run: uv build + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: dist-artifacts + path: dist/ + + publish: + name: Publish to PyPI + runs-on: ubuntu-latest + needs: build + permissions: + id-token: write + environment: + name: pypi + url: https://pypi.org/p/jump-image-datasets + steps: + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + name: dist-artifacts + path: dist/ + + - name: Publish package + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/README.md b/README.md index 81d7a65..86e7a97 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,14 @@ ## Install +### Install from PyPI + +```bash +pip install jump-image-datasets +``` + +Install from PyPI for stable, versioned releases. + ### Local development with uv ```bash @@ -23,7 +31,7 @@ uv pip install -e . pip install "git+https://github.com/WayScience/jump_image_data_downloader.git" ``` -This installs the package directly from the latest code, rather than from a PyPI release. +Install from GitHub if you want the latest unreleased changes. ## Usage diff --git a/pyproject.toml b/pyproject.toml index 94021be..cd92df0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,10 @@ [build-system] -requires = ["setuptools>=68", "wheel"] +requires = ["setuptools>=68", "setuptools_scm[toml]>=8", "wheel"] build-backend = "setuptools.build_meta" [project] name = "jump-image-datasets" -version = "0.1.0" +dynamic = ["version"] description = "Download and access JUMP image datasets and metadata." readme = "README.md" requires-python = ">=3.10" @@ -31,6 +31,9 @@ where = ["src"] [tool.setuptools.package-data] "jump_image_datasets.jump_pilot" = ["data/*.parquet"] +[tool.setuptools_scm] +tag_regex = "^(?:v)?(?P\\d+\\.\\d+\\.\\d+.*)$" + [dependency-groups] notebook = [ "jupyter>=1.1.1", diff --git a/uv.lock b/uv.lock index f74b56c..3ee5a71 100644 --- a/uv.lock +++ b/uv.lock @@ -1057,7 +1057,6 @@ wheels = [ [[package]] name = "jump-image-datasets" -version = "0.1.0" source = { editable = "." } dependencies = [ { name = "pandas", version = "2.3.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" },