Skip to content

Commit 7eb16c3

Browse files
authored
Add publish on release action can change to uv buld (#106)
1 parent 6c72299 commit 7eb16c3

File tree

3 files changed

+38
-13
lines changed

3 files changed

+38
-13
lines changed

.github/workflows/publish.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
tests:
9+
uses: ./.github/workflows/test.yml
10+
11+
release:
12+
runs-on: ubuntu-latest
13+
needs: tests
14+
if: needs.tests.result == 'success'
15+
permissions:
16+
id-token: write
17+
18+
steps:
19+
- name: Check out repo
20+
uses: actions/checkout@v4
21+
22+
- name: Setup uv
23+
uses: astral-sh/setup-uv@v6
24+
25+
- name: Build package with uv
26+
run: uv build
27+
28+
- name: Publish package distributions to PyPI with uv
29+
run: uv publish -t ${{ secrets.PYPI_TOKEN }}

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)
66
[![GitHub Repo Size](https://img.shields.io/github/repo-size/comprhys/aviary?label=Repo+Size)](https://github.com/comprhys/aviary/graphs/contributors)
7+
[![PyPI](https://img.shields.io/pypi/v/aviary-models?logo=pypi&logoColor=white)](https://pypi.org/project/aviary-models)
78
[![GitHub last commit](https://img.shields.io/github/last-commit/comprhys/aviary?label=Last+Commit)](https://github.com/comprhys/aviary/commits)
89
[![Tests](https://github.com/CompRhys/aviary/actions/workflows/test.yml/badge.svg)](https://github.com/CompRhys/aviary/actions/workflows/test.yml)
910
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/CompRhys/aviary/main.svg)](https://results.pre-commit.ci/latest/github/CompRhys/aviary/main)
@@ -18,7 +19,7 @@ The aim of `aviary` is to contain multiple models for materials discovery under
1819
Users can install `aviary` from source with
1920

2021
```sh
21-
pip install -U git+https://github.com/CompRhys/aviary
22+
pip install aviary-models
2223
```
2324

2425
or for an editable source install from a local clone:

pyproject.toml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
[build-system]
2-
requires = ["hatchling"]
3-
build-backend = "hatchling.build"
4-
51
[project]
6-
name = "aviary"
2+
name = "aviary-models"
73
version = "1.2.0"
84
description = "A collection of machine learning models for materials discovery"
95
authors = [{ name = "Rhys Goodall", email = "rhys.goodall@outlook.com" }]
@@ -52,14 +48,13 @@ Repo = "https://github.com/CompRhys/aviary"
5248
test = ["matminer", "moyopy>=0.3.3", "pytest", "pytest-cov"]
5349
moyopy = ["moyopy>=0.3.3"]
5450

55-
[tool.hatch.build.targets.wheel]
56-
packages = ["aviary"]
51+
[build-system]
52+
requires = ["uv_build>=0.7.5"]
53+
build-backend = "uv_build"
5754

58-
[tool.hatch.build]
59-
include = [
60-
"aviary/**/*.py",
61-
"aviary/**/*.json",
62-
]
55+
[tool.uv.build-backend]
56+
module-name = "aviary"
57+
module-root = ""
6358

6459
[tool.pytest.ini_options]
6560
testpaths = ["tests"]

0 commit comments

Comments
 (0)