Skip to content

Commit

Permalink
Merge pull request #66 from scverse/kevinyamauchi-patch-1
Browse files Browse the repository at this point in the history
add deploy to github actions
  • Loading branch information
kevinyamauchi authored May 2, 2023
2 parents b7f2330 + 9c4f090 commit aa1d238
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 3 deletions.
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

0 comments on commit aa1d238

Please sign in to comment.