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
114 changes: 114 additions & 0 deletions .github/workflows/create_wheel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@

name: Publish package

on:
push:
branches: [ master ]
tags:
- '*'
pull_request:
branches:
- '*'


jobs:
build-wheel:
runs-on: ubuntu-latest

steps:
- name: Clone github repository
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.14"

- run: pip install build
- run: python -m build

- name: Upload wheels to GH artifacts
uses: actions/upload-artifact@v7
with:
name: wheel
path: dist/

upload-wheel:
runs-on: ubuntu-latest
needs: [build-wheel]

steps:
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.14"

- uses: actions/download-artifact@v8
with:
pattern: wheel*
path: dist/

- name: Publish to PyPI
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
packages-dir: dist/
skip-existing: true

test-wheel:
needs: [build-wheel]

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/download-artifact@v8
with:
pattern: wheel*
path: dist/

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

- name: Install package (unix)
if: runner.os != 'Windows'
run: |
ls -l dist
python -m pip install --upgrade pip
pip install dist/*.whl


- name: Install package (Windows)
if: runner.os == 'Windows'
run: |
python -m pip install --upgrade pip
Get-ChildItem dist\*.whl | ForEach-Object { pip install $_.FullName }

- name: Install test dependencies
run: pip install pytest

- name: Clone github repository
uses: actions/checkout@v6


- name: Remove src (Unix)
if: runner.os != 'Windows'
run: rm -rf src

- name: Remove src (Windows)
if: runner.os == 'Windows'
run: Remove-Item -Recurse -Force src

- name: Run tests
run: |
ls
pip freeze
pytest -v
12 changes: 11 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "vvv"
version = "1.0"
version = "0.5.0"
description = "A Python-based 3D/4D image viewer inspired by VV."
requires-python = ">=3.10"
dependencies = [
Expand All @@ -29,6 +29,15 @@ memory = [
"psutil"
]

[tool.setuptools.package-data]
"vvv" = ["fonts/*.otf"]

[tool.setuptools]
package-dir = {"" = "src"}
include-package-data = true

[tool.setuptools.packages.find]
where = ["src"]

[project.scripts]
# This line creates the 'vvv' command in your shell
Expand All @@ -42,3 +51,4 @@ filterwarnings = [
"ignore::DeprecationWarning",
"ignore:SOCKS support in urllib3 requires the installation",
]

Loading