Skip to content

Commit

Permalink
🔨 clean up requirements for ozi-core 0.3
Browse files Browse the repository at this point in the history
Signed-off-by: rjdbcm <[email protected]>
  • Loading branch information
rjdbcm committed Aug 23, 2024
1 parent 788d0a4 commit 645cc12
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 15 deletions.
30 changes: 22 additions & 8 deletions ozi/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ def setup(c: Context, suite: str = 'dist', draft: bool = False) -> None | Result
"""Setup a meson build directory for an OZI suite."""
target = Path(f'.tox/{suite}/tmp').absolute() # noqa: S108
env_dir = Path(f'.tox/{suite}').absolute()
c.run(f'meson setup {target} -D{suite}=enabled -Dtox-env-dir={env_dir} --reconfigure')
c.run(
f'meson setup {target} -D{suite}=enabled -Dtox-env-dir={env_dir} --reconfigure',
)
if draft and suite == 'dist':
return c.run('psr --strict version')
return None


@task
Expand All @@ -65,27 +68,38 @@ def sign_checkpoint(c: Context, suite: str | None = None) -> None:
@task
def checkpoint(c: Context, suite: str, maxfail: int = 1) -> None:
"""Run OZI checkpoint suites with meson test."""
setup(c, suite=suite, draft=False)
target = Path(f'.tox/{suite}/tmp').absolute() # noqa: S108
c.run(f'meson test --no-rebuild --maxfail={maxfail} -C {target} --setup={suite}')
sign_checkpoint(c, suite=suite)
c.run(
f'meson test --no-rebuild --maxfail={maxfail} -C {target} --setup={suite}',
)


@task(
pre=[
call(checkpoint, suite='dist'), # type: ignore
call(checkpoint, suite='test'), # type: ignore
call(checkpoint, suite='lint'), # type: ignore
call(sign_checkpoint, suite='dist'), # type: ignore
call(sign_checkpoint, suite='test'), # type: ignore
call(sign_checkpoint, suite='lint'), # type: ignore
],
)
def release(c: Context, sdist: bool = False, draft: bool = False, cibuildwheel: bool = True) -> None:
def release(
c: Context,
sdist: bool = False,
draft: bool = False,
cibuildwheel: bool = True,
) -> None:
"""Create releases for the current interpreter."""
draft_ = setup(c, suite='dist', draft=draft)
if draft_ and draft_.exited != 0:
return print('No release drafted.', file=sys.stderr)
if sdist:
c.run('python -m build --sdist')
c.run('sigstore sign dist/*.tar.gz')
ext_wheel = c.run('cibuildwheel --prerelease-pythons --output-dir dist .') if cibuildwheel else None
ext_wheel = (
c.run('cibuildwheel --prerelease-pythons --output-dir dist .')
if cibuildwheel
else None
)
if (ext_wheel and ext_wheel.exited != 0) or cibuildwheel:
c.run('python -m build --wheel')
c.run('sigstore sign --output-dir=sig dist/*.whl')
Expand Down
6 changes: 1 addition & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ commands_pre =
python -m uv pip install -r requirements.in OZI.build>=1.0.2 invoke~=2.2 pip-tools>=7 pipx~=1.5 setuptools_scm[toml]~=8.0
pipx install --python=python meson
commands =
meson setup {env_tmp_dir} -D{env_name}=enabled -Dtox-env-dir={env_dir}
meson setup {env_tmp_dir} -Ddist=disabled -Dtox-env-dir={env_dir}
meson compile -C {env_tmp_dir}
rm -rf {env_tmp_dir}/.gitignore
commands_post =
Expand Down Expand Up @@ -418,10 +418,6 @@ commands_post =
[testenv:invoke]
description = OZI invoke task entrypoint, for more info use "tox -e invoke -- --list"
no_package = true
commands =
meson setup {env_tmp_dir} -Ddist=disabled -Dtox-env-dir={env_dir}
meson compile -C {env_tmp_dir}
rm -rf {env_tmp_dir}/.gitignore
commands_post =
{env_python} -m invoke --search-root={env_tmp_dir}/ozi {posargs:--list}
"""
3 changes: 1 addition & 2 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
ozi-core~=0.2.4
pip-tools~=7.4
ozi-core~=0.3.0
setuptools_scm[toml]
tomli>=2.0.0;python_version<"3.11"

0 comments on commit 645cc12

Please sign in to comment.