Skip to content
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
42 changes: 42 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build and upload to PyPI

on:
workflow_dispatch:
release:
types:
- published

jobs:
build:
name: Build distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@v5
- name: Build sdist and wheel
run: uv build
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/*

upload_pypi:
needs: [build]
environment:
name: pypi
url: https://pypi.org/p/asebytes
permissions:
id-token: write
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'release' && github.event.action == 'published')
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ benchmark_results.json

# Git worktrees
.worktrees/

# hatch-vcs generated version file
src/asebytes/_version.py
12 changes: 9 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "asebytes"
version = "0.3.0"
dynamic = ["version"]
description = "Fast binary serialization and storage for ASE Atoms."
authors = [
{ name = "Fabian Zills", email = "fzills@icp.uni-stuttgart.de" },
Expand All @@ -15,8 +15,8 @@ dependencies = [
]

[build-system]
requires = ["uv_build>=0.9.6,<0.10.0"]
build-backend = "uv_build"
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[dependency-groups]
dev = [
Expand Down Expand Up @@ -62,6 +62,12 @@ redis = [
"redis>=5.0",
]

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

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

[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
Expand Down
3 changes: 1 addition & 2 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.