Skip to content

add deploy to github actions #66

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Test
on:
push:
branches: [main]
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
pull_request:
branches: [main]

Expand Down Expand Up @@ -76,3 +78,29 @@ jobs:
with:
name: coverage
verbose: true
deploy:
# this will run when you have tagged a commit, starting with "v*"
# and requires that you have put your twine API key in your
# github secrets (see readme for details)
needs: [test]
runs-on: ubuntu-latest
if: contains(github.ref, 'tags')
steps:
- name: Checkout code
uses: actions/checkout@v3

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

- name: Install hatch
run: pip install hatch

- name: Build project for distribution
run: hatch build

- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
17 changes: 14 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]
requires = ["hatchling", "hatch-vcs"]


[project]
Expand All @@ -15,7 +15,9 @@ maintainers = [
urls.Documentation = "https://spatialdata.scverse.org/projects/plot/en/latest/"
urls.Source = "https://github.com/scverse/spatialdata-plot.git"
urls.Home-page = "https://github.com/scverse/spatialdata-plot.git"
version = "0.0.1.dev1"
dynamic= [
"version" # allow version to be set by git tags
]
requires-python = ">=3.9"
license = {file = "LICENSE"}
readme = "README.md"
Expand Down Expand Up @@ -101,6 +103,15 @@ formats = "ipynb,md"
[tool.hatch.metadata]
allow-direct-references = true

[tool.hatch.build.targets.wheel]
packages = ['src/spatialdata_plot']

[tool.hatch.version]
source = "vcs"

[tool.hatch.build.hooks.vcs]
version-file = "_version.py"

[tool.ruff]
exclude = [
".git",
Expand Down Expand Up @@ -162,4 +173,4 @@ target-version = "py39"
convention = "numpy"
[tool.ruff.pyupgrade]
# Preserve types, even if a file imports `from __future__ import annotations`.
keep-runtime-typing = true
keep-runtime-typing = true