Skip to content

Commit aaa73e3

Browse files
committed
Merge pull request #716 from bioimage-io/dev
Update build workflow and update 'Detect new version' job
2 parents 9128c85 + 8abf3a7 commit aaa73e3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+33
-28
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
run-expensive-tests: true
2222
steps:
2323
- uses: actions/checkout@v4
24-
- uses: actions/setup-python@v5
24+
- uses: actions/setup-python@v6
2525
with:
2626
python-version: ${{ matrix.python-version }}
2727
cache: "pip"
@@ -94,7 +94,7 @@ jobs:
9494
with:
9595
name: coverage
9696
path: dist
97-
- uses: actions/setup-python@v5
97+
- uses: actions/setup-python@v6
9898
with:
9999
python-version: "3.12"
100100
cache: "pip"
@@ -167,20 +167,19 @@ jobs:
167167
# with:
168168
# recipe-path: conda-recipe/recipe.yaml
169169

170-
publish-pypi:
171-
name: Publish to PyPI
170+
pip-build:
171+
name: Build and publish to PyPI
172172
needs: test
173-
if: github.ref == 'refs/heads/main'
174173
runs-on: ubuntu-latest
175174
steps:
176175
- name: Check out the repository
177176
uses: actions/checkout@v4
178177
with:
179178
fetch-depth: 2
180179
- name: Set up Python
181-
uses: actions/setup-python@v5
180+
uses: actions/setup-python@v6
182181
with:
183-
python-version: '3.13'
182+
python-version: '3.10'
184183
cache: 'pip'
185184
- name: Install dependencies
186185
run: |
@@ -195,16 +194,16 @@ jobs:
195194
196195
- name: Detect new version
197196
id: check-version
198-
if: steps.check-parent-commit.outputs.sha
197+
if: github.ref == 'refs/heads/main' && steps.check-parent-commit.outputs.sha
199198
uses: salsify/[email protected]
200199
with:
201200
create-tag: false
202201
version-command: |
203-
python -c "from pathlib import Path;print(Path('bioimageio/spec/__init__.py').read_text().split('__version__ = \"')[1].split('\"')[0])"
202+
python -c "from pathlib import Path;print(Path('src/bioimageio/spec/__init__.py').read_text().split('__version__ = \"')[1].split('\"')[0])"
204203
205204
- name: Push tag
206205
id: tag-version
207-
if: steps.check-version.outputs.previous-version != steps.check-version.outputs.current-version
206+
if: github.ref == 'refs/heads/main' && steps.check-version.outputs.previous-version != steps.check-version.outputs.current-version
208207
uses: mathieudutour/[email protected]
209208
with:
210209
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -215,14 +214,15 @@ jobs:
215214
python -m build
216215
217216
- name: Publish package on PyPI
218-
if: steps.tag-version.outputs.new_tag
217+
if: github.ref == 'refs/heads/main' && steps.tag-version.outputs.new_tag
219218
uses: pypa/gh-action-pypi-publish@release/v1.12
220219
with:
221220
user: __token__
222221
password: "${{ secrets.PYPI_TOKEN }}"
223222
packages-dir: dist/
224223

225224
- name: Publish the release notes
225+
if: github.ref == 'refs/heads/main'
226226
uses: release-drafter/[email protected]
227227
with:
228228
publish: "${{ steps.tag-version.outputs.new_tag != '' }}"

changelog.md

Lines changed: 4 additions & 0 deletions

conda-recipe/meta.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% set pyproject = load_file_data('pyproject.toml') %}
22
{% set version_match = load_file_regex(
3-
load_file="bioimageio/spec/__init__.py",
3+
load_file="src/bioimageio/spec/__init__.py",
44
regex_pattern='__version__ = "(.+)"') %}
55
{% set version = version_match[1] %}
66

@@ -12,7 +12,7 @@ source:
1212
path: ..
1313

1414
requirements:
15-
build:
15+
host:
1616
- python {{ pyproject['project']['requires-python'] }}
1717
{% for dep in pyproject['build-system']['requires'] %}
1818
- {{ dep.lower() }}
@@ -25,6 +25,7 @@ requirements:
2525

2626
build:
2727
noarch: python
28+
number: 0
2829
script:
2930
- python -m pip install --no-deps --ignore-installed .
3031

