Skip to content

Commit 41fac20

Browse files
author
Colin Hill
committed
udpate actions and make
1 parent e328387 commit 41fac20

6 files changed

Lines changed: 436 additions & 68 deletions

File tree

.github/workflows/pypi_publish.yml

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,19 @@ on:
66
workflow_dispatch:
77

88
jobs:
9-
build:
9+
publish-pypi:
1010
runs-on: ubuntu-latest
1111
environment: release
1212
permissions:
1313
contents: read
1414
id-token: write
1515
steps:
1616
- uses: actions/checkout@v4
17-
- name: Set up Python 3.11
18-
uses: actions/setup-python@v4
1917
with:
20-
python-version: '3.11'
21-
cache: 'pip'
22-
- name: Set up Pixi
23-
uses: prefix-dev/setup-pixi@v0.8.1
24-
with:
25-
pixi-version: v0.39.5
26-
cache: true
27-
auth-host: prefix.dev
28-
auth-token: ${{ secrets.PREFIX_DEV_TOKEN }}
29-
- name: Install Hatch
30-
run: pip install hatch
18+
enable-cache: true
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v6
3121
- name: Build package
32-
run: hatch build
22+
run: make build
3323
- name: Publish to PyPI
34-
uses: pypa/gh-action-pypi-publish@release/v1
24+
run: uv publish --index pypi

.github/workflows/test_pypi_publish.yml

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,19 @@ on:
66
workflow_dispatch:
77

88
jobs:
9-
build:
9+
publish-test-pypi:
1010
runs-on: ubuntu-latest
1111
environment: release
1212
permissions:
1313
contents: read
1414
id-token: write
1515
steps:
1616
- uses: actions/checkout@v4
17-
- name: Set up Python 3.11
18-
uses: actions/setup-python@v4
1917
with:
20-
python-version: '3.11'
21-
cache: 'pip'
22-
- name: Set up Pixi
23-
uses: prefix-dev/setup-pixi@v0.8.1
24-
with:
25-
pixi-version: v0.39.5
26-
cache: true
27-
auth-host: prefix.dev
28-
auth-token: ${{ secrets.PREFIX_DEV_TOKEN }}
29-
- name: Install Hatch
30-
run: pip install hatch
18+
enable-cache: true
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v6
3121
- name: Build package
32-
run: hatch build
22+
run: make build
3323
- name: Publish to TestPyPI
34-
uses: pypa/gh-action-pypi-publish@release/v1
35-
with:
36-
repository-url: https://test.pypi.org/legacy/
24+
run: uv publish --index testpypi

Makefile

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
# lint:
2-
# poetry run ruff check terrapyn/ tests/ --extend-ignore=D1,D2,D4,TID
3-
4-
# .PHONY: test
5-
# # Ignore earth engine directory 'ee'
6-
# test:
7-
# pytest --doctest-modules --cov=terrapyn --cov-branch --cov-report term-missing -vv --color=yes --ignore=terrapyn/ee
8-
91
.PHONY: help build format lint sync lock test upgrade all
102

113
help:
@@ -20,7 +12,7 @@ help:
2012
@echo " all - Run lock, sync, format, lint, and test"
2113

2214
build:
23-
uv build
15+
uv run hatch build
2416

2517
format:
2618
uv run ruff format terrapyn/ tests/

README.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,19 @@ If you already have Python version `3.10` or later you can skip this step.
2626

2727
### Install
2828

29-
#### Via Pip
3029
The package can be installed in an existing Python environment via pip:
3130

3231
```bash
3332
pip install terrapyn
3433
```
3534

36-
#### From Source
37-
Clone the repo and install the package:
35+
Or the repo can be cloned from source:
3836

3937
```bash
4038
git clone https://github.com/colinahill/terrapyn.git && cd terrapyn
4139
```
4240

43-
This project uses [Pixi](https://pixi.sh/) to manage dependencies, which should be installed first. Then, install the package with
41+
## Development
42+
This project uses [Astral uv](https://docs.astral.sh/uv/) to manage dependencies, which should be installed first. Then the environment is created with `uv venv`.
4443

45-
```bash
46-
pixi install
47-
```
44+
A `Makefile` contains most/all of the required tools for code quality, testing and publishing. Run `make help` to see available commands.

pyproject.toml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "terrapyn"
3-
version = "0.1.8"
3+
version = "0.2.0"
44
description = "Toolkit to manipulate Earth observations and models."
55
authors = [{name = "Colin Hill", email = "colinalastairhill@gmail.com"}]
66
readme = "README.md"
@@ -62,6 +62,18 @@ exclude = [
6262
[tool.hatch.version]
6363
path = "pyproject.toml"
6464

65+
[[tool.uv.index]]
66+
name = "pypi"
67+
url = "https://pypi.org/simple/"
68+
publish-url = "https://upload.pypi.org/legacy/"
69+
explicit = true
70+
71+
[[tool.uv.index]]
72+
name = "testpypi"
73+
url = "https://test.pypi.org/simple/"
74+
publish-url = "https://test.pypi.org/legacy/"
75+
explicit = true
76+
6577
[tool.ruff]
6678
line-length = 120
6779
target-version = "py312"
@@ -98,8 +110,8 @@ convention = "google"
98110

99111
[dependency-groups]
100112
dev = [
101-
"coverage-badge>=1.1.2",
102113
"freezegun>=1.5.5",
114+
"hatch>=1.14.1",
103115
"pre-commit>=4.3.0",
104116
"pytest>=8.4.1",
105117
"pytest-cov>=6.2.1",

0 commit comments

Comments
 (0)