dev/env.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ dependencies:
1515
- numpy[version='>=1.21']
1616
- packaging[version='>=17.0']
1717
- pip
18-
- pooch
18+
- platformdirs
1919
- pre-commit
2020
- psutil
2121
- pydantic-settings

pyproject.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@ requires-python = ">=3.8"
66
dependencies = [
77
"annotated-types>=0.5.0,<1",
88
"email_validator",
9+
"exceptiongroup", # TODO: remove when py3.11 is lowest supported version
910
"genericache==0.5.2",
11+
"httpx",
1012
"imageio",
1113
"loguru",
1214
"markdown",
1315
"numpy>=1.21",
1416
"packaging>=17.0",
15-
"pooch>=1.5,<2",
17+
"platformdirs",
1618
"pydantic-settings>=2.5,<3",
1719
"pydantic>=2.10.3,<2.12",
1820
"python-dateutil",
19-
"httpx",
2021
"rich",
2122
"ruyaml",
2223
"tifffile>=2020.7.4",
2324
"tqdm",
2425
"typing-extensions",
25-
"exceptiongroup", # TODO: remove when py3.11 is lowest supported version
2626
"zipp",
2727
]
2828
classifiers = [
@@ -60,7 +60,7 @@ requires = ["pip", "setuptools>=61.0"]
6060
build-backend = "setuptools.build_meta"
6161

6262
[tool.setuptools.packages.find]
63-
include = ["bioimageio"]
63+
where = ["src/"]
6464

6565
[tool.setuptools.dynamic]
6666
version = { attr = "bioimageio.spec.__version__" }
@@ -74,7 +74,7 @@ exclude = [
7474
"bioimageio_cache",
7575
"tests/old_*",
7676
]
77-
include = ["bioimageio", "scripts", "tests"]
77+
include = ["src", "scripts", "tests"]
7878
pythonPlatform = "All"
7979
pythonVersion = "3.8"
8080
reportDuplicateImport = "error"
@@ -106,7 +106,7 @@ useLibraryCodeForTypes = true
106106

107107
[tool.pytest.ini_options]
108108
addopts = " --failed-first --doctest-modules"
109-
testpaths = ["bioimageio/spec", "tests"]
109+
testpaths = ["src", "tests"]
110110

111111
[tool.ruff]
112112
line-length = 88
@@ -119,7 +119,7 @@ exclude = [
119119

120120
[tool.coverage.report]
121121
omit = [
122-
"bioimageio/spec/pretty_validation_errors.py",
123-
"bioimageio/spec/partner_utils/imjoy/*.py",
122+
"src/bioimageio/spec/pretty_validation_errors.py",
123+
"src/bioimageio/spec/partner_utils/imjoy/*.py",
124124
]
125125
exclude_also = ["if TYPE_CHECKING:", "assert_never\\("]

scripts/generate_version_submodule_imports.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from tempfile import TemporaryDirectory
99
from typing import List, Literal
1010

11-
ROOT_PATH = Path(__file__).parent.parent
11+
SRC_PATH = Path(__file__).parent.parent / "src"
1212

1313
AUTOGEN_START = "# autogen: start\n"
1414
AUTOGEN_BODY_SINGLE = """from . import {info.latest_version_module}
@@ -113,7 +113,7 @@ def __post_init__(self):
113113
)
114114
self.all_version_modules_imports = "\n".join(avmi)
115115

116-
self.package_path = (ROOT_PATH / "bioimageio" / "spec" / self.target).resolve()
116+
self.package_path = (SRC_PATH / "bioimageio" / "spec" / self.target).resolve()
117117
self.submodule_list = "\n".join(
118118
[
119119
f"- {self.target} {vm}: `bioimageio.spec.{self.target}.{vm}."
@@ -176,7 +176,7 @@ def process(info: Info, check: bool):
176176
def get_ordered_version_submodules(target: str):
177177
matches = [
178178
m
179-
for p in (ROOT_PATH / "bioimageio" / "spec" / target).iterdir()
179+
for p in (SRC_PATH / "bioimageio" / "spec" / target).iterdir()
180180
if p.is_file() and (m := re.fullmatch(VERSION_MODULE_PATTERN, p.name))
181181
]
182182
if not matches:

bioimageio/spec/__init__.py renamed to src/bioimageio/spec/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44
# ruff: noqa: E402
55

6-
__version__ = "0.5.5.1"
6+
__version__ = "0.5.5.2"
77
from loguru import logger
88

99
logger.disable("bioimageio.spec")
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)